agent-librarian
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-librariansearch memory for authentication flow in my-app"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Librarian
Persistent, curated project memory for coding agents (Claude Code, Codex, Cursor, or anything with a shell).
Agents search the memory before exploring code, and record what they learn as small events. A scheduled Librarian agent audits each event against the real source and folds it into a tidy Markdown wiki. Memory therefore gets more accurate over time instead of piling up contradictions.
Everything lives in a private git repo you own (the vault). The engine in this repo holds none of your data.
agents ──search/read──▶ vault/Knowledge/<Project>/*.md (canonical, Librarian-edited)
agents ──remember────▶ vault/Knowledge/Stash/<Project>/*.yaml (append-only events)
Librarian (scheduled) ── audits source ──▶ edits Knowledge, removes consumed events, commits, pushesRead the four-page project report for three months of usage data, the savings model, and a comparison with Agent Memory Repo.
Install
You need Node ≥ 20.12 and git. If you want agents wired up automatically, also install Claude Code, Codex, or Cursor.
git clone https://github.com/Dbhardwaj99/librarian
cd librarian && npm install && npm link # builds and puts `librarian` on PATH(npm i -g github:… doesn't work: npm skips the TypeScript build for global git installs. Clone instead until the package is on npm.)
Related MCP server: engram
Set up (once)
librarian init ~/agent-memory # create a private vault, wire every agent CLI found, schedule the Librarian
cd ~/code/my-app && librarian add # register each repo you want rememberedinit does three things:
Creates
~/agent-memory, a git repo.Registers the MCP server and installs
skills/librarian/SKILL.mdfor each agent it finds: Claude Code, Codex, and Cursor (MCP only).Schedules the Librarian for weekdays at 11:30, using launchd on macOS or cron on Linux.
To back up your vault and sync it across machines, give it a private remote:
cd ~/agent-memory && git remote add origin git@github.com:you/agent-memory.git && git push -u origin mainNew machine or teammate: clone and link the engine, then run librarian init git@github.com:you/agent-memory.git.
Skill only, for agents the installer doesn't know: npx skills add Dbhardwaj99/librarian --skill librarian.
Daily use
Nothing changes in how you work. The skill teaches agents to search_memory before grepping and to remember durable findings. The Librarian runs on schedule and writes Knowledge/librarian/daily-brief.md. Run librarian doctor whenever something looks off; it also flags a stash backlog that hasn't been processed for over a week.
Commands
Command | What it does |
| Create, clone, or adopt a vault; then |
| Register a repo; matches its folder name anywhere in a path, so worktrees resolve too |
| Register the MCP server + skill |
| Timer for |
| Same as the MCP tools, from a shell; project comes from the current directory |
| Snapshot manual edits, run the agent headless, run |
| Commit new stash events, |
| Knowledge structure rules: ≤300 words per note, ≤8 hub children, no unresolved |
| Vault, agents, skill freshness, schedule, stash backlog age |
| Tool-call telemetry from |
MCP tools
Every tool takes repositoryPath (the repo being worked on) and an optional taskId that ties related calls together in the log.
Tool | Purpose |
| Every canonical note for the project |
| One note's full content |
| Ranked section search: file, heading, strongest snippet, nearby context |
| Append an immutable event ( |
| Unprocessed events, oldest first |
Vault layout
agent-memory/
librarian.json # projects → repo folder matchers + paths; librarian agent/schedule/model
Knowledge/
README.md
<Project>/<Project>.md # one hub per repo, Librarian-maintained
Stash/<Project>/*.yaml # pending events
librarian/daily-brief.md
LIBRARIAN.md # optional: override the packaged writing rules
.logs/ # telemetry + scheduler logs (gitignored)Why not agents writing memory directly?
Both Librarian and Agent Memory Repo keep linked knowledge in a Git repository. Agent Memory Repo defines direct note updates and periodic Dreaming. Librarian packages a coding workflow with three features:
Audited knowledge. Every claim is checked against source before it becomes canonical.
Separate proposals. Each event is its own file, so agents can record findings independently before the Librarian merges them.
A wiki that stays navigable. Hubs, size limits, and link checks keep it organized.
Renaming an existing installation
The project and command are now librarian. Before moving an existing checkout, run the old command with schedule --remove. Rename the vault settings file to librarian.json and the user config directory to ~/.config/librarian. Update registered paths if the checkout moved. Remove the old MCP registration and skill, then run npm link, librarian install, and librarian schedule from the renamed checkout. Restart agent sessions to load the new MCP name. The knowledge vault itself does not need to move.
Development
npm test # build + structure check, MCP smoke test, CLI journey (throwaway HOME), telemetryThis server cannot be deployed
Maintenance
Related MCP Connectors
Project memory, semantic code search, and grounded agent context.
Project memory for coding agents: requirements, decisions, code graph and delivery telemetry.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Hosted agent memory with provenance, contradiction surfacing, and snapshot rollback.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides persistent, searchable memory and knowledge capture for AI-assisted development, enabling agents to retain decisions, bugs, and patterns across sessions and projects.MIT
- AlicenseNot gradedqualityCmaintenanceProvides persistent project memory for AI coding agents, enabling context retention across sessions via event logging, briefing generation, and querying.MIT
- AlicenseNot gradedqualityAmaintenanceEnables agents to read and write a durable, append-only memory with verified provenance, supporting search, record capture, and context preparation across sessions and machines.MIT
- AlicenseNot gradedqualityAmaintenanceProvides persistent, searchable memory across coding projects and machines, letting agents record and retrieve projects, reusable assets, sessions, decisions, commits, and handoffs via MCP.24 PyPI2Apache 2.0