Knowledge
Two modes: store (save learnings) and recall (search existing knowledge).
Mode Detection
store(or no args after a session): synthesize and saverecall <topic>: search and load
If the user just types /knowledge, ask which mode.
Vault
VAULT=!`python3 scripts/find-vault.py`
If the vault path is empty, tell the user the Knowledge vault was not found in Obsidian's config and stop.
Read $VAULT/Knowledge.md for conventions before writing. All writing rules (atomic notes, wikilinks, frontmatter format, naming) are defined there; follow them, don't duplicate them here.
Recall Mode
Search the vault for existing knowledge on a topic.
Steps
- Try Obsidian CLI first (requires Obsidian desktop running):
obsidian search query="<topic>" vault="Knowledge" 2>/dev/null - If CLI fails or returns nothing, fall back to filesystem search:
rg -li "<topic>" "$VAULT" --glob="*.md" - Read matching files (max 5)
- Summarize what the vault contains on this topic
- If nothing found, say so clearly
Output
Brief summary of what's in the vault, with pointers to specific files. Don't dump entire files; synthesize.
Store Mode
Save knowledge from the current conversation to the vault.
Steps
Store Progress:
- [ ] Read Knowledge.md conventions
- [ ] Identified what to save
- [ ] Checked for existing pages
- [ ] Created or updated file
- [ ] Updated category index
- [ ] Confirmed to user
- Read
$VAULT/Knowledge.mdfor current conventions and categories - Ask the user: "What did we learn that's worth keeping?" (unless they already said)
- Check if a relevant page already exists:
rg -li "<concept>" "$VAULT" --glob="*.md" - If page exists: update it (don't create a duplicate)
- If new: create a file in the appropriate category folder, update
index.mdif one exists
After Writing
- Confirm to the user what was saved and where
- Mention any existing pages that were updated vs created new
- Suggest wikilinks to add to other pages if relevant