Erudition
Portable, typed, git-friendly memory for AI agents.
Claude Code's built-in memory is local-only and opaque. It lives inside Claude Code itself, isn't portable across machines, and isn't something you can casually read, diff, or edit by hand. Erudition is an MCP server that gives an agent read/write access to a memory store that's none of those things: a plain folder of markdown files, organized around a real taxonomy instead of a junk drawer, editable in whatever notes app you already use, and portable across every machine you own via git.
This README covers what Erudition does and how to install it. For the reasoning behind why it's built this way, and just as importantly, why it isn't built several other, more obvious ways, see WHY.md.
What it is
- An MCP server. Works with Claude Code, Claude Desktop, or any other MCP-compatible client, exposing ten tools (see Tools below).
- A markdown vault, not a database. Every memory is a
.mdfile with YAML frontmatter, in a folder you fully control. No proprietary format, no service to run, no account to create. Obsidian is a good viewer/editor for it, but Erudition doesn't require Obsidian. Any plain-text editor works. - A taxonomy, not a junk drawer. Memories are typed (
user/feedback/project/referenceby default), so an agent (and you) can tell "a fact about how I like to work" apart from "a fact about this specific project" at a glance.
What it isn't
- Not a hosted product. It runs locally, wherever your agent runs.
- Not a "chat with your notes" RAG plugin. Erudition is about agent memory (what an agent should remember across sessions), not general document search.
- Not a replacement for Claude Code (or Claude Code's own memory). It's a layer on top, and it's designed to stay small rather than grow into a competing agent runtime.
Quickstart
1. Install
pip install erudition-mcp
Or, for local development:
git clone https://github.com/Ralf090102/Erudition.git
cd Erudition
pip install -e .
Either way, this installs the erudition command (the PyPI distribution is named erudition-mcp; the import path and CLI command stay erudition).
2. Point it at a vault
Erudition needs to know which folder is your vault:
export ERUDITION_VAULT_PATH="/path/to/my-vault"
That's a complete, valid setup on its own. If you want the auto-commit toggle or a custom taxonomy, write an erudition.toml instead (or alongside). Copy erudition.example.toml and see the Configuration table below for every option.
3. Connect it to your MCP client
For Claude Code, add it to your MCP server config:
{
"mcpServers": {
"erudition": {
"command": "erudition",
"env": {
"ERUDITION_VAULT_PATH": "/path/to/my-vault"
}
}
}
}
Restart your client. You should see all ten tools below available.
Erudition keeps a small search index at {vault}/.erudition/. It's a rebuildable cache, not real content, so add .erudition/ to the vault's own .gitignore.
Tools
| Tool | What it does |
|---|---|
read_note(path) |
Read a note's contents. |
list_notes(folder="") |
List markdown notes in a folder, recursively (empty string lists the whole vault). |
search_notes(query, folder="") |
Search note contents, backed by a rebuildable SQLite FTS5 index rather than a linear scan. This makes matching token-based, not raw substring: wid* matches "widgets," a bare idget doesn't the way a plain substring scan would. Supports FTS5 phrase ("exact phrase") and boolean (AND / OR / NOT) syntax. Falls back automatically to a plain linear scan if the local sqlite3 build lacks FTS5. Returns matching file paths and the lines that matched; if a query is still slow despite the index, the result includes a one-line note suggesting the staleness check itself might be worth revisiting. |
write_note(path, content, overwrite=False, dry_run=False) |
Write a note; refuses to clobber an existing one unless overwrite=True. dry_run=True writes nothing and returns a preview (new content, or a diff against what's there) instead. |
append_to_note(path, content, dry_run=False) |
Append to a note, creating it (and any parent folders) if it doesn't exist yet. |
str_replace_in_note(path, old_string, new_string, dry_run=False) |
Replace one exact, uniquely-matching string within an existing note, in place — for a small correction to one part of a note without rewriting the rest. Refuses if old_string doesn't match exactly once (zero matches, or more than one), rather than guessing which occurrence you meant. |
list_memory_types() |
List the vault's configured taxonomy: valid type values for save_memory, and what each is for. |
save_memory(type, name, description, content, overwrite=False, dry_run=False) |
Save a typed memory (validated against the taxonomy), with standard frontmatter, indexed in MEMORY.md. |
sync_memory() |
Mirror the vault's memory folder out to a configured local memory directory. |
rebuild_search_index() |
Force a full rebuild of the search index from scratch. Rarely needed, since search_notes already self-heals from a cheap per-search staleness check; mostly a manual escape hatch for recovery or peace of mind after a large batch of external edits. |
The taxonomy
Erudition's default memory types, and what each is for:
| Type | What goes here |
|---|---|
user |
Who the person is: their role, goals, expertise. Lets an agent tailor how it explains things. |
feedback |
Corrections and confirmed approaches, like "don't do X, we tried it and it broke Y" or "yes, that approach was right." Stops an agent from repeating a mistake or re-litigating a settled call. |
project |
Ongoing context about why (decisions, deadlines, stakeholders) that isn't visible in the code or git history alone. |
reference |
Pointers to where information actually lives, e.g. "bugs are tracked in Linear project X," not a copy of the bugs themselves. |
This is a starting point, not a fixed schema. Define your own types under [taxonomy.*] in erudition.toml if your vault needs a different shape. See erudition.example.toml.
Saving and syncing memories
Beyond generic write_note, Erudition understands the taxonomy. save_memory validates the type you pass against the vault's configured types, writes the memory to Memory/{type}_{slug}.md with standard frontmatter, and keeps Memory/MEMORY.md as a lightweight index, one line per memory:
save_memory(
type="feedback",
name="Prefers terse commit messages",
description="User wants one-line commit messages, no bullet lists.",
content="Confirmed after three separate corrections. Applies to this repo only.",
)
If your agent also keeps its own local memory folder (Claude Code does), sync_memory() mirrors everything under the vault's memory folder out to it, so writing a memory once in the vault doesn't also require a manual second write elsewhere. Configure the destination via local_memory_dir (see Configuration below). sync_memory() errors clearly if it isn't set, rather than silently doing nothing.
Write safety: a permanent design choice, not a limitation
Erudition assumes one active writer at a time. Flat markdown files have no locking, so if a human and an agent (or two agent sessions) write to the same note within moments of each other, the later write silently wins. No merge, no conflict marker, no error.
This is deliberate, not an oversight. Closing that gap completely would mean row-level locking, which means becoming a database. That trades away the one thing that makes a markdown vault worth using over a SQLite-backed alternative: you can open, read, and edit every memory in any plain-text editor, no tooling required. Instead, Erudition offers durability without locking: an optional auto_commit setting that git-commits every write with a distinct, identifiable message (erudition: write <path>). It doesn't prevent a collision, but it means a collision is always recoverable via git log / git diff instead of silently gone.
If you run more than one agent session against the same vault at the same time, that's exactly the scenario this boundary is about. Treat "one writer at a time" as a real constraint, the same way you would with any file two processes might edit concurrently.
Separately from durability, write_note, append_to_note, and save_memory all accept dry_run=True: nothing gets written, and you get back a preview instead, either the full content for a brand-new note, or a unified diff against what's already there for an overwrite. Useful for checking what a change would actually do before committing to it, especially with overwrite=True.
Hooks
Claude-Code-specific and optional: a companion to the MCP server, not a change to it. If you don't use Claude Code, skip this section.
Two problems this solves: remembering to read a "where we left off" note at the start of every session, and remembering to call sync_memory() after making changes. Claude Code's own hook system (separate from MCP) covers both: SessionStart injects context when a session begins, and Stop runs after every turn. The hooks are subcommands of the erudition command, so the same settings work on every OS. Add this to ~/.claude/settings.json (or let erudition bootstrap merge it in, see below):
{
"hooks": {
"SessionStart": [
{ "matcher": "*", "hooks": [{ "type": "command", "command": "erudition hook session-start" }] }
],
"Stop": [
{ "hooks": [{ "type": "command", "command": "erudition hook stop" }] }
],
"PreToolUse": [
{ "matcher": "Bash", "hooks": [{ "type": "command", "command": "erudition hook git-guard" }] },
{ "matcher": "Edit|Write|NotebookEdit", "hooks": [{ "type": "command", "command": "erudition hook ticket-gate" }] }
]
}
}
session-startinjects the note atsession_start_note(defaultMemory/CURRENT.md) as session context, and warns when the installed Erudition differs from the version the vault pins.stopmirrors the vault's memory folder into thememoryfolder next to the session transcript, which is where Claude Code reads memory from.git-guardblocks destructive git commands, such as pushes, hard resets, and forced branch deletes.ticket-gateholds code edits in a project until its version plan (specs/vN/plan.md) saysstatus: building.
Hooks find the vault from the project folder, so a vault opened as a Claude Code project needs no environment variables. When the manifest turns on [git_sync], session-start also pulls the vault and stop commits and pushes it (both skip while conflict markers exist). Hooks never block a session: a problem goes to stderr and the session carries on.
Machine manifest
A vault can carry System/machines.toml, which describes the Claude Code setup it expects on every machine that uses it. Every part is optional; a vault without one gets defaults and nothing enabled.
erudition_version = "0.3.0" # the version hooks and doctor expect
[hosts.my-laptop] # one section per machine: its short hostname, lowercased
projects_root = "/Users/me/Code" # any key here becomes a {placeholder} in the settings fragment
[bootstrap]
mcp = true # register Erudition as a user-scope MCP server
mcp_name = "erudition" # the server's name (default "erudition")
claude_md_import = "System/Claude/CLAUDE.md"
skills_dir = "System/Claude/skills"
settings_fragment = "System/Claude/settings.fragment.json"
[git_sync]
enabled = false # pull at session start, commit and push at Stop
[ticket_gate]
exempt = ["notes"] # project folders the gate never blocks
[checks]
untracked = [".erudition/"] # derived paths the vault should never track
[checks.commands] # command = install hint
git = "https://git-scm.com/downloads"
uv = "https://docs.astral.sh/uv/"
[checks.skills] # skills that come from elsewhere: name = install hint
pdf = "claude plugin install pdf"
The host key is the machine's hostname up to its first dot, lowercased; set ERUDITION_HOST to override it. A vault-relative path other than System/machines.toml goes in manifest_path in the config file.
Bootstrap and doctor
erudition bootstrap turns a fresh clone of a vault into a working setup on the current machine:
cd path/to/my-vault
erudition bootstrap --dry-run # show the plan, change nothing
erudition bootstrap
erudition doctor
Bootstrap checks the commands under [checks.commands] and adds a [hosts.<this machine>] section if there isn't one, asking for each value the other hosts define. It points ~/.config/erudition/erudition.toml at the vault and registers the MCP server. When [bootstrap] asks for them, it also:
- writes
~/.claude/CLAUDE.mdas an import of the vault's copy - links each vault skill folder into
~/.claude/skills/(a junction on Windows, a symlink elsewhere) - merges the settings fragment into
~/.claude/settings.json(placeholders:{vault_path},{home}, and any key of the host's section; objects merge, lists union).
Every file it replaces is backed up first, and running it again on a set-up machine changes nothing. It never installs system packages; it prints where to get them. --yes never prompts; --home <dir> sets up a different home folder.
erudition doctor checks the same things without changing anything and prints one line per check: ✅ fine, ⚠️ works but has drifted, ❌ <problem> → <fix>. It exits 1 if anything is ❌. Run it after bootstrap, after pulling manifest changes, or whenever a session behaves oddly.
Configuration
| Setting | Env var | erudition.toml key |
Default |
|---|---|---|---|
| Vault path | ERUDITION_VAULT_PATH |
vault_path |
(required, one or the other) |
| Auto-commit on write | ERUDITION_AUTO_COMMIT |
auto_commit |
false |
| Memory taxonomy | — | [taxonomy.*] |
the four types above |
| Memory folder | ERUDITION_MEMORY_FOLDER |
memory_folder |
Memory |
Local memory mirror (for sync_memory) |
ERUDITION_LOCAL_MEMORY_DIR |
local_memory_dir |
unset |
| Session-start note (for the optional hook) | ERUDITION_SESSION_START_NOTE |
session_start_note |
Memory/CURRENT.md |
| Config file location | ERUDITION_CONFIG |
— | ./erudition.toml if present, else ~/.config/erudition/erudition.toml |
| Machine manifest | — | manifest_path |
System/machines.toml |
| Host key | ERUDITION_HOST |
— | short hostname, lowercased |
An env var always wins over the config file for the setting it covers. Hooks also take the vault from the Claude Code project folder, after ERUDITION_VAULT_PATH and before the config file. Full example with every option: erudition.example.toml.
Development
pip install -e ".[dev]"
pytest
Status
Early stage. Config-driven vault path, generalized taxonomy, the write-safety toggle (including dry-run previews), the taxonomy-aware memory tools (save_memory, sync_memory, list_memory_types, append_to_note, str_replace_in_note), a rebuildable FTS5 search index, and a real, repo-tracked test suite are all done. Since 0.3.0, a vault's machine manifest drives portable hooks, erudition bootstrap, and erudition doctor on Windows, macOS, and Linux. Live on PyPI as erudition-mcp since 2026-08-10. Expect breaking changes before a 1.0 release.
License
MIT. See LICENSE.
Metadata
Release files for erudition-mcp 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| erudition_mcp-0.3.0.tar.gz | 68.9 kB | Without provenance | Details for erudition_mcp-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| erudition_mcp-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for erudition_mcp-0.3.0-py3-none-any.whl |
Total release size: 114.9 kB
Release files / erudition_mcp-0.3.0.tar.gz
| Download URL | erudition_mcp-0.3.0.tar.gz |
|---|---|
| Size | 68.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d9eade2f42d112b1a5220260ebe45414aa32640dcd680d9fe92a231f7b595ec
|
|
BLAKE2b-256 checksum How to use checksums |
51dd28a514b6b389d1fb20b351f7a97f4cd446cc2a37be47df06978cd10d673e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / erudition_mcp-0.3.0-py3-none-any.whl
| Download URL | erudition_mcp-0.3.0-py3-none-any.whl |
|---|---|
| Size | 46.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d305cddd979252aa4136907b851cec524fba849fe5bb49d7ab5e66ce4b7f2be
|
|
BLAKE2b-256 checksum How to use checksums |
e4c6b06b27577cb5ef8c1f9f79a1761df6a3ceac77a2ab0837d86835c606ac68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for erudition-mcp 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.