Memory Store
UltraSushiTron includes an encrypted semantic memory store that lets the AI agent persist knowledge across sessions. Content is encrypted at rest with AES-256-GCM and searchable via vector embeddings.
Architecture
- Encryption β AES-256-GCM with 32-byte (256-bit) keys
- Storage β SQLite database at
~/.local/share/ultrasushitron/memory.db - Vector Search β sqlite-vec extension for embedding-based similarity search
- Isolation β memory store runs inside Zone 2 (AI Core) and never exposes plaintext to external components
Memory Entries
Each memory entry contains:
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier (UUID) |
content | string | Encrypted text content |
category | MemoryCategory | Classification of the memory |
tags | string[] | Searchable tags |
confidence | Confidence | Reliability rating |
created_at | i64 | Unix timestamp of creation |
last_accessed | i64 | Unix timestamp of last retrieval |
Categories
| Category | Description |
|---|---|
learning | Facts and knowledge the agent has acquired |
decision | Decisions made and their rationale |
pattern | Recurring patterns observed across tasks |
solution | Successful approaches to specific problems |
error | Errors encountered and how they were resolved |
Confidence Levels
| Level | Description |
|---|---|
high | Verified through multiple sources or repeated success |
medium | Reasonable certainty (default for new entries) |
low | Tentative or unverified |
Operations
Store
Persist a new memory entry with content, category, and optional tags.
{
"content": "The API rate limit is 100 requests per minute per key",
"category": "learning",
"tags": ["api", "rate-limit"],
"confidence": "high"
} If confidence is omitted, it defaults to medium.
Recall
Search memories using natural language queries. The system generates a vector embedding for the query and returns the most similar entries.
{
"query": "API rate limiting",
"limit": 5,
"min_similarity": 0.3,
"category_filter": "learning"
} | Parameter | Default | Description |
|---|---|---|
query | β | Natural language search query (required) |
limit | 5 | Maximum number of results |
min_similarity | 0.3 | Minimum cosine similarity threshold |
category_filter | null | Filter by category |
Each result includes the memory entry and a similarity score (0.0 to 1.0).
Delete
Remove a memory entry by ID. This operation requires biometric confirmation when triggered from the mobile admin interface.
Consolidate
Periodic consolidation merges related memories and updates confidence levels based on usage patterns. This runs automatically via the Task Scheduler using the memory_consolidation handler.
Admin Interface
The mobile app's Memory tab provides:
- Browse β paginated list of all memory entries with category and confidence indicators
- Search β semantic search using the same vector similarity engine
- Delete β remove individual entries (requires biometric confirmation)
See the Admin API for programmatic access to memory operations.
Agent Behavior
The agent is instructed to use memory proactively:
- Recall at session start β before working on a task, the agent recalls related memories to leverage past solutions and avoid known pitfalls.
- Store after solving problems β when the agent resolves a tricky issue, discovers a pattern, or makes a design decision, it stores the insight for future sessions.
- Verify against current code β recalled memories are always checked against the current codebase, since files may have changed since the memory was created.
You can review and manage stored memories through the Memory tab in the mobile admin interface.