Case study: CBKS – A cognitive knowledge system, local-first
A self-built system with technical depth: event sourcing, graph cache, local LLMs and a brain-region-based agent model – fully offline, no cloud.
A self-built system, technical depth.
Tech stack: FastAPI · SQLite · NetworkX · FAISS · Ollama · Qwen3 · bge-m3 · RX 6900 XT
Problem
Classic knowledge stores – folders, wikis, static vector systems – keep knowledge static. They show neither contradictions over time, nor how one’s own thinking evolves, nor emotional weighting.
My role
Sole concept, architecture and implementation: backend (FastAPI), CLI (Typer), 3D frontend (React + Three.js) and the complete local model stack.
Solution
Event-sourcing-light: SQLite as the single source of truth, NetworkX as an ephemeral graph cache, FAISS (IndexFlatIP) for embeddings (bge-m3). Local LLMs via Ollama (Qwen3:8b, VLM qwen2.5vl:7b) drive specialised agents (prefrontal cortex, temporal lobe, limbic system, pineal gland, entity resolver). The frontmatter of notes and documents is mapped onto brain regions; a hemisphere split separates logic (left, analytical) from design (right, creative). A decay rate models long-term memory – knowledge fades in the ranking without ever being deleted. Context engineering instead of naive vector search, all local-first on an RX 6900 XT.
Result
Actually implemented (Living Spec v1.2): 12 CLI commands, REST API, 3D graph with LOD, sentiment and contradiction analysis, entity dedup, German TTS and vault import – fully runnable without any cloud. Model choice driven by a custom benchmark instead of gut feeling.
Takeaways
An append-only event log makes the system repairable: “rebuild” replays everything – ideal when swapping models or schemas. FAISS IndexFlatIP beats IVF up to ~100k vectors (no training, clean deletes). And: keep spec and code in sync as a living document, or both drift into disrepair.