SwarmVault is a local-first LLM Wiki, knowledge graph builder, and RAG knowledge base that can also serve as a memory store for AI agents. It is built on the LLM Wiki pattern proposed by Andrej Karpathy and is positioned as an Obsidian alternative for personal knowledge management, an AI second brain, and a persistent memory tool for Claude Code / Codex / OpenClaw. It can turn documents, code, transcripts, notes, and URLs into a persistent Markdown wiki and generate a local knowledge graph for users to view, query, and hand off to agents.
Three-layer architecture
SwarmVault adopts a three-layer structure following the pattern described by Karpathy:
- Raw sources (raw/): a curated collection of source documents, including books, articles, papers, transcripts, code, images, datasets, and more. This content is immutable; SwarmVault only reads it and never modifies it.
- Wiki (wiki/): LLM-generated and human-written Markdown, including source summaries, entity pages, concept pages, cross-references, dashboards, and various outputs. The wiki is a persistent and continuously accumulating artifact.
- Schema (swarmvault.schema.md): defines how the wiki is structured, the conventions it follows, and what matters in the domain, and is evolved jointly by the user and the LLM.
Main capabilities
- After the first compile, the following are generated on disk: raw/ (an immutable copy of the sources), wiki/ (generated Markdown pages, saved outputs, graph reports, context packs, and task notes), state/graph.json (a machine-readable knowledge graph), state/retrieval/ (a local search index), and a copyable and visualizable first-run summary under wiki/graph/ (share-card.md, share-card.svg, share-kit/).
- Hybrid retrieval: combines SQLite full-text search with semantic embeddings, so queries do not need to stuff every page into the context. compile --max-tokens can be used to trim output to fit a bounded window.
- Graph navigation: provides commands such as graph query, graph path, graph explain, and graph callers, allowing users to use knowledge through traversal rather than search alone.
- Handling hallucinations and contradictions: every edge is marked as extracted, inferred, or ambiguous; contradiction detection flags conflicting assertions; compile --approve stages all changes into a reviewable approval bundle; new concepts first go into wiki/candidates/; lint --conflicts can audit contradictions at any time.
- Team usability: supports Git workflows (--commit), watch mode with git hooks, scheduled automation, and an MCP server.
- Local offline: the built-in heuristic provider is fully offline and requires no API key.
Usage
- Desktop app (no Node.js required): download the macOS, Windows, or Linux version from GitHub Releases, with a bundled runtime.
- SwarmVault requires Node >=24, and you need to verify the installation and update to the latest release version. The global CLI already includes the graph viewer workflow and the MCP server flow, so end users do not need to install @swarmvaultai/viewer separately.
- Quick start: run quickstart in an empty folder or temporary folder; it initializes the vault, ingests local files/directories or a public GitHub repository, compiles the wiki and graph, writes out share artifacts, and opens the graph viewer. It is a beginner-friendly alias for swarmvault scan . You can pass --no-serve or --no-viz to skip the viewer. When run interactively, it shows bounded ingestion progress (including the current file) on stderr.
- If you want to put generated artifacts outside the source tree, you can use SWARMVAULT_OUT=.swarmvault-out; swarmvault.config.json and swarmvault.schema.md remain in the project root, while raw/, wiki/, state/, agent/, and inbox/ are resolved under the output directory.
- swarmvault next is a read-only command that suggests whether to initialize, ingest, compile, query, review, or refresh.
- Minimal starter: swarmvault init --lite only creates raw/, wiki/, wiki/index.md, wiki/log.md, and swarmvault.schema.md, with no config, no state, and no agent installation.
- Regular init, quickstart, scan, and clone do not write agent rule files by default; run swarmvault install --agent <agent> when you need project-local agent instructions.
- When the vault is inside a git repository, ingest, compile, and query support --commit.
- Media workflows: swarmvault ingest ./customer-call.mp3, ingest a YouTube link, ingest --video a video link, available when the required provider or helper binary is present.
- Managing source flows: source add registers a source, syncs it into the vault, compiles once, and writes a source-scope brief under wiki/outputs/source-briefs/; adding --guide gives a resumable guided session; supports periodic local files, directories, public repositories, and documentation hubs. Commands such as source add, source list, source reload --all, and source session are used to keep the same repository/folder/documentation hub registered and refreshable over the long term.
Models and embedding providers
- No API key required: the built-in heuristic provider supports local/offline vault initialization, ingestion, compilation, graph/report/search workflows, and lightweight query or lint defaults. When running compile/query with only the heuristic provider, it will prompt you to configure a model; you can set SWARMVAULT_NO_NOTICES=1 to silence this.
- Recommended local LLM: Ollama + Gemma, which can run fully locally and requires no API key.
- Local semantic embeddings: use a local backend that supports embeddings (such as Ollama) instead of heuristic; tasks.embeddingProvider can explicitly select that backend, or it can fall back to an embedding-capable queryProvider; set retrieval.rerank: true to let queryProvider rerank the merged top hits.
- Cloud API providers: you can add a provider config block, and C is also supportedLI manages provider routing; the command preserves unknown fields and stores key references via apiKeyEnv, and does not accept literal API key values.
- Voice-first capture (local Whisper): after installing whisper.cpp, the command verifies the binary, downloads the base.en ggml model (about 147 MB) to ~/.swarmvault/models/, and registers it under providers.local-whisper in swarmvault.config.json; subsequent audio transcription happens entirely offline, and during ingestion the redactor removes dictated keys. You can use --model {tiny.en,small.en,medium.en,large-v3} to adjust accuracy, localWhisper.threads to set the number of threads, and can also override the discovery path via localWhisper.binaryPath / localWhisper.modelPath / SWARMVAULT_WHISPER_BINARY. The local-whisper provider type is marked experimental in STABILITY.md of 1.1.0. You can also point tasks.audioProvider at a hosted provider with audio capabilities (OpenAI, Groq, etc.); YouTube transcript ingestion does not require a model provider.
Agent and MCP integration
- Hooks can be installed for agents with hooks to guide graph-first reading; enforcement is optional.
- For Claude Code, --hook injects graph-first instructions at the start of the session, recommends using swarmvault graph query|explain|path (avoid --json because it produces larger output), swarmvault query, swarmvault context build, or wiki/graph/report.md to answer code comprehension questions, reads source files only when editing, and includes a graph freshness hint. graph query "<seed>" prints the top matching page path and an inline excerpt of the best-matching wiki page. For who-calls and change-impact questions, the hook recommends using swarmvault graph callers <symbol>, whichlists each caller and exact file:line call-site evidence based on the graph's call edges.
- By default the hook runs in advisory mode (context): the first broad Grep/Glob/Bash search of each session receives a one-time pointer and nothing is blocked. When installing, pass --graph-first to opt into enforcement: the first broad search of each session is denied once and redirected to graph commands, and repeating the same search is then allowed, without blocking work. The flag accepts optional values deny (the default when the flag is passed), context, off, and persists the chosen mode as hooks.graphFirst; SWARMVAULT_GRAPH_FIRST=deny|context|off can still override it per session. After the Edit/Write tools, the hook starts a background swarmvault graph update --file <path> refresh so the graph tracks edits. Searches targeting vault artifact directories (wiki/, raw/, state/) or a single file are not intercepted, and search tools that only filter piped output (such as some-command | grep) do not count as broad searches. The hooks for Codex, Gemini, Copilot, OpenCode, and Kilo carry the same graph-first instructions.
- swarmvault install --agent claude --mcp also registers the SwarmVault MCP server in the project's .mcp.json ({"mcpServers":{"swarmvault":{"command":"swarmvault","args":["mcp"]}}}). Claude installation also writes the project skill package to .claude/skills/swarmvault/SKILL.md, and --scope user installs the skill, hooks, and settings once under ~/.claude for use across all repositories.
Applicable scenarios
It can be used for personal knowledge management, research deep dives, book companion reading, code documentation, business intelligence, and any field that requires long-term accumulation and orderly organization of knowledge. It turns the LLM Wiki pattern into a local toolchain with graph navigation, search, review, automation, and optional model-enhanced synthesis. You can also start from standalone schema templates only (zero installation, any LLM agent), and upgrade to the full CLI when it is no longer sufficient.