Skip to main content

pagelore

CI PyPI version npm version Python versions License: MIT

Durable project memory for AI coding agents — Claude Code, Codex, Cursor, Gemini CLI. Decisions, contracts and bug post-mortems live as markdown pages in your repository, searched with BM25F from a command line or an MCP server, and every write is validated before it lands. No server, no database to run, no API key, no hooks; the runtime is the Python 3.9+ standard library.

Works with: Claude Code · Codex CLI · Cursor · Gemini CLI · anything that can run a shell command or an MCP stdio server.

Why

Agents re-derive the same context every session and confidently restate decisions that were reversed months ago. A memory store fixes that only if it is cheap to write, cheap to read, and survives switching tools. Plain markdown in git satisfies all three: the store is a .memory/ directory of .md files — greppable, diffable, reviewable in a pull request, readable by any agent or person.

  • Search that ranks. BM25F over title and body; a SQLite FTS5 index kept as a disposable cache outside the store, and an in-process ranker when the index cannot be used. Measured against grep, embeddings and the closest competitor.
  • Writes are refused, not requested. A page with no sources, a source that does not exist, or too little body is rejected with a FIX: line the agent acts on.
  • Reversals stay honest. --supersedes stamps the old page, halves its score and marks it ⚠ superseded by <slug> in every result.
  • One instruction line connects an agent. lore init writes it (or registers the MCP server) and lore doctor catches the setups that fail silently.

Install

pipx install pagelore && lore init && lore doctor     # or: npm install -g pagelore

lore init shows the exact change and asks before writing; its default connects nothing. lore doctor says what is connected and what is broken. Other routes (pip, uv, from source), upgrading and removal: installation.

Quick start

Connect Claude Code in this repository only, with the instruction file:

lore init --agent claude --scope project --yes

Your agent now searches before it answers and writes after meaningful work. The same commands by hand:

lore search "terminal freeze webgl context lost"     # ranked hits: slug — title — what matched
lore search --touching src/terminal/renderer.ts      # pages written against this file, first
lore show webgl-context-loss                         # one page, by the slug a search printed
lore write --slug webgl-context-loss --title "xterm WebGL context loss on display sleep" \
  --kind bug --source src/terminal/renderer.ts --body - <<'PMEOF'
## Cause

The WebGL renderer loses its context when the display sleeps; what a future
agent could not reconstruct from the code goes here.
PMEOF
lore list                                            # every page, newest first
lore stats                                           # writes, refusals, searches that found nothing

Or as MCP tools, memory_search and memory_write, in the agent's tool list:

lore init --agent claude --via mcp --scope project --yes   # writes .mcp.json

How it works

  agent (Claude Code, Codex, Cursor, Gemini CLI, …)
     │ reads one @-line or pasted block every turn          ~/.project-memory/AGENT.md
     │
     ├── lore search / show / write   (shell)  ─┐
     └── lore mcp  memory_search / memory_write ─┤  same functions, same gate
                                                 ▼
                          .memory/*.md   ← the source of truth, in your repo
                          FTS5 index     ← a cache in ~/.cache, rebuilt on demand

The instruction block lives in one file, ~/.project-memory/AGENT.md, refreshed by every lore command; each agent's configuration carries one line pointing at it, so an upgrade reaches every agent without editing anything. Measured on Claude Code: with the line the agent searched before answering 15 times out of 15, without it never.

Documentation

License

MIT — see LICENSE.

Metadata

Release files for pagelore 0.5.0

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

Source distribution (sdist)

Source distribution for pagelore 0.5.0
File Size Uploaded
pagelore-0.5.0.tar.gz 146.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pagelore 0.5.0
File Interpreter ABI Platform
pagelore-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 235.2 kB

Release files / pagelore-0.5.0.tar.gz

Download URL pagelore-0.5.0.tar.gz
Size 146.9 kB
Tags Source
SHA-256 checksum
How to use checksums
682b31037e015bd46f3415071c36dde4974b8fcea135f7e2bc76bf63a8cd7b18
BLAKE2b-256 checksum
How to use checksums
ce477fdbeb08608cea6669369e8302b6d2d98eb4d3fc71ec306e207553a91f77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pagelore-0.5.0-py3-none-any.whl

Download URL pagelore-0.5.0-py3-none-any.whl
Size 88.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
131ac69647402a2fdb79cdccd269248a92469525f51c4d213b6490da14310934
BLAKE2b-256 checksum
How to use checksums
f980833c3da9db4687fa2c29e2e33dde66847f6ed9d8c210a8bad74a6befbe71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

This release

0.5.0 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

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