Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic::StorageInterface Struct Reference

Storage interface for conversation persistence. More...

#include <entropic/core/engine_types.h>

Public Attributes

bool(* create_conversation )(const char *title, std::string &conversation_id, void *user_data) = nullptr
 Create a root conversation row.
 
bool(* save_snapshot )(const char *conversation_id, const char *messages_json, void *user_data) = nullptr
 Save a compaction snapshot (full history before compaction).
 
bool(* create_delegation )(const char *parent_id, const char *delegating_tier, const char *target_tier, const char *task, int max_turns, std::string &delegation_id, std::string &child_conversation_id, void *user_data) = nullptr
 Create a delegation record with child conversation.
 
bool(* complete_delegation )(const char *delegation_id, const char *status, const char *summary, void *user_data) = nullptr
 Complete a delegation record.
 
bool(* save_conversation )(const char *conversation_id, const char *messages_json, void *user_data) = nullptr
 Save messages to a conversation.
 
bool(* load_delegation_with_messages )(const char *delegation_id, std::string &result_json, void *user_data) = nullptr
 Load a delegation's full child conversation (gh#32, v2.1.6).
 
void * user_data = nullptr
 Opaque pointer (storage backend)
 

Detailed Description

Storage interface for conversation persistence.

Injected by the facade. Allows core.so to persist conversations, delegation records, and compaction snapshots without depending on storage.so. All callbacks are optional (nullptr = no-op).

Version
1.8.8

Definition at line 402 of file engine_types.h.

Member Data Documentation

◆ complete_delegation

bool(* entropic::StorageInterface::complete_delegation) (const char *delegation_id, const char *status, const char *summary, void *user_data) = nullptr

Complete a delegation record.

Parameters
delegation_idDelegation ID.
status"completed" or "failed".
summaryResult summary (may be nullptr).
user_dataOpaque pointer.
Returns
true on success.

Definition at line 458 of file engine_types.h.

◆ create_conversation

bool(* entropic::StorageInterface::create_conversation) (const char *title, std::string &conversation_id, void *user_data) = nullptr

Create a root conversation row.

Called once at AgentEngine::run() init when storage is wired so the engine's LoopContext::conversation_id is populated for the rest of the session. Pre-v2.1.12 (gh#48): no callback existed, root conversation_id stayed empty, every delegation's foreign-key insert into delegations(parent_conversation_id) failed silently against the empty parent string.

Parameters
titleDisplay title (e.g., session description).
[out]conversation_idNewly created conversation ID.
user_dataOpaque pointer.
Returns
true on success and conversation_id populated.
Version
2.1.12

Definition at line 417 of file engine_types.h.

◆ create_delegation

bool(* entropic::StorageInterface::create_delegation) (const char *parent_id, const char *delegating_tier, const char *target_tier, const char *task, int max_turns, std::string &delegation_id, std::string &child_conversation_id, void *user_data) = nullptr

Create a delegation record with child conversation.

Parameters
parent_idParent conversation ID.
delegating_tierSource tier.
target_tierTarget tier.
taskTask description.
max_turnsTurn limit (0 = unlimited).
[out]delegation_idCreated delegation ID.
[out]child_conversation_idCreated child conversation ID.
user_dataOpaque pointer.
Returns
true on success.

Definition at line 442 of file engine_types.h.

◆ load_delegation_with_messages

bool(* entropic::StorageInterface::load_delegation_with_messages) (const char *delegation_id, std::string &result_json, void *user_data) = nullptr

Load a delegation's full child conversation (gh#32, v2.1.6).

Resolves the delegation by id, then loads the child conversation it spawned. Returns a JSON object whose top-level fields include target_tier, messages (array), and delegation_id. The engine uses this on resume_delegation to seed a fresh child context with the prior conversation history.

Parameters
delegation_idDelegation id (storage PK).
[out]result_jsonConversation JSON (target_tier + messages).
user_dataOpaque pointer (storage backend).
Returns
true on success and the delegation+conversation were found.

Definition at line 486 of file engine_types.h.

◆ save_conversation

bool(* entropic::StorageInterface::save_conversation) (const char *conversation_id, const char *messages_json, void *user_data) = nullptr

Save messages to a conversation.

Parameters
conversation_idConversation ID.
messages_jsonJSON array of message objects.
user_dataOpaque pointer.
Returns
true on success.

Definition at line 469 of file engine_types.h.

◆ save_snapshot

bool(* entropic::StorageInterface::save_snapshot) (const char *conversation_id, const char *messages_json, void *user_data) = nullptr

Save a compaction snapshot (full history before compaction).

Parameters
conversation_idConversation to snapshot.
messages_jsonJSON array of all messages.
user_dataOpaque pointer.
Returns
true on success.

Definition at line 427 of file engine_types.h.

◆ user_data

void* entropic::StorageInterface::user_data = nullptr

Opaque pointer (storage backend)

Definition at line 491 of file engine_types.h.


The documentation for this struct was generated from the following file: