Documentation Index
Fetch the complete documentation index at: https://mintlify.com/coleam00/claude-memory-compiler/llms.txt
Use this file to discover all available pages before exploring further.
query.py lets you ask natural language questions against your compiled knowledge base. Instead of a vector database or embeddings, it uses index-guided retrieval: the LLM reads knowledge/index.md first to understand what articles exist, selects the 3–10 most relevant ones, reads them in full, and synthesizes a cited answer. This approach outperforms cosine similarity at personal knowledge base scale and requires no infrastructure beyond what is already installed.
CLI commands
The --file-back flag
Without --file-back, the answer is printed to stdout and discarded. With --file-back, the query engine does three additional things after synthesizing the answer:
- Creates a Q&A article in
knowledge/qa/with a slugified filename (e.g.,knowledge/qa/whats-my-error-handling-strategy.md) using the full Q&A article format fromAGENTS.md - Adds a new row to
knowledge/index.mdfor the filed Q&A article - Appends a timestamped entry to
knowledge/log.mdrecording the question, which articles were consulted, and where the answer was filed
How index-guided retrieval works
The retrieval flow mirrors the instructions inquery.py’s prompt:
[[wikilink]] citations back to the source articles.
Why no RAG? At personal knowledge base scale (50–500 articles), the LLM reading a structured
index.md outperforms vector similarity. Embeddings find similar words; the LLM finds relevant concepts. Cosine similarity cannot understand that a question about “auth redirects” is answered by an article titled “Next.js middleware patterns” — but the LLM can. RAG becomes necessary only when the knowledge base grows to roughly 2,000+ articles and the index itself exceeds the context window. See Using your knowledge base in Obsidian for notes on scaling.Knowledge base health checks
lint.py runs seven checks against your knowledge base to catch problems before they accumulate. Run it periodically, especially after several compilations.
reports/lint-YYYY-MM-DD.md.
The 7 checks
| Check | Type | Severity | What it catches |
|---|---|---|---|
| Broken links | Structural | Error | [[wikilinks]] pointing to articles that do not exist on disk |
| Orphan pages | Structural | Warning | Articles with zero inbound links from any other article |
| Orphan sources | Structural | Warning | Daily logs in daily/ that have not been compiled yet |
| Stale articles | Structural | Warning | Daily logs that changed on disk since their last compilation |
| Missing backlinks | Structural | Suggestion | Article A links to article B, but B does not link back to A |
| Sparse articles | Structural | Suggestion | Articles under 200 words, likely incomplete |
| Contradictions | LLM | Warning | Conflicting or inconsistent claims across different articles |
--structural-only to run the other six checks for free at any time.