Skip to main content

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 eleven tools (see Tools below).
  • A markdown vault, not a database. Every memory is a .md file 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 / reference by 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).

Upgrading on Windows. Every open Claude Code session runs erudition, and Windows locks a running .exe, so close all Claude sessions first, then uv tool install --force erudition-mcp==X. If an upgrade was interrupted halfway and erudition no longer starts, install straight into the tool's own environment:

uv pip install --python "$(uv tool dir)\erudition-mcp\Scripts\python.exe" erudition-mcp==X

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 eleven 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="", include_archive=False) 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. Notes in the archive folder named by the vault's note interface are left out unless include_archive=True (or folder is inside the archive). 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, sessions="", overwrite=False, dry_run=False) Save a typed memory (validated against the taxonomy), with standard frontmatter, indexed in MEMORY.md. A note interface can require sessions and provenance tags; see below.
append_log_line(project, what, outcome="", source="manual", id="", date="") Append one event line to a Daily note's ## Log. Needs a note interface.
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="One-line commit messages, no bullet lists (stated 2026-06-02).",
    sessions="2026-06-02",
)

The frontmatter gets sessions (when given) and updated: <today>. A vault with a note interface can make both sessions and the provenance tag mandatory; see save_memory requirements.

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-start injects the note at session_start_note (default Memory/CURRENT.md) as session context, and warns when the installed Erudition differs from the version the vault pins. With a note interface, it first renders CURRENT.md, Dashboard.md and Installed.md, and injects the fresh CURRENT.md instead.
  • stop mirrors the vault's memory folder into the memory folder next to the session transcript, which is where Claude Code reads memory from. With a note interface, it also lints the vault (showing only findings that are new in files that changed) and re-renders Dashboard.md when a note changed.
  • git-guard blocks git commands that destroy work: force pushes (--force, -f, --force-with-lease, +refspec), remote branch deletes, --mirror and --prune pushes, hard resets, clean -f, forced branch deletes, and checkout . / restore .. A plain push only fast-forwards, so it goes through. Global options such as git -C <path> don't hide a command.
  • ticket-gate holds code edits in a project until its version plan (specs/vN/plan.md) says status: 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.4.0"        # the version hooks and doctor expect

[notes]
interface = "System/note-interface.toml"   # turns on lint, rendered views, append_log_line

