Home/Docs/Memory System

Memory System

Zubo has a persistent semantic memory system that combines vector embeddings with full-text search. It automatically remembers conversations, ingested documents, and facts you teach it — and retrieves relevant context for every message. This means your agent gets smarter over time, building up a knowledge base that is always available.

How Memory Works

Every piece of content that enters the memory system follows the same pipeline:

  1. Content arrives — This can be a conversation message, an uploaded document, or an explicit memory write via the memory_write tool.
  2. Text is chunked — The content is split into segments of approximately 400 tokens (~1600 characters) with an overlap of approximately 80 tokens (~320 characters) between consecutive chunks.
  3. Chunks are embedded — Each chunk is converted into a 384-dimensional vector using the all-MiniLM-L6-v2 ONNX model. This captures the semantic meaning of the text.
  4. Storage — Chunks, their embeddings, and metadata are stored in SQLite. A full-text search index is updated via triggers.
  5. Retrieval — On every incoming message, Zubo automatically searches memory for relevant context using hybrid search.
  6. Context injection — The top matching results are injected into the LLM context alongside the user's message, giving the agent access to relevant knowledge.

Here is a simplified view of the data flow:

Content --> Chunker --> Embedder --> SQLite (chunks + embeddings)
                                          |
Query --> Hybrid Search <----------------+
           (60% Vector + 40% FTS)
                |
           Top results --> LLM Context

Memory Storage

Zubo stores memory in two complementary layers:

1. File-Based Storage

Memory files live at ~/.zubo/workspace/memory/ and come in two forms:

2. Database Storage

The memory_chunks table in SQLite stores all chunked content with their vector embeddings, source file references, timestamps, and full-text search index entries. This is the primary storage layer that powers memory search. It is fully managed by Zubo — you do not need to interact with it directly.

Search

Zubo supports three search modes, each suited to different scenarios:

Full-Text Search (FTS)

Vector Search

Hybrid Search

Document Ingestion

You can upload documents to populate Zubo's memory with external knowledge. The following file formats are supported:

FormatExtensionNotes
Plain text.txtDirect indexing, no preprocessing needed.
Markdown.mdDirect indexing, preserves structure.
CSV.csvParsed as text with rows preserved.
PDF.pdfRequires pdf-parse (auto-installed on first PDF upload).
Word.docxRequires mammoth (auto-installed on first DOCX upload).
JSON.jsonPretty-printed before indexing.
XML.xmlTags stripped, text content extracted.
YAML.yaml, .ymlDirect indexing.
Code.ts, .js, .py, .shDirect indexing with syntax preserved.

There are three ways to upload documents:

Chunking Strategy

The chunker is responsible for splitting content into segments that are small enough to embed meaningfully but large enough to preserve context. Here is how it works:

This strategy ensures that each chunk is a coherent unit of information that can be meaningfully compared via vector similarity, while the overlap prevents important context from falling between the cracks.

Memory Pruning

To keep the database fast and the storage footprint reasonable, Zubo automatically prunes old memory chunks when the total count exceeds a configurable limit:

In practice, 10,000 chunks represents a substantial amount of knowledge — roughly equivalent to several hundred pages of text. For most personal assistant use cases, you will never hit this limit.

Using Memory

Memory works automatically in the background, but you can also interact with it directly.

Teaching Your Agent

Tell Zubo facts and it will remember them for future conversations:

You: "Remember that my favorite programming language is Rust"
Zubo: "Got it — I'll remember that your favorite language is Rust."

The agent uses the memory_write tool to save this fact. It will be retrievable in future sessions via semantic search.

Searching Memory

You can ask Zubo to recall information it has stored:

You: "What do you remember about my preferences?"
Zubo: "Based on my memory, I know that your favorite programming
       language is Rust. You prefer metric units and Markdown
       formatting. Your timezone is America/New_York."

Memory search also happens automatically on every message. You do not need to explicitly ask the agent to check its memory — it does so as part of normal message processing.

Via the Dashboard

Memory Tools

Zubo provides two built-in tools for memory operations. These are available to the main agent and to any sub-agent that lists them in its ## Tools section:

ToolDescription
memory_writeSave a fact, note, or piece of content to persistent memory. The content is chunked, embedded, and indexed automatically.
memory_searchSearch memory for relevant information using hybrid search. Returns the top matching chunks with their source and relevance score.

Best Practices