Expand description
Session and message storage helpers.
Structs§
- Memory
- A memory entry stored in the database.
- Memory
Filter - Filter for memory queries.
- Message
Data - Message data returned to frontends.
- Message
Search Filter - Filter for message search queries.
- Message
Search Result - A message search result from FTS full-text search.
- Session
Info - Session metadata returned to frontends.
- Tool
Call Info Data - Tool call info for storage in message.
Enums§
- Memory
Type - Type of memory entry.
Functions§
- activate_
session - Activate a specific session and deactivate others for the same chat_id.
- deactivate_
memory - Deactivate a memory (soft delete).
- delete_
memory_ permanently - Permanently delete a memory (hard delete).
- delete_
session - Soft-delete a session.
- find_
memories_ by_ title - Find memories by title (fuzzy match using LIKE).
- find_
session_ by_ chat_ id - Find an active session by its platform chat identifier.
- get_
memory - Get a single memory by ID.
- get_
messages - Get all messages for a session, ordered by creation time.
- get_
session - Get a single session by ID.
- init_db
- Initialize the database: create tables if needed, then run migrations.
- insert_
memory - Insert a new memory into the database.
- insert_
message - Insert a message into a session.
- insert_
session - Insert a new session.
- list_
all_ sessions_ by_ chat_ id - List ALL sessions (including inactive ones) for a chat_id, ordered by most recent first.
- list_
memories - List memories with optional filtering.
- list_
sessions - List all active sessions, ordered by most recently updated.
- load_
chat_ messages - Load all messages for a session and convert to chat messages
- message_
to_ chat_ message - Convert stored MessageData to ChatCompletionRequestMessage
- recall_
memories - Recall memories using keyword search (title, content, tags).
- resolve_
db_ path - Resolve the session database path for a working directory and storage scope.
- search_
messages - Search messages using FTS5 full-text search.
- touch_
session - Update a session’s updated_at timestamp.
- update_
memory - Update an existing memory.
- update_
session_ title - Update a session’s title.
- update_
tool_ message - Update a tool message with result.