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:

FieldTypeDescription
idstringUnique identifier (UUID)
contentstringEncrypted text content
categoryMemoryCategoryClassification of the memory
tagsstring[]Searchable tags
confidenceConfidenceReliability rating
created_ati64Unix timestamp of creation
last_accessedi64Unix timestamp of last retrieval

Categories

CategoryDescription
learningFacts and knowledge the agent has acquired
decisionDecisions made and their rationale
patternRecurring patterns observed across tasks
solutionSuccessful approaches to specific problems
errorErrors encountered and how they were resolved

Confidence Levels

LevelDescription
highVerified through multiple sources or repeated success
mediumReasonable certainty (default for new entries)
lowTentative or unverified

Operations

Store

Persist a new memory entry with content, category, and optional tags.

Store Request json
{
  "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.

Recall Request json
{
  "query": "API rate limiting",
  "limit": 5,
  "min_similarity": 0.3,
  "category_filter": "learning"
}
ParameterDefaultDescription
queryNatural language search query (required)
limit5Maximum number of results
min_similarity0.3Minimum cosine similarity threshold
category_filternullFilter 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.