[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 (with another host's value as an example). On a machine that already has a section, it asks only for the values the settings fragment needs and the section lacks, and writes them in. It points ~/.config/erudition/erudition.toml at the vault and registers the MCP server. When [bootstrap] asks for them, it also:

  • writes ~/.claude/CLAUDE.md as 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}, {vault_rule}, and any key of the host's section; objects merge, lists union). {vault_rule} is the vault in Claude Code's permission-rule form, e.g. Read({vault_rule}/**): //d/Notes/vault on Windows, //Users/me/vault on macOS, //home/me/vault on Linux. A host can still set its own.

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.

Note interface

Lint, the rendered views, append_log_line and the save_memory checks all read one file: the vault's note interface, a TOML file the manifest names under [notes] interface. It says where things live, which note type each location holds, what each type must contain, and how big a note may grow. Every table is optional and falls back to the defaults below; a vault without [notes] interface has these features off.

[folders]
projects = "01-Projects"            # project notes: 01-Projects/<P>/<P>.md
areas = "02-Areas"                  # area notes:    02-Areas/<A>/<A>.md
daily = "Daily/{yyyy}-{mm}/{yyyy}-{mm}-{dd}.md"
daily_template = "Templates/Daily.md"
memory = "Memory"
archive = "04-Archive"              # search and lint skip it
threads = "Memory/threads.md"       # open threads, injected at session start
attachments = "Attachments"

[locations]                         # glob -> note type; {folder} is the note's own folder name
"01-Projects/*/{folder}.md" = "project"
"02-Areas/*/{folder}.md" = "area"
"Notes/**/*.md" = "resource"

[types.project]
required = ["type", "status", "blocked"]
enums = { status = ["building", "paused", "done"] }
sections = ["Why", "State", "Objectives", "Decisions", "Links"]
optional_sections = ["Milestones"]
tier = "note"

[types.resource]
required = ["type"]

[tiers.note]                        # size in KB: target, warning, flag for the user
ideal = 4
caution = 8
action = 12

[tiers.memory]
ideal = 2
caution = 3
action = 4

[exempt]
paths = ["Inbox/", "Templates/"]    # never linted

[log]
sources = ["manual", "auto:git"]    # allowed Log-line sources (fnmatch patterns)

[memory]
require_sessions = true
require_provenance = true
types = ["user", "feedback"]        # allowed memory types for lint; empty = any

[render]
current = "CURRENT.md"
dashboard = "Dashboard.md"
installed = "System/Installed.md"

A malformed interface never stops a session: the features that need it switch off and say why.

erudition lint

erudition lint                  # the whole vault
erudition lint Notes/ a.md      # report on these paths only

Reports, never fixes. One line per finding, level path: rule message; exits 1 when there is an error.

Rule Checks Level
L1 type, required frontmatter, enum values, repo: not absolute error / warn
L2 ## sections in the type's order warn
L3 size past the tier's caution / action warn / error
L4 a Log line that doesn't start with - [[ warn
L5 a Log line with no source tag, or auto: with no ^id warn
L6 two notes share a basename error
L7 a wikilink or embed that points at nothing warn
L8 a resource nothing links to warn
L9 a non-image in attachments, or an image nothing embeds warn
L10 memory: index length, provenance tags, memory type warn
L11 the threads file over 5 lines warn
L12 ### Now with more than 5 open items warn
L13 a project folder without <P>.md warn

The Stop hook runs the same checks when anything changed, keeps the result in .erudition/lint.json, and only speaks up about findings that are new in files that changed.

Rendered views

Three files are rendered, never edited by hand (each is overwritten on the next render), so the vault only tracks what people write:

  • CURRENT.md, at session start: open threads, projects in progress (blocked first), areas, the last 7 days of Log lines, and a lint count. If a render fails, the last one is injected with a warning.
  • Dashboard.md, at session start and at Stop when a note changed: one row per project and area (status, next step, open and recently done objectives, milestones, blocker, last activity), plus each project repo's most-changed files over 30 days. A project with repo: pointing at a /ticket-style repo takes its open count and next step from that repo's specs/board.md.
  • Installed.md, at session start: this machine's Claude Code skills (vault-linked, public or broken), user-scope MCP servers (command and args only, never env or headers), plugins, hooks, and the --version of each [checks.commands] entry.

Installed.md describes one machine; add it to [checks] untracked if more than one machine shares the vault.

append_log_line

The Daily note's ## Log is the vault's event store, one line per event:

- [[Project]] what happened → what it led to (manual) ^id

append_log_line creates the Daily note from daily_template if needed, adds ## Log if it's missing, and refuses a source not allowed by [log] sources. Automated sources (auto:*) must pass an id, and an id already in that Daily note means the event is already logged, so nothing is written twice. A project name that matches no note is still written, with a warning.

save_memory requirements

With [memory] require_sessions, save_memory refuses a memory without sessions. With require_provenance, it refuses a body with no (stated YYYY-MM-DD) or (adopted YYYY-MM-DD) tag, so every rule says where it came from. Both default to on and switch off in the interface. A memory past the memory size tier is still written, and the result says by how much.

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.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for erudition-mcp 0.4.3
File Size Uploaded Provenance Actions
erudition_mcp-0.4.3.tar.gz 124.5 kB Without provenance Details for erudition_mcp-0.4.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for erudition-mcp 0.4.3
File Interpreter ABI Platform Actions
erudition_mcp-0.4.3-py3-none-any.whl Python 3 none any Details for erudition_mcp-0.4.3-py3-none-any.whl

Total release size: 205.7 kB

Release files / erudition_mcp-0.4.3.tar.gz

Download URL erudition_mcp-0.4.3.tar.gz
Size 124.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0eab3757a645dfe349468afb0569bf90d51c942bb13f629015179511840e3e4f
BLAKE2b-256 checksum
How to use checksums
39b7f52a2db17f6cc153ec5fe36a8222836a2ae65441b18eabc0628267fb8db9
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.4.3-py3-none-any.whl

Download URL erudition_mcp-0.4.3-py3-none-any.whl
Size 81.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8b8bd7ce4906f5ccc47761753a326dfafe716541572b36c637b24e7e9259c90
BLAKE2b-256 checksum
How to use checksums
897e259aeeff7c77945c1107f50c8b0ccdb2d99d8a997929df52fa288ca8c0a4
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.4.3

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page