pi-mem-cc
Automatic observer-based memory for pi — silently compresses every tool call into searchable structured observations, injects relevant past context at session start.
Package details
Install pi-mem-cc from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-mem-cc- Package
pi-mem-cc- Version
0.1.0- Published
- Jun 20, 2026
- Downloads
- not available
- Author
- victorchen04
- License
- Apache-2.0
- Types
- extension
- Size
- 52.8 KB
- Dependencies
- 1 dependency · 3 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-mem-cc
Automatic observer-based memory for pi coding agent.
Inspired by claude-mem for Claude Code, but built natively for pi's extension API. Silently watches every tool call, compresses it into a structured observation, stores it in SQLite, and re-injects relevant past context at session start.
What's different from pi-memory (jayzeng)?
pi-memory |
pi-mem-cc |
|
|---|---|---|
| Memory capture | Manual — agent/user calls memory_write |
Automatic — every tool call observed |
| Storage | Plain markdown files | SQLite + FTS5 |
| Search | Optional qmd (external dep) | Built-in hybrid (keyword + recency) |
| Injection | Agent must call memory_read |
Auto-injected at session start |
| Use case | Personal knowledge book | Cross-session continuity |
Use both. They cover different needs.
Install
pi install npm:pi-mem-cc
Then /reload.
Tools registered
| Tool | Purpose | Token cost |
|---|---|---|
mem_search |
Get compact index of matching observations | ~50-100 tok/result |
mem_timeline |
Get chronological context around an observation id | variable |
mem_get |
Fetch full observation details by IDs | ~500-1000 tok/each |
3-layer progressive disclosure — search first, timeline for context, get only for filtered IDs.
Storage
~/.pi/agent/memory/pi-mem-cc.db # SQLite (observations, summaries, FTS5)
How it works
- session_start → register session in DB
- before_agent_start → query top-K relevant past observations (recency × project match), append markdown to system prompt
- tool_result → fire-and-forget compress into
<observation>via observer LLM, write to DB - agent_end → fire-and-forget compress turn into
<summary>via observer LLM, write to DB
The observer LLM uses the same model as the active session — no extra API key needed.
Configuration
No configuration. Uses your active session model.
License
Apache-2.0