Run several knowledge bases on one machine¶
You can generate as many knowledge bases as you like, for example one for work and one for a hobby. They do not interfere, because almost everything is per repository.
What each knowledge base has of its own¶
| Item | Where |
|---|---|
| Tooling version and Python environment | .venv/, created by uv on the first uv run |
| Secrets and machine paths | .env |
| Scratch space (fetched sources, drafts) | .cache/ |
| git hooks | .git/hooks/pre-commit |
Claude Code settings, hooks and KB_ACTOR |
.claude/settings.json |
| Codex and Gemini CLI hooks, if added | .codex/hooks.json, .gemini/settings.json |
| The hooks' session state | .cache/kb-hooks/ |
| Obsidian vault and its plugins | the knowledge-base folder and its .obsidian/ |
| Search collection | a qmd collection named after the knowledge base |
What they share¶
Zotero, KaraKeep and the folders behind file roots are services on your
machine. Every knowledge base uses them read-only (KaraKeep also gains
bookmarks when you archive a page), so several knowledge bases can point at
the same library or the same folder. Each one declares its own file roots
and deny patterns, and maps them in its own .env.
Steps¶
-
Generate each knowledge base in its own directory, with its own
kb_name. Keep the default knowledge-base folder, which is named afterkb_name, or choose another name that is unique among your vaults: -
Run
uv run poe setupin each, and fill in each.envfrom its.env.example. -
If you use qmd, run
uv run poe search-setupin each. The collection is named afterkb_name(work-kb,cooking-kb), so the indexes stay separate. See Enable search. -
If you use Obsidian, run
uv run poe obsidian-setupin each and open each knowledge-base folder (~/work-kb/work-kb/,~/cooking-kb/cooking-kb/) with Open folder as vault. Obsidian names a vault after its folder, and since v0.5.0 the folder is named afterkb_nameby default, so the vaults appear aswork-kbandcooking-kbin the vault switcher. Knowledge bases created before v0.5.0 keep the folderkb/, so they all appear askb; give each a distinct name withuv run poe rename-bundle. -
Optional: install the launcher and register the knowledge bases by name, so that
kb -C work reportworks from anywhere.
Start your agent from the root of the knowledge base you want it to work
on. The agent reads that repository's AGENTS.md and skills, and the hooks
check that repository's bundle.
Things to avoid¶
- Exporting
KB_REPO_ROOTin your shell profile: it sends everykbcall to one knowledge base. - Using one qmd collection name for two knowledge bases: set
KB_QMD_COLLECTIONonly when you need a name other thankb_name, and keep it unique. - Pointing two knowledge bases' file roots at a broader folder than each needs. Map each root to exactly the folder its description names.