feat(brain): add wiki compiler, synthesis, and brain API routes
## What & Why Wire Phase 5–6 compiled wiki and query synthesis into docs brains: post-ingest wiki compile, graph expansion signal, knowledge_synthesize tool, and REST endpoints. ## Requirements - FR-1: Two-step WikiCompiler writes compiled pages under brain storage wiki/. - FR-2: Wiki graph provides 4-signal expansion for hybrid_graph retrieval mode. - FR-3: synthesize_brain_query returns cited answers with gap analysis via LLM. - FR-4: Expose wiki pages, purpose.md, compile, synthesize, and maintenance APIs. - FR-5: Register knowledge_synthesize tool gated by brain synthesis.enabled config. - FR-6: Auto-trigger wiki compile after successful ingest when wiki_compiler enabled. - FR-7: Purge compiled wiki pages when source material is deleted. - NFR-1: hybrid_graph falls back gracefully when wiki directory is empty. - AC-1: knowledge_synthesize returns error when synthesis is disabled on mounted brains. - AC-2: meta_agent prompt mentions knowledge_synthesize when synthesis is enabled. Plan-Id: 2026-06-02-near-local-kb-build-and-retrieval-quality Plan-File: .cursor/plans/2026-06-02-near-local-kb-build-and-retrieval-quality.plan.md Made-with: Damon Li
D
DemonDamon committed
ee5ceb03d34578dbdd3c09dfd6d433f956e48470
Parent: 7e69ce1