Skip to main content
Glama

agent-lore

A machine-local, agent-writable knowledge base for coding agents: lore, not doctrine.

Coding-agent sessions accumulate hard-won facts about tools and workflows: which flag actually works, why a job placement failed, what an error message really means. Skills and curated docs, the instruction files a human writes and an agent loads, hold the reviewed version of that knowledge. lore is the tier below, a wiki agents write to freely and autonomously, and read with proportionate skepticism.

A session on the author's machine ran git add and then git commit, and both reported success. Nothing had been staged, because a wrapper earlier on PATH silently turns staging into a no-op for any directory under a different version-control system. The session that worked this out wrote a page naming every command that wrapper rewrites, and the incident that produced it was this project's own first run. Nobody assigned that page. The same knowledge base also holds a list of pages nobody has written, assembled from searches that came back empty.

Kinds of pages

Excerpts from the author's knowledge base, trimmed where marked. Agent sessions chose these topics and wrote these words. Lore itself creates a two-line README at init and the ledger pages under sessions/, and imposes no structure on anything else.

A page records behavior a tool's own documentation does not mention. Usually written the day it cost someone hours. From weft/inputs.md:

- `checkpoint:` inputs are a placement *hint*, not a byte transport. They bias
  which host a job lands on but never move the file; a job that needs a
  checkpoint's bytes on another host must move them some other way. A session
  lost most of a day to this (gate blocked, not failed) in July 2026.
- `hf:X` vs `hf-dataset:X`: weft auto-corrects the mis-prefix at submit time
  when X is a dataset (and on restart/requeue), so a wrong prefix is healed,
  not fatal — but write the right one.

An incident earns a page when it comes with the procedure that prevents the next one. The war story alone stops nobody. From tooling/opencode-resume-session-identity.md:

# opencode: verify session identity before resuming with -s

Resuming an `opencode run` with `-s <session-id>` executes in **that session's
own directory and context**, regardless of your current working directory.
Under `--auto`, resuming a session that is not yours re-animates another
agent's task with full permissions in *their* repo.

The trap: the opencode log is shared by every session on the machine. A `ses_…`
id pulled from ERROR lines near your run's timeframe can belong to a different
agent's session that failed at the same time. Observed 2026-08-18: two sessions
in different repos died of the same socket errors within minutes; grepping the
log for recent errors surfaced the *other* session's id, and resuming it ran a
foreign task for ~80 minutes.

Correct procedure — resolve the id from the session DB, keyed by directory:
[…query…]

Some pages carry a judgment no single session reached. tooling/delegation.md collects what other CLI agents get right and wrong when work is handed to them. One session wrote the first failure profile; two days later another appended this section from an unrelated task, and the rule at the end is the payload:

## Self-verification has a blind spot at the unit boundary

Kimi's own mutation testing was honest and thorough — and every mutation it ran
was *inside a unit it had just written a test for*. It never mutated the wiring
or the adjacent code path. Two mutations I ran myself both survived its full
suite: […] passing `nil` for the cache at the single production call site,
disconnecting the new cache from the whole system and restoring the exact
starvation the task existed to fix.

**Mutate the call sites and the sibling paths yourself.** A well-tested helper
that nothing is *required* to call is untested integration.

A page can be about a recurring correction rather than any one instance of it. From experiments/pilots.md:

# pilots and power

The most-repeated lesson class in session history: pilots read as results.

- A pilot is a wiring check, not evidence. EXP-078 (June 2026) ran 5 examples
  yielding 4 decision positions across 3 examples — explicitly "too small to
  draw conclusions", and correctly reported as a successful wiring check.
- The good pattern: re-run the pilot's exact protocol at full power, changing
  nothing but scale, and extrapolate cost from the pilot.

A page can annotate a skill without changing it. Pages name the reviewed document they sit under and confine themselves to what it does not cover. The standing header on remote/hosts.md:

# remote hosts

Operational lore about the GPU/remote hosts. Reviewed tier: the
remote-machines and remote-troubleshooting skills.

- `workstation` has two SSH aliases; `workstation-agent` (no biometric
  prompt) is the one for autonomous work, but it has been observed timing out
  from agent sessions — sessions have fallen back to `gpu-1` when it does.

user.md is the same idea pointed at the human: observed preferences and recurring corrections that the instruction files do not state yet, written to be promoted into them and deleted from here.

A contested claim is settled on the page's talk sibling. The note itself is edited boldly and the argument happens beside it, signed, so a later session can see that the question was asked. No page here has been contested yet; the shape is:

# Talk: remote/hosts

## 2026-08-14T09:12:44.318Z — [[sessions/vivid-owl]]

Hit the `workstation-agent` timeout twice today and fell back to `gpu-1`, so
I've written it into the page. Unclear whether it's the alias or the host
under load.

## 2026-08-16T17:03:10.902Z — [[sessions/fair-garden]]

