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          ~/.pagelore/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, ~/.pagelore/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.7.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.7.0
File Size Uploaded
pagelore-0.7.0.tar.gz 187.2 kB Details

Built distribution (wheel)

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

Total release size: 292.1 kB

Release files / pagelore-0.7.0.tar.gz

Download URL pagelore-0.7.0.tar.gz
Size 187.2 kB
Tags Source
SHA-256 checksum
How to use checksums
37e78286772ec243609c8fd1b5659c6d8dcc23c15fe01fea7fc94cec30847df3
BLAKE2b-256 checksum
How to use checksums
3806b6f627643954022166b46182c5340f8250b749349f8742fc4469c17e0a8f
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 27, 2026.

Transparency log

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

Download URL pagelore-0.7.0-py3-none-any.whl
Size 104.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05d0a51c556caeb464bc2f5cf58a95690372f6339862418d5932670b570d1a7d
BLAKE2b-256 checksum
How to use checksums
11f1f152a1de620268ab472eaf40961598956ff4eee8a2036a4bc1221f49d1c6
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 27, 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

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

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