|
Entropic 2.3.8
Local-first agentic inference engine
|
Pure C interface contract for storage backends. More...


Go to the source code of this file.
Typedefs | |
| typedef struct entropic_storage_backend * | entropic_storage_backend_t |
| Opaque handle to a storage backend instance. | |
Functions | |
| ENTROPIC_EXPORT entropic_storage_backend_t | entropic_storage_create (const char *db_path) |
| Create a storage backend with SQLite at the given path. | |
| ENTROPIC_EXPORT entropic_error_t | entropic_storage_initialize (entropic_storage_backend_t storage) |
| Initialize storage (run migrations, create tables). | |
| ENTROPIC_EXPORT void | entropic_storage_destroy (entropic_storage_backend_t storage) |
| Destroy storage and close connections. | |
| ENTROPIC_EXPORT char * | entropic_storage_create_conversation (entropic_storage_backend_t storage, const char *title, const char *project_path, const char *model_id) |
| Create a new conversation. | |
| ENTROPIC_EXPORT entropic_error_t | entropic_storage_save_conversation (entropic_storage_backend_t storage, const char *conversation_id, const char *messages_json) |
| Save messages to a conversation. | |
| ENTROPIC_EXPORT entropic_error_t | entropic_storage_load_conversation (entropic_storage_backend_t storage, const char *conversation_id, char **result_json) |
| Load a conversation with messages. | |
| ENTROPIC_EXPORT entropic_error_t | entropic_storage_list_conversations (entropic_storage_backend_t storage, int limit, int offset, char **result_json) |
| List conversations with pagination. | |
| ENTROPIC_EXPORT entropic_error_t | entropic_storage_search_conversations (entropic_storage_backend_t storage, const char *query, int limit, char **result_json) |
| Full-text search across conversations. | |
| ENTROPIC_EXPORT entropic_error_t | entropic_storage_delete_conversation (entropic_storage_backend_t storage, const char *conversation_id) |
| Delete a conversation and all associated records. | |
| ENTROPIC_EXPORT entropic_error_t | entropic_storage_create_delegation (entropic_storage_backend_t storage, const char *parent_conversation_id, const char *delegating_tier, const char *target_tier, const char *task, int max_turns, char **result_json) |
| Create a delegation record with a child conversation. | |
| ENTROPIC_EXPORT entropic_error_t | entropic_storage_complete_delegation (entropic_storage_backend_t storage, const char *delegation_id, const char *status, const char *result_summary) |
| Mark a delegation as completed or failed. | |
| ENTROPIC_EXPORT entropic_error_t | entropic_storage_get_delegations (entropic_storage_backend_t storage, const char *conversation_id, char **result_json) |
| Get delegations for a parent conversation. | |
| ENTROPIC_EXPORT entropic_error_t | entropic_storage_save_snapshot (entropic_storage_backend_t storage, const char *conversation_id, const char *messages_json) |
| Save a pre-compaction snapshot of full conversation history. | |
| ENTROPIC_EXPORT entropic_error_t | entropic_storage_get_stats (entropic_storage_backend_t storage, char **result_json) |
| Get storage statistics. | |
Pure C interface contract for storage backends.
Defines the .so boundary for librentropic-storage. All functions accept/return C types only (opaque handles, const char*, error codes). No C++ types cross this boundary.
Storage is fully optional. NULL handle checks are the consumer's responsibility — passing NULL to any function returns an error code.
Definition in file i_storage_backend.h.
| typedef struct entropic_storage_backend* entropic_storage_backend_t |
Opaque handle to a storage backend instance.
Definition at line 28 of file i_storage_backend.h.
| ENTROPIC_EXPORT entropic_error_t entropic_storage_complete_delegation | ( | entropic_storage_backend_t | storage, |
| const char * | delegation_id, | ||
| const char * | status, | ||
| const char * | result_summary | ||
| ) |
Mark a delegation as completed or failed.
| storage | Storage handle. |
| delegation_id | Delegation ID. |
| status | "completed" or "failed". |
| result_summary | Summary text or NULL. |
Mark a delegation as completed or failed.
| storage | Handle. |
| delegation_id | Delegation ID. |
| status | Status string. |
| result_summary | Optional summary. |
Definition at line 333 of file c_interface.cpp.
| ENTROPIC_EXPORT entropic_storage_backend_t entropic_storage_create | ( | const char * | db_path | ) |
Create a storage backend with SQLite at the given path.
| db_path | Path to SQLite database file. Created if absent. |
Create a storage backend with SQLite at the given path.
| db_path | Database file path. |
Definition at line 80 of file c_interface.cpp.
| ENTROPIC_EXPORT char * entropic_storage_create_conversation | ( | entropic_storage_backend_t | storage, |
| const char * | title, | ||
| const char * | project_path, | ||
| const char * | model_id | ||
| ) |
Create a new conversation.
| storage | Storage handle. |
| title | Conversation title (null-terminated). |
| project_path | Project path or NULL. |
| model_id | Model identifier or NULL. |
Create a new conversation.
| storage | Handle. |
| title | Title. |
| project_path | Optional project path. |
| model_id | Optional model ID. |
Definition at line 131 of file c_interface.cpp.
| ENTROPIC_EXPORT entropic_error_t entropic_storage_create_delegation | ( | entropic_storage_backend_t | storage, |
| const char * | parent_conversation_id, | ||
| const char * | delegating_tier, | ||
| const char * | target_tier, | ||
| const char * | task, | ||
| int | max_turns, | ||
| char ** | result_json | ||
| ) |
Create a delegation record with a child conversation.
| storage | Storage handle. |
| parent_conversation_id | Parent conversation ID. |
| delegating_tier | Tier initiating delegation. |
| target_tier | Target tier for child loop. |
| task | Task description. |
| max_turns | Max turns for child (0 for unlimited). |
| result_json | Output: JSON with "delegation_id" and "child_conversation_id". Caller must free. |
Create a delegation record with a child conversation.
| storage | Handle. |
| parent_conversation_id | Parent conversation. |
| delegating_tier | Source tier. |
| target_tier | Target tier. |
| task | Task description. |
| max_turns | Turn limit. |
| result_json | Output JSON. |
Definition at line 294 of file c_interface.cpp.
| ENTROPIC_EXPORT entropic_error_t entropic_storage_delete_conversation | ( | entropic_storage_backend_t | storage, |
| const char * | conversation_id | ||
| ) |
Delete a conversation and all associated records.
| storage | Storage handle. |
| conversation_id | Conversation ID. |
Delete a conversation and all associated records.
| storage | Handle. |
| conversation_id | Conversation ID. |
Definition at line 264 of file c_interface.cpp.
| ENTROPIC_EXPORT void entropic_storage_destroy | ( | entropic_storage_backend_t | storage | ) |
Destroy storage and close connections.
| storage | Storage handle (NULL-safe). |
Destroy storage and close connections.
| storage | Handle (NULL-safe). |
Definition at line 115 of file c_interface.cpp.
| ENTROPIC_EXPORT entropic_error_t entropic_storage_get_delegations | ( | entropic_storage_backend_t | storage, |
| const char * | conversation_id, | ||
| char ** | result_json | ||
| ) |
Get delegations for a parent conversation.
| storage | Storage handle. |
| conversation_id | Parent conversation ID. |
| result_json | Output: JSON array of delegation records. Caller must free. |
Get delegations for a parent conversation.
| storage | Handle. |
| conversation_id | Parent conversation. |
| result_json | Output JSON. |
Definition at line 360 of file c_interface.cpp.
| ENTROPIC_EXPORT entropic_error_t entropic_storage_get_stats | ( | entropic_storage_backend_t | storage, |
| char ** | result_json | ||
| ) |
Get storage statistics.
| storage | Storage handle. |
| result_json | Output: JSON with total_conversations, total_messages, total_tokens. Caller must free. |
Get storage statistics.
| storage | Handle. |
| result_json | Output JSON. |
Definition at line 415 of file c_interface.cpp.
| ENTROPIC_EXPORT entropic_error_t entropic_storage_initialize | ( | entropic_storage_backend_t | storage | ) |
Initialize storage (run migrations, create tables).
| storage | Storage handle. |
Initialize storage (run migrations, create tables).
| storage | Handle. |
Definition at line 98 of file c_interface.cpp.
| ENTROPIC_EXPORT entropic_error_t entropic_storage_list_conversations | ( | entropic_storage_backend_t | storage, |
| int | limit, | ||
| int | offset, | ||
| char ** | result_json | ||
| ) |
List conversations with pagination.
| storage | Storage handle. |
| limit | Max results. |
| offset | Pagination offset. |
| result_json | Output: JSON array of conversation summaries. Caller must free with entropic_free(). |
List conversations with pagination.
| storage | Handle. |
| limit | Max results. |
| offset | Offset. |
| result_json | Output JSON. |
Definition at line 210 of file c_interface.cpp.
| ENTROPIC_EXPORT entropic_error_t entropic_storage_load_conversation | ( | entropic_storage_backend_t | storage, |
| const char * | conversation_id, | ||
| char ** | result_json | ||
| ) |
Load a conversation with messages.
| storage | Storage handle. |
| conversation_id | Conversation ID. |
| result_json | Output: JSON with "conversation" and "messages". Caller must free with entropic_free(). |
Load a conversation with messages.
| storage | Handle. |
| conversation_id | Conversation ID. |
| result_json | Output JSON. |
Definition at line 181 of file c_interface.cpp.
| ENTROPIC_EXPORT entropic_error_t entropic_storage_save_conversation | ( | entropic_storage_backend_t | storage, |
| const char * | conversation_id, | ||
| const char * | messages_json | ||
| ) |
Save messages to a conversation.
| storage | Storage handle. |
| conversation_id | Conversation ID. |
| messages_json | JSON array of message objects. |
| storage | Handle. |
| conversation_id | Conversation ID. |
| messages_json | JSON array. |
Definition at line 156 of file c_interface.cpp.
| ENTROPIC_EXPORT entropic_error_t entropic_storage_save_snapshot | ( | entropic_storage_backend_t | storage, |
| const char * | conversation_id, | ||
| const char * | messages_json | ||
| ) |
Save a pre-compaction snapshot of full conversation history.
| storage | Storage handle. |
| conversation_id | Conversation ID. |
| messages_json | JSON array of all messages before compaction. |
Save a pre-compaction snapshot of full conversation history.
| storage | Handle. |
| conversation_id | Conversation ID. |
| messages_json | JSON messages. |
Definition at line 389 of file c_interface.cpp.
| ENTROPIC_EXPORT entropic_error_t entropic_storage_search_conversations | ( | entropic_storage_backend_t | storage, |
| const char * | query, | ||
| int | limit, | ||
| char ** | result_json | ||
| ) |
Full-text search across conversations.
| storage | Storage handle. |
| query | FTS5 query string. |
| limit | Max results. |
| result_json | Output: JSON array of search results with snippets. Caller must free with entropic_free(). |
Full-text search across conversations.
| storage | Handle. |
| query | FTS5 query. |
| limit | Max results. |
| result_json | Output JSON. |
Definition at line 238 of file c_interface.cpp.