Vaultweaver
Build a persistent, compounding knowledge base. Sources are ingested once, compiled into an interconnected wiki of markdown files, and kept current as new material arrives. The LLM writes and maintains the wiki — the user curates sources and asks questions.
Viewable in Obsidian with graph view and backlinks.
Decision Tree
Does wiki/ exist in current directory?
├── NO → Run INIT (create structure, ask for wiki name)
└── YES
├── Are there unprocessed files in raw/?
│ └── YES → Run INGEST
├── Is user adding content or pasting text?
│ └── YES → Save to raw/, then INGEST
├── Is user asking a question about wiki topics?
│ └── YES → Run QUERY
├── Is user asking to compile/build articles?
│ └── YES → Run COMPILE
├── Is user asking for health check?
│ └── YES → Run LINT
└── Is user asking to search?
└── YES → Run SEARCH
Wiki Structure
raw/ User-curated sources (NEVER modify or delete)
wiki/
├── index.md Categorized page index — update after every change
├── log.md Parseable activity log — append after every operation
├── overview.md High-level synthesis of all knowledge (optional)
├── schema.md Wiki conventions (auto-generated on init)
├── concepts/ Concept and theme articles
├── entities/ Named entities (people, orgs, tools, products)
├── sources/ Source summaries (one per raw file)
└── queries/ Filed Q&A results that compound over time
search.py BM25 search engine (see scripts/search.py)
Commands
/wiki init [name] Create wiki structure
/wiki ingest Process new raw/ files
/wiki compile Build missing concept + entity articles
/wiki query <question> Answer from wiki, optionally file back
/wiki lint Health check with fix suggestions
/wiki search <term> Local BM25 search (runs search.py)
/wiki status Stats and recent activity
/wiki serve [port] Web search UI
INIT
Create the wiki structure. Ask for wiki name if not provided.
- Create directories:
raw/, and underwiki/:concepts/,entities/,sources/,queries/ - Write
wiki/index.md:# {Name} Index ## Overview - [Overview](overview.md) — High-level synthesis (not yet written) ## Concepts (none yet — run /wiki ingest then /wiki compile) ## Entities (none yet) ## Sources (none yet — add files to raw/ then run /wiki ingest) ## Queries (none yet — ask questions with /wiki query) - Write
wiki/log.md:# Wiki Log\n - Write
wiki/schema.mddocumenting the conventions (copy from Page Conventions below) - Copy
search.pyfrom skill scripts if available - Tell user: "Drop source files in
raw/then say ingest or run/wiki ingest."
INGEST
Process new sources. One source should touch 10-15 wiki pages.
-
Scan
raw/for all files -
Identify new — files not mentioned in
wiki/log.md -
For each new source:
a. Read full content (images via multimodal Read tool)
b. Extract: main claims, named entities, concepts, data points, contradictions with existing wiki
c. Write source summary →
wiki/sources/{slug}.md:--- title: "{Title}" type: source tags: [topic1, topic2] created: {YYYY-MM-DD} original: raw/{filename} ---Body: structured summary, key quotes, main arguments, relevance to existing topics.
d. Create or update concept pages →
wiki/concepts/{slug}.md:- Existing page: add new information, update synthesis, note confirmations or contradictions
- New concept: create with definition, context, connections
- Add
[[wikilinks]]to related concepts and entities
e. Create or update entity pages →
wiki/entities/{slug}.md:- Existing page: add new data points
- New entity: create with description, role, connections
f. Update cross-references — ensure new pages link to relevant existing pages and vice versa
g. Update
wiki/overview.mdif the source shifts the big pictureh. Update
wiki/index.md— add entries for new pages, update summaries for modified pagesi. Append to
wiki/log.md:## [{YYYY-MM-DD}] ingest | {Source Title} - Source: raw/{filename} - Pages created: concepts/new.md, entities/new.md - Pages updated: concepts/existing.md, overview.md - Total pages touched: {N}
COMPILE
Build articles for concepts and entities mentioned across sources but lacking their own page.
- Read all files in
wiki/sources/ - Collect every
[[concept]]and[[entity]]referenced - Check which already have pages in
wiki/concepts/andwiki/entities/ - For each missing concept or entity, write a page:
- 300-800 words, encyclopedic, with
[[wikilinks]]for cross-references - Note contradictions between sources
- Include
## Sourcessection citing which source summaries informed it
- 300-800 words, encyclopedic, with
- Rebuild
wiki/index.md— categorize all pages with one-line descriptions and dates - Append to log:
## [{YYYY-MM-DD}] compile | {N} new articles - Concepts created: {list} - Entities created: {list} - Index rebuilt
Skip pages that already exist unless user says "recompile" or "rebuild."
QUERY
Answer questions using the wiki as knowledge source.
- Read
wiki/index.md— scan for relevant pages - Read relevant pages — follow
[[wikilinks]]to gather connected info - Synthesize answer:
- Cite wiki pages:
According to [[concepts/x]]... - Note confidence — well-supported (multiple sources) vs. single-source claims
- Flag contradictions if sources disagree
- Identify gaps — what the wiki doesn't cover
- Cite wiki pages:
- Decide whether to file:
- Synthesizes across multiple pages in a new way? → File in
wiki/queries/ - Simple lookup? → Don't file
- Reveals a new connection? → File and add cross-references
- Synthesizes across multiple pages in a new way? → File in
- If filing: write
wiki/queries/{slug}.mdwith frontmatter, update index.md - Append to log:
## [{YYYY-MM-DD}] query | {Question} - Pages consulted: concepts/x.md, entities/y.md - Answer filed: queries/{slug}.md (or: not filed — simple lookup)
LINT
Periodic health check. Fix what you can, report what needs user input.
-
Read all pages — build a map of the wiki's state
-
Check for issues:
Check What to look for Contradictions Two pages making conflicting claims Stale claims Older pages superseded by newer sources Orphan pages Pages with no inbound [[wikilinks]]Missing concepts Terms mentioned often but lacking their own page Broken links [[wikilinks]]to non-existent pagesData gaps Topics partially covered — need more sources Thin pages Pages with very little content -
Link normalization:
_=-=, strip path prefixes, case-insensitive, ignore|displayand#section -
Fix what you can — add cross-references, create stubs, update stale claims
-
Report what needs user input — suggest sources, flag contradictions needing judgment
-
Write report to
wiki/health-report.md -
Append to log:
## [{YYYY-MM-DD}] lint | Health check - Issues found: {N} orphans, {N} contradictions, {N} missing concepts - Fixed: added cross-references, created {N} stubs - Needs attention: {list} - Suggested sources: {list}
SEARCH
Local BM25 search — no LLM needed.
python search.py wiki/ "query" # CLI search
python search.py wiki/ --serve # Web UI at localhost:5000
python search.py wiki/ --serve --port 8080 # Custom port
python