The three layers
| Layer | Mechanism | Speed | Best for | Storage |
|---|---|---|---|---|
| FHRR fact memory | Phase-based complex vectors | ~1 ms | Short key-value facts recalled by query | ~/.nuggets/<name>.nugget.json |
| Note graph | Zettelkasten-style JSON graph | Fast | Rich notes with titles, tags, links, and context | ~/.nuggets/graph/graph.json |
| MEMORY.md | Promoted plain-text file | — | Permanent, high-value knowledge | Project memory directory |
All three layers are entirely local. There is no cloud database, no embeddings API, and no external service required.
How the layers work together
The three layers form a pipeline from fast but shallow to slower but richer:Recall first
Before searching code or files, query memory with
nuggets recall "what you're looking for". If the answer is in the fact layer, you get it back in under a millisecond. If the fact layer misses, the agent can fall back to a graph search.Store what you learn
When the agent discovers something worth keeping, it stores a short fact with
nuggets remember or creates a note in the graph when the information is too rich for a single key-value pair.Let the graph grow
Notes accumulate over sessions. Each note carries a title, content, tags, and links to related notes. The graph layer handles context that would be awkward to compress into a one-line fact.
Promote what sticks
Notes that are recalled three or more times across different sessions are automatically promoted to
MEMORY.md. This file is read on every session start, so truly important knowledge becomes permanent.When to use each layer
FHRR fact memory
FHRR fact memory
Use facts for short, atomic pieces of information that you want to retrieve by keyword:
- File locations:
nuggets remember locations "auth handler" "src/auth/middleware.ts:47" - Commands:
nuggets remember project "test cmd" "pytest tests/ -v" - Patterns:
nuggets remember project "error handling" "uses Result type, never throws" - User preferences:
nuggets remember prefs "style" "2-space indent, no semicolons"
Note graph
Note graph
Use notes when the memory is richer than a one-line fact:
- A durable note with a title and several sentences of context
- Something that should link to other related notes
- Information the agent might want to rewrite or merge later
- Anything with useful metadata like scope, type, or stability
createNote, addLink, editNote, and searchNotes.MEMORY.md
MEMORY.md
You do not write to
MEMORY.md directly. The promoteFacts function handles promotion automatically when a note crosses the recall threshold (3+ hits across sessions). The file is formatted as human-readable markdown grouped by section, so you can also edit it manually if needed.Recall-first pattern
Nuggets is designed around a recall-first workflow. Before doing any expensive search, always check memory:Layer comparison
FHRR fact memory
Phase-based complex vectors, D=16384 dimensions, ~512 facts per nugget, sub-millisecond recall. No stored vectors — regenerated from seeds.
Note graph
Zettelkasten-style JSON graph with titles, tags, links, and FHRR-powered semantic search. Stores richer context than facts can hold.
Autonomous rewriting
Daily cleanup pass that merges near-duplicates, improves tags, adds links, archives low-value notes, and promotes high-hit notes to MEMORY.md.