Garrison Memory
Session memory backed by Basic Memory — a plain-markdown Obsidian vault indexed into a queryable knowledge graph, shared across Claude, Codex, and Gemini.
- License 许可
- MIT
- 最近更新
- 2026-11-07
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- Garrison Memory
- description
- Session memory backed by Basic Memory — a plain-markdown Obsidian vault indexed into a queryable knowledge graph, shared across Claude, Codex, and Gemini.
03 SKILL.md 正文
Garrison Memory
Session memory is a single Obsidian vault indexed by Basic Memory (basicmachines-co). The vault is plain markdown; Basic Memory builds a local SQLite knowledge graph (notes, observations, relations) and exposes write/search/read tools over MCP. The same MCP server is registered with Claude Code, Codex, and Gemini, so all three agents read and write the same memory. Zero lock-in: drop Basic Memory and a clean vault remains; the index rebuilds from the files.
How it works
The Basic Memory Fitting:
- Installs
basic-memoryand registers the vault as projectmain(~/ObsidianVaultby default — it must live outside macOS TCC-protected folders so headless tools can reach it). - Registers the
basic-memory mcpserver with Claude Code (and Codex + Gemini) so memory tools are available in-session. - On nodes enrolled in shared agent continuity, preserves the six owned lifecycle hooks. They publish structural metadata only; raw transcripts and existing authored-note imports stay disabled. Save durable decisions into topic notes deliberately. Unenrolled installations retain their existing capture setup; do not copy its historical transcript material into shared notes.
The vault is committed and pushed to git on a schedule by the Garrison
vault-git-sync scheduler job (default nightly, 0 4 * * *), so memory
written by any agent — even when no editor is open — syncs across machines.
The job is registered with the scheduler fitting and fired by the
io.garrison.scheduler launchd daemon; cadence is the fitting's cron config.
(This replaces the old standalone com.ggomes.obsidian-vault-sync launchd
agent.)
Consolidation ("dream")
The Improver runs a nightly consolidation pass over the vault — the "dream"
rule (mimics Claude Code's autoDreamEnabled). It keeps memory concise and true
so the index does not rot:
- Deterministic housekeeping (auto): archive
Memory/session-*.mdcapture checkpoints older thancheckpoint_retention_days(default 14) intoMemory/archive/, thenbasic-memory reindex+doctor. - Consolidation proposals (review-queued): one capped model pass proposes
distilling durable notes from recent checkpoints, merging near-duplicate
notes, resolving contradictions, and rewriting relative dates ("yesterday",
"last week") to absolute ones. Each proposal cites the real source note
path(s); a fabricated path is dropped. Proposals land in the Improver's review
queue (
:27093) under rulememory-dreamand apply to the vault only on approval.
The dream pass runs on ONE machine (the memory_primary one) so machines
sharing the vault don't duplicate the work. So write good checkpoints and
durable notes; the nightly pass distills and de-dupes them for you.
Using memory (MCP tools)
Prefer the Basic Memory MCP tools over reading raw files:
search_notes/search— full-text + semantic search across the whole vault. Use this first to recall.read_note— read one note by title or permalink.build_context— pull the context around a topic (note + its relations) to continue a line of work.recent_activity— what changed recently across the knowledge base.write_note— persist a durable memory as a markdown note.
For CLI fallback, first check GARRISON_AGENT_CONTINUITY_CONFIG or the operator's
~/.config/garrison/agent-continuity.json. When enrolled, read its
bridge_command argv array and invoke that command with
--config <absolute-config-path> memory-cli -- followed by the normal Basic
Memory arguments, for example tool read-note --project main --local <permalink>
or tool write-note --project main --local --title "<t>" --folder <dir> with
content on stdin. Preserve argv boundaries; do not evaluate configuration as
shell code. The bridge selects the same local or SSH authority as MCPs.
Do not use bare basic-memory inside an enrolled fitting: its inherited
configuration can select a different index even for the same vault. Invalid or
unavailable enrollment is an error to report, not permission to silently choose
another index. Only unenrolled installations retain the normal bare CLI fallback.
Writing durable memories
When you persist a memory, write a real note, not a log line:
---
title: <Note Title>
type: note
tags: [<project>, <topic>]
---
# <Note Title>
<1–3 sentence core idea>
## Observations
- [decision] <durable decision> #governance
- [gotcha] <non-obvious failure mode> #ops
## Relations
- relates_to [[<Other Note Title or permalink>]]
- part_of [[Projects/<Project>]]
- Observations use
- [category] text #tag(categories: decision, gotcha, fact, method, preference, tip). Relations use- relation_type [[Target]]. - Route notes by project:
Projects/<Project>/Memory/for project memory,Personal/for personal/business memory,Compiled/for cross-cutting concepts/gotchas/procedures.
Operating principles
- Recall before you ask:
search_notesthe vault first. - Treat secrets as non-memory. The capture hook redacts
sk-*,ghp_*,xoxb-*; you should too. The vault is for context, not credentials. - Keep entries concise and source-attributed. Prefer one durable note per topic with relations over many fragments.
- Don't quote the whole corpus back to the principal — search for the specific note, then answer from it.
The Archive (user-owned)
The vault folder Archive/ belongs to the user. It holds their personal
documents, cards and notes, including sensitive papers. Read it only when
the user asks for something that is in there (search it, read the card,
answer). Never write, move, rename or delete anything under Archive/;
a hook blocks it and the block is correct. Never summarise, copy or
paraphrase Archive content into memory notes, session captures, briefs,
decisions or any other file. If something the user says belongs in the
Archive, say so and let them file it from the Archive page.
When the user asks for a fact in a saved document (for example, their company's
commercial certificate number), use garrison_archive_search with the company
name and document type, then garrison_archive_read on the matching result.
The read includes extracted text and fields from image/PDF sidecars; a sensitive
search snippet being hidden does not prevent the explicitly requested read.
Try short Portuguese/English terms if needed, verify the correct company and
field, and cite the source with a Markdown link to the returned url.
Return only the requested fact; omit identifiers
from other documents and unrelated fields. Never guess a missing number or
save the answer to memory. These tools use the Archive's current local index, including attachments.
Search covers all folders by default. Optional folder, kind and bookmarked
filters narrow results; bookmarks are saved document shortcuts, not web links.
Unified browsing does not change the personal-document ownership rule above.
If they are unavailable, use the configured Basic Memory search/read tools on
project main, including Archive/ and its derived attachment notes. This is
knowledge retrieval, not task management; actionable work belongs in Kanban.
04 同仓库更多 Skills
pinned-helper
An owned skill the human has pinned so the Improver must not touch it.
legacy-helper
A rarely used helper kept around from an earlier workflow.
human-notes
A human-authored skill not deployed by APM (loose, not in the lock).
garrison-helper
Helps compose and station Garrison Fittings into Faculty role slots.
walkthrough
Record a short, narrated, captioned video walkthrough that proves a finished coding task and shows how it behaves, then self-verify the video via vision on extracted frames and publish it as one scrubbable Tailscale link. Use after completing a change/fix/feature on a web project (Next.js/React etc.) when the user wants visual proof of work, a demo of a user flow, or to avoid manually retesting and watching a long raw screen recording. Triggers on requests like "record a walkthrough", "show me it working", "make a demo video of this", "prove the feature", or finishing a UI/route/form/API change worth demonstrating. Not for walking through a full from-scratch project build.
Trello
Manage tasks via Trello REST API.