kaamiiaar.
← all projects

2026 · built for myself

Knowledge core

agents · memory · sqlite fts5

A new Claude session starts knowing nothing about yesterday. I didn’t want a hidden memory I can’t read, so everything lives in ordinary markdown files: notes, decisions, research, call transcripts, tool docs. The trick is keeping them current and finding the right line fast.

Knowledge core is three small pieces and one rule: a skill that saves what a session learned, a nightly digest of the day’s sessions, a search tool called kc, and “search before you state a fact”.

SESSIONSevery conversation with Claude Code/KNOWLEDGE-COREsaves what was learned,prunes the staleNIGHTLY DIGEST03:30, a brief of theday’s sessionsNOTESplain markdown: docs, decisions, research,transcripts, memoryKC INDEXSQLite FTS5 + BM25, re-reads only changed filesAGENTSsearch before stating a fact, about 0.05 s a query
how it works
A real kc search: the research report, the render tool’s README and a saved preference come back ranked, with the matching words highlighted
A real kc search: the research report, the render tool’s README and a saved preference come back ranked, with the matching words highlighted
Details

How it works

  • kc is a full-text index over every markdown file I keep, over 400 of them, plus the assistant’s memory: SQLite FTS5 ranked by BM25. Files are split into sections by heading, headings count more than body text, and every hit shows the file and line, its heading path and a highlighted snippet.
  • Each search re-reads only the files whose modified time changed, so a search takes about 0.05 s and a full rebuild about 0.4 s. Stems match (price finds pricing), and exact phrases, OR, NOT, NEAR and prefixes work too.
  • The /knowledge-core skill goes back over a session and writes each decision, fact, rule and open item into its one right file, after searching with kc so it updates the existing line rather than adding a duplicate. Then it prunes: it replaces stale facts instead of appending, deletes what no longer applies, and checks READMEs against the code.
  • Every night at 03:30 a timer reads the day’s sessions (what I typed and Claude’s final replies, not tool output), has headless Claude condense them into Decided, Learned, Built, Preferences and Open, redacts secrets before and after, and commits the brief. The digests are indexed by kc like everything else.
  • The rule every agent follows: before stating a fact about my own work, run kc and quote what it finds; if nothing turns up, say so instead of guessing.
  • Why not a semantic search tool: the good ones run local models several gigabytes in size, too heavy for my 2-CPU server, and their fast keyword mode is the same BM25 search kc does with no installs.
Next
next project →Claude App for Linux