Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
i_storage_backend.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
16#pragma once
17
19
20#include <stddef.h>
21#include <stdint.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
29
30// ── Lifecycle ─────────────────────────────────────────────
31
38ENTROPIC_EXPORT entropic_storage_backend_t
39entropic_storage_create(const char* db_path);
40
47ENTROPIC_EXPORT entropic_error_t
49
55ENTROPIC_EXPORT void
57
58// ── Conversation CRUD ─────────────────────────────────────
59
70ENTROPIC_EXPORT char*
73 const char* title,
74 const char* project_path,
75 const char* model_id);
76
85ENTROPIC_EXPORT entropic_error_t
88 const char* conversation_id,
89 const char* messages_json);
90
100ENTROPIC_EXPORT entropic_error_t
103 const char* conversation_id,
104 char** result_json);
105
116ENTROPIC_EXPORT entropic_error_t
119 int limit,
120 int offset,
121 char** result_json);
122
133ENTROPIC_EXPORT entropic_error_t
136 const char* query,
137 int limit,
138 char** result_json);
139
147ENTROPIC_EXPORT entropic_error_t
150 const char* conversation_id);
151
152// ── Delegation storage ────────────────────────────────────
153
167ENTROPIC_EXPORT entropic_error_t
170 const char* parent_conversation_id,
171 const char* delegating_tier,
172 const char* target_tier,
173 const char* task,
174 int max_turns,
175 char** result_json);
176
186ENTROPIC_EXPORT entropic_error_t
189 const char* delegation_id,
190 const char* status,
191 const char* result_summary);
192
202ENTROPIC_EXPORT entropic_error_t
205 const char* conversation_id,
206 char** result_json);
207
208// ── Compaction snapshots ──────────────────────────────────
209
218ENTROPIC_EXPORT entropic_error_t
221 const char* conversation_id,
222 const char* messages_json);
223
224// ── Statistics ────────────────────────────────────────────
225
234ENTROPIC_EXPORT entropic_error_t
237 char** result_json);
238
239#ifdef __cplusplus
240}
241#endif
Error types for cross-.so error reporting.
entropic_error_t
Error codes returned by all C API functions.
Definition error.h:35
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_get_stats(entropic_storage_backend_t storage, char **result_json)
Get storage statistics.
ENTROPIC_EXPORT void entropic_storage_destroy(entropic_storage_backend_t storage)
Destroy storage and close connections.
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_initialize(entropic_storage_backend_t storage)
Initialize storage (run migrations, create tables).
struct entropic_storage_backend * entropic_storage_backend_t
Opaque handle to a storage backend instance.
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_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_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_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 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_search_conversations(entropic_storage_backend_t storage, const char *query, int limit, char **result_json)
Full-text search across conversations.