The Librarian
Intelligently curated context.
The Librarian is an Agentic OS: a curator that builds a library of context for your AI agents. It runs on its own but you teach it what matters, so the knowledge it keeps reflects how you actually work and every AI tool you use gets better at the job.
The problem is context.
"90% of Claude's mistakes come from missing context, not a weak model."- Andrej Karpathy
Every new session, your agent starts blind. So you tell it the same things again: how you like your code, what finished means on this project, the decision you made last week and why. The obvious fix is to make it remember everything, and that quietly makes things worse. A memory that keeps every passing remark fills with noise, and the handful of facts that matter sink beneath the ones that do not. The more you store, the worse recall gets. Capturing everything is easy and almost useless.
More than facts.
Context is the shape of how you work: your voice, the way you like to build, what you mean by finished, and the reasoning behind the projects you have already shipped. It is also never static. As you change your mind, raise your standards, or learn something the hard way, the library deepens and keeps pace, so what an agent reads is the current you rather than a snapshot from six months ago. Your context grows as you do, and your agents grow with it.
Intelligent curation.
When something new arrives, the curator reads what you
already have and decides what to do: create a fresh note
linked to neighbours, fold it into an existing document,
or replace one that has gone out of date. If it's not
certain, you get looped in via proposal and review. You
can set a schedule for the curator to groom the whole
vault, reorganising and proposing archive of stale
documents.
You pick the provider and model - point it at a local
inference machine for total privacy.
Teach it your taste.
The curator starts with sensible defaults, and the judgement is yours to shape. Tell it what you care about and what you would rather it left out in plain language. It adjusts on the next run with your guidance, versioned so you can roll anything back. You can also talk through a single memory, ask why it was filed the way it was, direct a fix, and bake that thinking into the curator's guidance. Over time it gets better at its work and needs less management.
One library, every agent you use.
The Librarian is not tied to one tool, or one machine. It serves the same context to most popular harnesses (more to come!) through a small set of commands they all understand, so the context you built in one agent is waiting in the next, wherever you work. Unfinished sessions can be handed off and claimed by another agent in another tool. The morning after you taught Claude how you like your pull requests written, Codex writes them that way without being asked.
Works with the agents you already use
- Claude Code
- Codex
- OpenCode
- Hermes
- Pi
Off the record.
By default the Librarian captures as you work, mining
every few turns for the handful of facts worth keeping.
But turn on privacy mode and the Librarian stops
listening. Nothing is captured, and your agent cannot
send anything to the library. Recall still works though,
so you don't lose context. Switch it on with the
/toggle-private command or just tell your
agent to go off the record. It lasts until you toggle it
back off or start a new session.
You own it.
The Librarian runs as a small server you host yourself. Everything it knows is plain markdown in a git repository, readable, editable and yours. Open it in the dashboard, in Obsidian, or any other markdown editor; read its full history; reorganise it by hand whenever you like. Scheduled automatic backup to a private git repository is supported, so there is always an off-machine copy with full history. There is no vendor lock-in and nothing is trapped in a database, so there is nothing to export and nothing to lose if you ever walk away. Performant recall is provided by a disposable in-memory index built from the markdown vault.
Not a black box.
Every change the curator makes is logged, including the rationale behind its decision to help you tune its behaviour.
Low confidence destructive actions like archiving are passed to you for review with a clear explanation of why.
A complete history of every automatic update to existing information is saved, and you can restore to any point.
The whole loop, in one view.
Three kinds of material live in the library, and one curator tends them all.
-
Goes in
- Memoriesauto-captured, or when you ask
- Referenceslong-form, added by you
- Handoffswork in progress
-
The curator
- Intakekeep, file, link
- Groomingdedupe, retire, refine
runs on its own
-
The library
- One collectioncurated and cross-linked
-
Your agents
- Retrieve & actrecall · search · hand off · flag
You steer it over time: review the curator's proposals, discuss its decisions, and refine the standing instructions that guide its next run.
- recall
- find what is relevant to the task at hand
- remember
- capture something worth keeping
- search_references
- read long-form material in full
- store_handoff · list_handoffs · claim_handoff
- pass work between agents
- flag_memory
- mark something wrong or out of date
The dashboard.
The dashboard is where you tend all of this. Browse and edit every memory, work through the curator's proposals, read the references, and follow the collection as it changes with full history and one-click rollback. The server can keep itself current with a daily auto-update, so the software stays fresh without you thinking about it.
Coming next.
A few things are on the way:
- A browser extension to save articles straight into your reference library as you read.
- Mobile apps to share content from any app on your phone into the library.
- More harness integrations, so the Librarian reaches wherever you work.
Open source, and yours to shape.
The Librarian is free and open source under the Apache licence. A couple of commands get you up and running, with no account and nothing to sign up for. If you hit a rough edge, have an idea, or fancy helping build what comes next, come and find the project on GitHub. Issues, pull requests and ideas all welcome.
1 · Run the server
npx @the-librarian/cli server up
Builds and runs the server and dashboard on your machine.
2 · Connect your agents
npx @the-librarian/cli install
Wires it into your harnesses and keeps them up to date.