01/18

KBrain

LIVE SINCE 2025-06 LATEST 2026-10-09 CATEGORY · PERSONAL INFRA
How kBrain works for me: I just start with a question or a task, and in most sessions it already has what it needs while reading under 1% of kBrain. When something is missing I add it once, and it stays stored for next time. Below, the size of the prompt and knowledge stores and of the corpus: my email, messages and documents THE LOOP · SVG
WHAT IT DOES§ 01

My personal second brain, served to every AI tool I use through one MCP server. It holds three stores: Prompts, which set how the AI should work on a given task; Knowledge, curated articles on the people, projects, decisions and context in my life; and Corpus, my own email, messages and documents. Claude reads what it needs before answering, so I never re-explain who someone is, why a decision was made two years ago, or how the house network is wired, and the answers stay consistent across sessions and across models.

HOW IT'S BUILT§ 02

kBrain is a Python FastAPI server running in Docker on my NAS. Claude Code, Codex, the Claude apps, my Telegram Chief of Staff and my scheduled audit routines all call the same 50 MCP tools; the apps come in over a Cloudflare tunnel with OAuth, and anything on my own network needs a registered token. Every call lands in an audit log under the caller's name, and automated callers get their own write policy, from create-only down to read-only.

Writes are guarded by the server itself; mirrored documentation can't be edited without explicit confirmation, credentials are refused at write time, and nothing automated adds a new article without my approval. Everything is plain markdown with YAML frontmatter on the NAS, which is the canonical copy, and a snapshot pushes it to GitHub every 30 minutes.

THREE STORES§ 03

PROMPTS

90+ active prompts encode how I want the work done: how I write, how I troubleshoot Home Assistant, how I review code, how knowledge gets routed between systems. Each carries frontmatter for category, tags, related prompts, chain-loads and version, and every edit keeps a snapshot. Prompts declare their dependencies, so loading one through its skill or the chain tool pulls in the rest; the Home Assistant prompts bring my entity reference with them. kBrain logs every prompt it hands out by caller, so I can see which ones actually get used.

KNOWLEDGE

1,600+ markdown articles across nine categories, from people and projects to recipes and mirrored documentation. Search is a pure-Python BM25 index with no database or embedding server in the path; an earlier hybrid of embeddings and a relationship graph lost to plain BM25 on a known-item evaluation and was retired from search. Long articles come back as an outline or a single section, and archived articles return metadata only unless a caller gives a reason to read them.

Contacts and bookmarks sync in every night before a maintenance run re-indexes kBrain, rebuilds backlinks and the relationship graph, and runs quality checks; a weekly audit flags what has gone stale. Clippings I drop in an inbox are classified by a local Qwen 3.6 model every two hours, with additions to existing articles going straight in and new articles waiting for my approval on Telegram, and Doc Watcher refreshes mirrored documentation whenever the source changes.

CORPUS

My own email, messages and documents, chunked and embedded with Qwen3-Embedding-4B into a Chroma index on my Mac Studio, so the indexing runs on my own hardware. Mail and messages sync hourly and the index refreshes nightly. kBrain has served it since October 2026 through passage search and fetch tools, beside Knowledge rather than inside it; Knowledge stays the curated layer, and the corpus is where Claude goes for the original source. The same embeddings and a local Gemma 4 model drive on-demand enrichment, drafting additions to an article from the corpus for me to accept or discard.

KNOWLEDGE GROWTH§ 04 · kBrain git history
1,630Articles+63% since Apr
2.13M wordskBrain words3.8× since Apr
98Prompts142 incl. archived
~12/dayCommits2,145 in 6 months
ArticleskBrain wordsDaily activity
0M 0.2M 0.4M 0.6M 0.8M 1.0M 1.2M 1.4M 1.6M 1.8M 2.0M 2.2M 900 1000 1100 1200 1300 1400 1500 1600 1700 11 Apr 10 Jun 10 Aug 9 Oct

Measured from kBrain's own git history; counts and sizes only.

CHAIN-LOAD MAP§ 05 · prompts
Prompt chain-load map: every active personal prompt on a ring, with curves into the prompts it pulls in when loaded; the most-loaded prompts sit inside as hubs CHAIN-LOAD MAP · SVG

Generated from the prompts' own frontmatter; ids and names only.

TECH STACK§ 06
  • Python + FastAPI
  • MCP (50 tools)
  • Markdown + YAML frontmatter
  • BM25 search (pure Python)
  • Chroma + Qwen3-Embedding-4B
  • SQLite relationship graph
  • Local Qwen 3.6 and Gemma 4 (cloud fallback)
  • Docker on the NAS
  • Cloudflare Tunnel + OAuth 2.1
  • launchd
  • Git (30-minute GitHub snapshot)
METRICS§ 07
1,600+ARTICLES
95+PROMPTS
2.1M+KBRAIN WORDS
95K+EMAILS SEARCHABLE