-
Notifications
You must be signed in to change notification settings - Fork 1
Memory Storage
Agents accumulate knowledge across sessions using one of three storage options, chosen during agent-notes install.
Note: The Obsidian and Wiki storage modes store notes as markdown files in an Obsidian vault. You need to download and install Obsidian to browse notes visually with graph view, backlinks, and search. The files are plain markdown, so the CLI works without Obsidian installed — but you lose the visual browsing experience.
| Feature | Local | Obsidian | Wiki |
|---|---|---|---|
| Location | ~/.claude/agent-memory/ |
Obsidian vault | Obsidian vault |
| Project scoping | No | Yes (per CWD) | Yes (per CWD) |
| Organization | Per-agent folders | Categories (Patterns, Decisions, etc.) | Wiki pages (sources, concepts, entities) |
| Wikilinks | No | Yes | Yes |
| Session tracking | No | Yes (auto-linking) | Yes |
| Ingest | No | Via /ingest skill |
CLI + /ingest skill |
| Query/Lint | No | No | Yes |
| Best for | Simple setup | Process memory, visual browsing | Domain knowledge, team knowledge bases |
Plain markdown storage in ~/.claude/agent-memory/. One folder per agent, no project scoping or cross-referencing. Simplest setup, no external tools needed.
~/.claude/agent-memory/
├── Index.md
├── lead/
│ └── *.md
├── coder/
│ └── *.md
└── reviewer/
└── *.md
agent-notes memory list # list all notes by agent
agent-notes memory show <agent> # show one agent's notes
agent-notes memory size # disk usage
agent-notes memory reset [agent] # clear memory (confirmation required)
agent-notes memory export # back up to memory-backup/
agent-notes memory import # restore from memory-backup/Category vault with YAML frontmatter and [[wikilinks]]. Auto-creates a folder per project (derived from current working directory name) and organizes notes into categories.
<vault-root>/
├── my-project/ # auto-created from CWD name
│ ├── Patterns/ # reusable solutions
│ ├── Decisions/ # architectural choices with rationale
│ ├── Mistakes/ # recurring errors to avoid
│ ├── Context/ # project background, constraints
│ ├── Sessions/ # per-session running logs
│ └── Index.md # auto-generated chronological catalog
└── another-project/
└── ...
| Type | Category | Description |
|---|---|---|
pattern |
Patterns/ | Reusable solution or technique |
decision |
Decisions/ | Architectural choice with rationale |
mistake |
Mistakes/ | Recurring error to avoid |
context |
Context/ | Project background, stakeholder notes |
session |
Sessions/ | Current session's running log (appends) |
---
created_at: 2026-05-11T14:30:00Z
type: pattern
agent: coder
project: my-project
session: 2026-05-11_abc123
tags: [rails, models]
---
# Note Title
Content here.
## Related- Auto-linking: When a non-session note is written during an active session, the CLI auto-appends a wikilink to the session note
- Plan mirroring: Plans created during a session are mirrored as Decision notes
-
Session append: Repeated
memory add ... sessioncalls append## Updateblocks to the same session file -
Index regeneration:
memory indexrebuilds Index.md sorted chronologically (newest first) - Visual browsing: Works with Obsidian's graph view, backlinks, and Dataview queries
agent-notes memory init # create folder structure
agent-notes memory add <title> <body> [type] [agent] # add a note
agent-notes memory list # list all notes
agent-notes memory vault # show storage path and status
agent-notes memory index # regenerate Index.md
agent-notes memory show <agent> # show one agent's notes
agent-notes memory reset [agent] # clear memory
agent-notes memory export # back up
agent-notes memory import # restoreThe /ingest skill works in Obsidian mode. It scans a source (file, folder, or URL), analyzes content with AI, and creates notes:
- Scan source
- AI extracts title, summary, concepts, entities, tags
- Creates main context note + fan-out notes to Patterns/, Context/, Decisions/ as appropriate
- No raw archiving — the AI summary IS the stored knowledge
- No wiki-compiler step — notes are complete on creation
Use in a Claude Code session:
/ingest
Implements Karpathy's LLM Wiki pattern. Auto-creates a folder per project with immutable source material and LLM-maintained wiki pages. See Inspirations for background.
<vault-root>/
├── my-project/ # auto-created from CWD name
│ ├── raw/ # immutable source material (chunked)
│ └── wiki/
│ ├── sources/ # ingested source pages
│ ├── concepts/ # domain concepts
│ ├── entities/ # external tools/services
│ ├── synthesis/ # cross-cutting themes
│ ├── sessions/ # session logs
│ ├── index.md # auto-generated catalog
│ └── log.md # append-only operation log
└── another-project/
└── ...
Ingest: Drop a source (URL, file, folder). The LLM reads it, extracts concepts and entities, creates wiki pages with cross-references. Fan-out creates linked pages automatically.
CLI command (Wiki mode only):
agent-notes memory ingest "<title>" "<summary>" "<concepts_csv>" "<entities_csv>" "<tags_csv>"
agent-notes memory ingest # no args: scan raw/ for unprocessed filesPipeline:
- Scan source (file, folder, or URL)
- AI analysis — extract title, summary, concepts, entities, tags
-
agent-notes memory ingest— archives raw content toraw/, creates source page, fans out concept/entity stubs - wiki-compiler agent compiles each stub into a rich page
- Cross-reference index rebuilt
Query: Search wiki pages by keyword. Valuable answers can be filed back as new pages.
agent-notes memory query "<keyword>"Lint: Health check for broken links, orphan pages, stub pages needing compilation, missing cross-references.
agent-notes memory lintFor rich page compilation, the wiki-compiler agent reads raw source material and writes Wikipedia-style entity/concept pages. It follows the Karpathy compile operation:
- Discover — grep raw chunks for concept name and variants
- Read — read most relevant files (model, service, controller, job, spec)
- Compile — write rich page with domain logic, data models, relationships
- Write — persist via CLI with confidence level
- Report — list compiled pages and findings
Pages include confidence levels:
- High — multiple code files found, data model and logic confirmed
- Medium — some code found, partial understanding
- Low — inferred from naming only, do not write the page
agent-notes memory add <title> <body> [type] [agent] # write a wiki page
agent-notes memory ingest [args...] # ingest source material
agent-notes memory query <keyword> # search wiki
agent-notes memory lint # health check
agent-notes memory vault # show storage path
agent-notes memory list # list all pagesBoth Obsidian and Wiki modes auto-create a folder named after the current working directory under the vault root.
- Config stores only the vault root path
- Project folder resolved at runtime via
Path.cwd().name - Different projects get completely isolated storage
- No cross-project contamination
Working in ~/code/my-app/:
<vault>/my-app/Patterns/... (obsidian)
<vault>/my-app/wiki/sources/... (wiki)
Working in ~/code/other-project/:
<vault>/other-project/Patterns/... (obsidian)
<vault>/other-project/wiki/sources/... (wiki)
agent-notes install --reconfigure # re-run wizard to change storage modeSee Inspirations for detailed credits:
- Karpathy's LLM Wiki — the three-layer architecture and ingest/query/lint operations
- Matt Pocock's Skills — per-project session scoping and skill-based workflows