Skip to content

Repository files navigation

pi-memory-evolution

CI npm MIT

English · 简体中文

Persistent, evidence-aware memory for Pi. Keep useful preferences, project context and work progress across sessions—without repeatedly asking the assistant to remember them.

Memory learning, context injection and cross-session recall

Features

  • Learn and update automatically. Capture requirements, corrections and compaction summaries. Update tracked project states from tool observations, with provenance, history, gradual decay and evidence-aware ranking.
  • Inject relevant context. Select memories by the current topic and recent user context. Filter weak or stale matches; no relevant match means no unrelated filler.
  • Recall across sessions. Find background from another session or directory. A read-only memory_recall tool lets the assistant look up missing context mid-task.

Learning defaults to Pi's active model and existing authentication. Quota/rate limits or repeated failures can use an available model from another configured provider, without changing the foreground model. Fallback and budgets are configurable; no separate API key, embedding service or vector database is required.

Install

Requires Pi 0.85+ with a working model. npm-based Pi requires Node.js 22.19+.

pi install npm:pi-memory-evolution

Or install the Git default branch, with Git and npm available locally:

pi install https://github.com/btnalit/pi-memory-evolution

Choose one source, then run these commands inside Pi:

/reload
/memory status

SQLite ok (schema 7) confirms storage initialization. Continue using Pi normally; learning and recall run automatically.

Use

Describe your requirements in a conversation:

Our priorities for atlas-service are automatic backups and reliable recovery.

Later, in a fresh session sharing the same memory store:

What do you remember about atlas-service's priorities?

Learning is asynchronous and selective—not every message becomes a memory.

Command Purpose
/memory list Browse memories
/memory search <topic> Search relevant claims
/memory show <id> Inspect content and evidence
/memory learning Inspect capture and actual update results
/memory explain Explain the last automatic injection
/memory correct <id> <text> Correct a record
/memory forget <id> Suppress a record from recall

See the usage guide for all commands, migration and troubleshooting.

Update or uninstall

For the npm installation:

pi update npm:pi-memory-evolution
pi remove npm:pi-memory-evolution

For Git, substitute the repository URL used during installation. Reload or restart Pi afterward. Uninstalling does not delete memory data. Before a schema-changing upgrade, stop Pi processes sharing the database and back up the state directory.

Data and limits

Local SQLite state lives in ~/.pi/agent/agent-suite/memory-evolution/. PI_CODING_AGENT_DIR changes that prefix; different working directories share the same store by default.

Learning sends filtered source content to the active model, or an allowed fallback provider, and consumes that provider's quota. Cross-provider fallback is enabled by default; restrict its allowlist or disable it in recovery configuration. Memories are historical evidence, not independently verified facts. Matching and secret filtering are imperfect; verify important claims. See privacy and storage.

Development

npm ci --ignore-scripts
npm run check
npm run test:install
npm run test:pi
npm run build

CI checks types, regressions, package contents, installation and fake-model host integration. Builds produce an installable npm archive and checksums, not a separate compiled runtime. Release PRs automate versions and changelogs; merging a verified release PR triggers npm publication. Dependency updates arrive as gated PRs.

See testing and release automation.

Documentation

Usage · Architecture · Memory quality · Changelog

License

MIT

About

Persistent, evidence-aware memory for Pi. Keep useful preferences, project context and work progress across sessions—without repeatedly asking the assistant to remember them.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages