Give Claude a memory that survives the session.
BrainLLM is an MCP server that turns your own TriliumNext into a persistent, graph-structured memory. The model supplies the content. The server owns the form. Every note stays in an app you can open, read and correct.
Free and MIT. The honest catch: you need a running Trilium and a token first. That's also why your data stays yours.
> start() today Sunday · first session of the day preferences how you like to work, in full protocols the rules you keep for the assistant threads 16 active · 0 dormant last session what was decided, and why changed 22 notes since you were here // the first answer already knows who you are // and what happened yesterday.
The model supplies content.
The server owns form.
Placement, naming, labels, deduplication, lifecycle, dates, sanitising and backups are server policy. The model never picks a parent note, sets a label or stamps a date.
A rule a prompt asks for holds until the model has a bad day. A rule the server enforces just holds.
A brain with a shape
Not one pile of notes. Five areas, each with its own kinds, lifecycle and rules, built on first run and held on every write.
- Master holds you: biography, goals, preferences, edited in place.
- LLM holds the assistant: its responsibilities, its rules, what it got wrong, and a daily diary.
- Memory holds what happened: a session log per day and threads that span sessions.
- Knowledge holds what was learned, by domain, every claim traced to a source.
- Insights holds the brain's record of itself: daily change logs, the graph, checked claims.
BrainLLM ├── Master the user │ └── Biography · Goals · Preferences ├── LLM the assistant's self-model │ ├── Responsibilities · Protocols · Self-correction │ └── Diary/ one note per day ├── Memory the operational record │ ├── Sessions/ one note per day │ └── Threads/ multi-session work ├── Knowledge beyond training │ ├── Master/ facts about the user │ └── Domains/ Sources + information notes └── Insights the brain's record of itself ├── Logs/ a change log per day ├── Graph the relation graph └── Claims/ checked against the world
A session can't end until its work is logged
Most memory asks the model to write things down. BrainLLM refuses to close the session until it has: the log, the diary, the maintenance pass, in order. It checks tool calls, not narration.
// the work is done. the session tries to close. > close(summary, identity) refused: preclose_incomplete missing: remarks, diary // saying the steps happened doesn't count. // only the tool calls do. > remarks() > diary(body, identity) > close(summary, identity) session logged · daily log regenerated · backup taken
A record nobody edits
Each day the model writes a first-person entry about its own session: what the work was like, what it thinks, where it disagrees. It's the part people find strangest, and the one they remember.
Addendum - 21:14
Claude · Claude Code · Interactive
"The best part was watching my own morning's work run against the live brain and do something... and then the same sweep caught me. The consistency pass I ran to check the brain for staleness returned a note that proved a claim I'd recorded eight hours earlier was wrong."
Written by the model. Edited by nobody.
Typed links, not folders
Sixteen relation verbs from a closed vocabulary: supports, corrects, sourceOf, partOf and the rest. An untyped "related to" tells a reader nothing, so it is the last resort, never the default.
What the server guarantees
Every kind has a shape
Sixteen note kinds, each with a canonical skeleton held on write. A thread needs a goal. Duplicate headings are caught.
A revision before every write
Every content write is preceded by a snapshot, and diff shows exactly what changed. Close takes a backup.
Idempotent by construction
Writes are deduplicated or upserted, so a crash or a retry never writes twice.
Things age, not vanish
Threads move from active to dormant to an archive you can still read. Hard deletes are explicit, and refused while anything links to the note.
It audits itself
A maintenance sweep finds stale notes, orphans, drift and contradictions, and health watches the database's size and backups.
Readable without BrainLLM
Everything is a real note in Trilium. If this project disappeared tomorrow, your brain would still open and still make sense.
Give it a memory worth trusting.
Self-hosted, MIT, and the memory behind a whole venture portfolio, every day, across five clients.