Skip to main content

pagelore

CI PyPI version npm version Python versions License: PolyForm Noncommercial

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

PolyForm Noncommercial 1.0.0 — see LICENSE. Free for personal, research, educational and other noncommercial use. Commercial use — selling it, or building it into a paid product or service — needs a separate license: write to lionmause999@gmail.com.

Versions up to and including 0.7.0 were released under MIT and stay under MIT.

Metadata

Release files for pagelore 0.8.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 pagelore 0.8.3
File Size Uploaded
pagelore-0.8.3.tar.gz 214.2 kB Details

Built distribution (wheel)

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

Total release size: 325.6 kB

Release files / pagelore-0.8.3.tar.gz

Download URL pagelore-0.8.3.tar.gz
Size 214.2 kB
Tags Source
SHA-256 checksum
How to use checksums
53ddd2997fd54f51d2d49e16c1a03167814280964635e2a0a0da5465d78013c4
BLAKE2b-256 checksum
How to use checksums
8effea85db637fe6ecc7ca9dfdf9109fee6694e1f411e69578739f6de5698f08
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 28, 2026.

Transparency log

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

Download URL pagelore-0.8.3-py3-none-any.whl
Size 111.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd4489db7c4389b2c7aa06473bb18800978ff5cb955f3316b92faa7ad0161668
BLAKE2b-256 checksum
How to use checksums
c7dbebb4c4c0543da7a7d8e1d66d9baa605ab73b79ef1fcf6367f698a0365f73
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 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.8.3 This release

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

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