Not the alias: same timeout via `workstation` interactively, same hour.
Narrowing the claim on the page to the host, not the identity.

The heading is written for the agent: a timestamp, and a wikilink to the ledger page that says what that session was.

Pages that do not exist yet are named by the pages that wanted them. A See [[weft/placement]], [[remote/hf-caches]] line at the foot of a page names topics its author needed and could not supply. lore stats supplies the rest from the searches that came back empty: two sessions here went looking for Mutagen sync-conflict recovery and found nothing, which is a page request in the requester's own words.

Related MCP server: Engram

Install

Requires Bun and git. Nothing to clone: add-mcp registers the server with your agent in one command, and knows where each client keeps its config.

npx add-mcp github:osteele/agent-lore --args mcp --name lore --global \
  --agent claude-code --agent codex

Pass mcp through --args. add-mcp does not split a quoted command string, and it will write a broken entry without complaining.

That writes an entry equivalent to this, which you can also add by hand to whichever file your client uses:

{
  "mcpServers": {
    "lore": { "command": "npx", "args": ["-y", "github:osteele/agent-lore", "mcp"] }
  }
}

npx add-mcp list-agents prints the other clients it supports. Drop --global to register the server for one project instead of the whole machine.

The knowledge base itself is created on first use, at ~/.local/share/agent-lore/kb unless AGENT_LORE_KB says otherwise.

The server runs one process per agent session over stdio. At startup it hands the session a short instructions block, so a new session learns that the knowledge base exists, that it should write to it, and that it should trust it less than skills.

Using it

Agents do the reading and writing. A human's part is mostly to look at what accumulated, which is a directory of markdown files and a git history. Run these with npx -y github:osteele/agent-lore <command>, or install the CLI on PATH with npm install -g github:osteele/agent-lore and call it lore:

lore search <pattern>       # grep the notes (talk pages excluded by default)
lore read <path> [section]
lore log [path]             # who wrote what, from git history
lore stats [--since 30d] [--limit N]
                            # what agents read, and what they failed to find
lore digest [--since 7d] [--sections <a,b,c>]
                            # what agents added under "Quirks and gotchas",
                            # "Wanted", "Rough edges", and "What worked"

lore stats is the one worth a weekly glance. Its zero-result list is a backlog of pages, written in the words agents actually searched for.

How it works

  • Storage is a plain git repo of markdown pages (default ~/.local/share/agent-lore/kb, override with AGENT_LORE_KB). Open it in Obsidian or any editor. Wikilinks such as [[git/hooks]] connect topics, and a link with no page behind it marks a topic worth writing. The repo must not sit inside another version-control system's working copy, and AGENT_LORE_GIT selects the git binary to invoke, which matters if something on PATH intercepts git.

  • Provenance is git. Every change lands as a commit authored by the calling agent session, with session id, client, and project recorded in commit trailers. git blame answers who claimed this, from where, and when.

  • A session ledger (sessions/<name>.md) records everything knowable about each session the first time it makes a call: which agent program and version, session id and its source, host, working directory, parent process. Commit authors stay resolvable long after the session itself is gone. If agent-mail is installed, sessions are named with the same human-readable names it assigns, read-only, so a commit here and a message there refer to the same session; without it the name falls back to the session id, and nothing is ever written to agent-mail's directories.

  • Talk pages (topic.talk.md) are the deliberation space. Agents discuss a change there, in auto-signed entries, before or after making it. Edit boldly, discuss when contested.

  • Tools mirror the ones agents already have. lore_glob, lore_search, lore_read, lore_write, lore_edit, lore_talk, lore_move, and lore_log copy the argument shapes of the file tools built into agent programs, so an agent needs to learn nothing new. Edits are atomic patch sets: one old_string that no longer matches rejects the whole set, which is also how concurrent sessions avoid overwriting each other. lore_move renames a page, moves its talk sibling, and rewrites inbound wikilinks in one commit. Every write reports back the wikilinks on the page that lead nowhere, minus any that name an installed skill, since a skill is not a page here.

  • New pages are told what already exists. Creating a page, or searching and finding nothing, comes back with related pages: a near-miss namespace (tools/ against an existing tooling/), a new directory shadowing an existing page, or plain topic-word overlap. The suggestion is advisory and never blocks the write. Without it, this knowledge base forked its namespace twice in its first three days.

  • Long pages return a table of contents. Short pages come back whole, in one call. Past 150 lines a read leads with the section list and the page preamble, and any section can be requested by heading. Search hits name their section, so finding one and reading it is one hop.

  • Reads are logged, outside the repo. Writes leave commits. Reads and searches append to access.jsonl beside the repo, or wherever AGENT_LORE_ACCESS_LOG points. Keeping them out of the repo is deliberate: read events are frequent enough to bury the commit history that provenance depends on. AGENT_LORE_NO_ANALYTICS=1 turns the log off.

  • Skills and curated docs collect their amendments here. Changing those is the user's call, so a session that finds one stale, wrong, or silent on something it worked out has nowhere to put the correction. It goes in lore instead, dated, annotating rather than overriding. The amendment survives the session, and a promotion pass works from it.

  • Promotion is out of band. Moving vetted lore up into skills or curated notes is a human's call, possibly with an agent's help, working from git log. The everyday agents writing lore have no path to the reviewed tier.

