AI & memory
Memory & RAG
Long-term agent memory separate from your notes, semantic search with cited recall, and opt-in Suggest note improvements that never merges without your approval.
Memory & RAG
The “AI” in Zettly is two systems working together. The AI assistant is the conversational surface — the chat panel, the agent delegation, the previews and undo. Underneath it sits the memory and retrieval system that gives the assistant something to think with: long-term memory separate from your notes, semantic search across the vault, and an opt-in Suggest note improvements Flow that proposes tags, links, and summaries without ever touching your files without permission.
This page is about what’s under the hood. It covers the two parts of the system — long-term memory and RAG (retrieval-augmented generation) — and the built-in Suggest note improvements Flow that ties them together.
Two systems, one vault
The split is deliberate. Your notes are the source of truth — the files you wrote, the way you wrote them, the connections you drew. The assistant’s memory is a separate layer that helps the assistant be useful across sessions, but it doesn’t replace or modify your notes.
A short way to think about it:
- Notes are the things you wrote. They live in your vault, in your files. They are not touched by the assistant without your explicit approval.
- Memory is the things the assistant learned. It lives alongside the notes, in a separate index. It helps the assistant remember past sessions, surface relevant context, and avoid asking you the same question twice.
- RAG is the way the assistant finds what to cite. When you ask a question, the RAG system searches the vault semantically and returns the relevant passages.
The split is what makes the privacy guarantees possible. The assistant can be helpful because it has memory and RAG, and the privacy guarantees hold because the memory and RAG are local, scoped to the active vault, and never merged into your notes without approval.
Long-term agent memory
The assistant remembers things across sessions. Not by modifying your notes — by storing a separate memory index that lives in your vault.
A few things the memory system does:
- Remembers the conversations you’ve had. When you ask the assistant a question today, it has access to past conversations for context. It knows that you asked about the launch pricing last week, and what the answer was.
- Remembers your preferences. If you’ve told the assistant “always propose a deck first, then refine,” that preference is in memory. You don’t have to repeat it.
- Remembers project context. The assistant can keep a short summary of each project you’ve worked on, updated as the project evolves. The summary is in memory, not in your notes.
- Remembers your corrections. If the assistant proposes a tag you reject, the rejection is in memory. The next time it sees a similar situation, it doesn’t propose the same thing.
A few things the memory system does not do:
- It doesn’t modify your notes. The memory index is separate. Your notes are yours.
- It doesn’t read notes outside the active vault. Memory is scoped per-vault. If you have two vaults, they have two separate memories.
- It doesn’t sync to any server. Memory is stored locally, in your vault’s IndexedDB. It stays on your machine.
The memory index is inspectable. You can open the memory panel, see what the assistant has remembered, and delete anything that’s no longer relevant. The assistant never refuses to forget.
RAG: semantic search with cited recall
RAG stands for Retrieval-Augmented Generation. The short version: when the assistant needs to answer a question about your vault, it searches the vault semantically (by meaning, not just keyword), retrieves the relevant passages, and uses them to ground its answer.
What this means in practice:
- You can ask in your own words. “What did I decide about the launch pricing?” works even if the note says “we’ll start at $99/month for the first six months.” The RAG system finds the relevant passage by meaning.
- The assistant cites what it used. Every claim in an assistant response is linked to the note (and the section) it came from. Click a citation to open the source.
- The assistant doesn’t make things up. Grounded in retrieval, the assistant answers from your notes. If the notes don’t contain an answer, the assistant says so, rather than inventing.
- Search respects your vault boundaries. The RAG system only searches the active vault. It doesn’t reach into other vaults, the file system at large, or the open web.
A few practical notes:
- Local embeddings come from the Local AI Models plugin. ONNX embedding models download on demand from Hugging Face. Configure the embedding model in the plugin’s Local models settings panel. Without the plugin installed, only cloud embeddings are available.
- Cloud embeddings are configured in Settings → AI → Models.
- Embeddings are computed locally when using a local source. When you pick a local embedding model, inference runs on your machine. After the model downloads, embeddings are computed as you write.
- RAG is opt-in. You can turn off the RAG system entirely if you prefer a non-grounded assistant. The choice is in the assistant settings.
- The RAG index is local. Like the memory index, the RAG index lives in your vault’s IndexedDB. It doesn’t sync to any server.
The RAG system is what makes the assistant’s answers trustworthy. Without it, the assistant would be a generic chatbot; with it, the assistant is a thinking partner for the work in your vault.
Suggest note improvements: built-in background job
Suggest note improvements is a built-in Flow (not a marketplace plugin) that watches your vault and proposes enrichment — tags, links, summaries, entity extraction, duplicate hints. It ships paused (off) by default. Enable it in the Flows rail → Suggest note improvements → Activate. When paused, no enrichment loop runs and Chat Inbox stays empty of suggestions until you run a manual cycle or resume the job. Nothing is merged into your notes until you accept.
This is the part of the system that does the most to keep a vault organized, but it’s also the part that requires the most trust. Suggest note improvements is off by default for a reason.
What it proposes
- Tags. “This note looks like it’s about the design system. Suggest adding
#design-system.” - Links. “You mentioned the shoreline essay here. There’s a
[[Why local-first matters]]link nearby; want to add a link from the new note to it?” - Summaries. “This is a long note. Here’s a 3-sentence summary; want to add it as a callout at the top?”
- Entity extraction. “I noticed this note mentions three people and two companies. Want to add structured references?”
- Duplicate hints. “This note looks similar to the older
Q1 launch retrospective. Want to merge, link, or leave as-is?”
The review flow
Suggestions never apply automatically. The flow:
- Suggest note improvements runs. It scans recent notes, generates suggestions, and persists them locally.
- You see the suggestions. They appear in three places:
- Chat Inbox (
/chat/inbox), with a list of pending suggestions to accept or dismiss. - The note sidebar, with a small badge on any note that has suggestions waiting.
- A dashboard card on the home surface, summarizing the count by suggestion type.
- Chat Inbox (
- You review each suggestion. For each one, you can:
- Accept. The change is applied to the note.
- Dismiss. The suggestion is removed; the assistant remembers the dismissal and won’t propose the same thing again.
- Undo. If you accept and regret it, undo is one click. The change is reversed.
- Nothing merges by default. The vault looks exactly the same as it did before you opened Chat Inbox.
Per-task toggles
Each type of suggestion can be enabled or disabled independently. The toggles are on the Suggest note improvements flow canvas inspector:
- Tag suggestions. On by default.
- Link inference. On by default.
- Summaries. On by default.
- Entity extraction. On by default.
- Duplicate detection. On by default.
Interval and idle controls
The job runs on a schedule configured in the Flows rail:
- Interval. How often the job runs. Default is every 5 minutes when active. You can lengthen this for a large vault or shorten it for a small one.
- Idle delay. When Run only when idle is on (default for Suggest note improvements), the job waits until you have not typed, scrolled, or clicked for the configured delay (default 60 seconds) before running. This avoids interrupting deep work.
You can also run the job manually with Run now or Process now in the job editor.
Privacy guarantees
A clear statement of what Suggest note improvements does and doesn’t do:
- Local-first by default. When the active AI provider is the Local AI Models plugin running on-device, the entire enrichment pass runs locally. Nothing is sent to a cloud provider.
- Cloud providers see only note content in scope. When the active provider is a cloud model (OpenAI, Anthropic, Gemini), the job sends only the content of the note being scored, plus a small amount of context. It does not send your link graph, your tag structure, your note titles, or your vault metadata.
- Suggestions persist locally. The suggestions themselves are stored in your vault’s IndexedDB, not on any server.
- No cross-vault access. The job reads only the active vault. It never reads notes from other vaults or from elsewhere on your machine.
- No telemetry. Suggest note improvements does not phone home. There is no analytics call, no usage ping, no “is this working?” check.
- You can delete everything. Pending suggestions can be dismissed one by one in Chat Inbox, and the underlying memory and RAG indexes can be wiped from the vault settings.
The point is that the privacy guarantees are auditable. You can run the app with the network off and Suggest note improvements will still work, as long as the active provider is local. The cloud providers see only what you actively send them, in the context of an assistant request.
A note on alpha status
Memory, RAG, and Suggest note improvements are the most ambitious parts of Zettly. They work, but the edges are rough:
- Memory consolidation is still being tuned. You may find the assistant remembers things you’d rather it forget. The memory panel makes this fixable, but it’s a manual pass.
- RAG accuracy varies by model. The local embedding model is good but not perfect. Cloud embedding models are better, but they’re cloud models. The tradeoff is real.
- Suggest note improvements is off by default for a reason. The suggestions are useful but not always right. The review flow is the safety net.
If you find cases where the system gets something wrong, file a bug. The team is iterating quickly on these systems, and the alpha feedback is shaping what ships in the next round.
See AI assistant for the chat surface that uses all of this, and Plugins for marketplace extensions (on-device AI, timers, and more).