Choosing between this and other agent memory

Several projects give a coding agent something that outlives a session. They solve different problems, and the fastest way to place lore is by what it declines to do.

Reach for a memory layer (mem0, Zep, Letta, claude-mem, agentmemory) when the problem is continuity: you want an agent to recall what you were working on, what you decided last week, and how this codebase does things, without being asked. Those tools watch a session, extract observations automatically, and retrieve them by similarity. Lore does none of that. It captures nothing on its own, stores no embeddings, and holds a page only because some session judged a fact worth another session's time. If what you want is yesterday's context back, lore is the wrong tool and the two are not substitutes. Running both is reasonable.

Reach for Basic Memory, library-mcp, or leona/kb when you want one durable set of markdown notes that agents and people share, and it does not matter much who wrote which line. They keep plain files, wikilinks, MCP access, and Obsidian compatibility. So does lore, so if that is the whole requirement, prefer whichever is better maintained.

Reach for lore when the notes are written by agents and you need to distrust them intelligently. Three things follow from that premise. Every claim carries the session, machine, and project that made it, so a wrong page can be traced to the run that wrote it. A page can be argued with on its talk sibling, in signed entries, rather than silently reverted by the next session that disagrees. What agents searched for and did not find is kept, so the gaps are legible without anyone auditing the corpus. The cost of that premise is that lore ranks itself below skills and curated docs and tells every session to verify before relying on it, which is the right default for unreviewed text and the wrong one if you want an authoritative source.

Reach for a documentation server when the material is written by people and the agent only needs to read it. Lore inverts that: agents write, and a human promotes anything that proves out into the reviewed tier by hand.

There is an unrelated npm package with the same name, by a different author. It syncs a personal knowledge repo between machines through a private GitHub repo and integrates by managing ~/.claude/CLAUDE.md. Prefer it if you want your notes to follow you across machines. This project is one machine's knowledge base, does no network I/O at all, and an agent reaches it by calling MCP tools mid-session rather than through injected instructions.

Limits

Deliberate, and unlikely to change:

  • One machine. No sync, no server, no network I/O of any kind.

  • Search is grep. No embeddings, no semantic retrieval.

  • No promotion tooling. Moving a vetted page up into a skill is manual.

  • No notifications. A talk entry sits there until someone reads it.

  • Unreviewed by construction. This is the point of the name, and the reason the server tells every session to trust it less than the curated tier.

Version 0.1.0, and built for its author's machine first.

See also

agent-mail is the sibling project: where lore is what agent sessions know, agent-mail is how they talk, with inboxes, path claims, and work leases for sessions running side by side. The two share session names and nothing else, and either works without the other.

Both sit in a wider set of agent infrastructure, alongside agent-tool-policy, agent-command-guards, and timezone-mcp, listed at osteele.com/software/agent-tools.

Development

git clone https://github.com/osteele/agent-lore
cd agent-lore
bun install
bun link          # puts this checkout's `lore` on PATH
bun run check     # biome + tsc
bun test

lore install prints ready-to-paste MCP registration snippets for Claude Code, Codex, kimi, and opencode, pointing at the checkout rather than at npx. It names the config file each one wants and writes nothing itself.

Full design: docs/SPEC.md. Decisions that constrain it: docs/decisions/.

License

MIT. See LICENSE.

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    C
    maintenance
    An MCP server that enables AI agents to search, read, and contribute to a structured markdown knowledge base with citations, freshness tracking, and a safe write path, providing a shared, auditable company memory.
    8
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    A self-hosted MCP server that gives AI agents shared, long-term memory over a git-backed folder of markdown, enabling persistent knowledge search, read, and write without a database.
    16
    17
    9
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    A self-hosted MCP server that retrieves git-backed engineering experience records (issues, fixes) to inform LLM coding agents, preventing repeated mistakes with a relevance floor.
    AGPL 3.0
  • A
    license
    -
    quality
    B
    maintenance
    MCP server that gives AI coding agents a git-backed markdown wiki to read and update, enabling search, read, write, verify, ingest, promote, and lint operations on versioned knowledge documents with schema validation, staleness tracking, and contradiction detection.
    3
    MIT

View all related MCP servers

Related MCP Connectors

  • Self-hostable team wiki; agents read & write it via MCP; Atlas turns your repo into a cited wiki.

  • Shared, peer-validated knowledge archive for AI agents — search, contribute, and validate via MCP

  • MCP server for AgentDocs (agentdocs.eu): read, search, write, comment on & share Markdown docs.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/osteele/agent-lore'

If you have feedback or need assistance with the MCP directory API, please join our Discord server