{"_id":"@edmundmiller/pi-context-repo","name":"@edmundmiller/pi-context-repo","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.1":{"name":"@edmundmiller/pi-context-repo","version":"0.1.1","type":"module","description":"Git-backed persistent memory filesystem for pi agents, inspired by Letta Code's Context Repositories","main":"./index.ts","keywords":["pi","pi-extension","pi-package","memory","context-repository","agent-memory","git-memory"],"author":{"name":"Edmund Miller","email":"edmundmiller@hey.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/edmundmiller/dotfiles.git","directory":"packages/pi-context-repo"},"peerDependencies":{"@mariozechner/pi-coding-agent":"*"},"devDependencies":{"@sinclair/typebox":"^0.34.0","@types/bun":"^1.3.9","@types/node":"^22.0.0","typescript":"^5.0.0"},"pi":{"extensions":["./index.ts"]},"_id":"@edmundmiller/pi-context-repo@0.1.1","gitHead":"36ee91198779d95cceda4b850f6c9409f6a5003e","bugs":{"url":"https://github.com/edmundmiller/dotfiles/issues"},"homepage":"https://github.com/edmundmiller/dotfiles#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-iHYvnPsSuU0OiuD1nOgHLr211A6BkC75pjTomhH97Bap7TNwZGMrJztuCD0NLMYPa28WzhhrwDmcD2IknCf0KA==","shasum":"de8bd63a9f71eb8cc8be4c1ce59598693570ea98","tarball":"https://registry.npmjs.org/@edmundmiller/pi-context-repo/-/pi-context-repo-0.1.1.tgz","fileCount":3,"unpackedSize":62770,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCID9RflfaCaC5MM2dNYFWOLL6l55X1Od0Lv2lgi8rVYJFAiBEyUT+mw3a3WU+g+joUSPmZFUk1h+8SAIlfpEv/o7ZPA=="}]},"_npmUser":{"name":"emiller88","email":"edmund.a.miller@gmail.com"},"directories":{},"maintainers":[{"name":"emiller88","email":"edmund.a.miller@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-context-repo_0.1.1_1771908841330_0.9598357041253338"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-24T04:54:01.253Z","0.1.1":"2026-02-24T04:54:01.464Z","modified":"2026-02-24T04:54:01.644Z"},"maintainers":[{"name":"emiller88","email":"edmund.a.miller@gmail.com"}],"description":"Git-backed persistent memory filesystem for pi agents, inspired by Letta Code's Context Repositories","homepage":"https://github.com/edmundmiller/dotfiles#readme","keywords":["pi","pi-extension","pi-package","memory","context-repository","agent-memory","git-memory"],"repository":{"type":"git","url":"git+https://github.com/edmundmiller/dotfiles.git","directory":"packages/pi-context-repo"},"author":{"name":"Edmund Miller","email":"edmundmiller@hey.com"},"bugs":{"url":"https://github.com/edmundmiller/dotfiles/issues"},"license":"MIT","readme":"# pi-context-repo\n\nGit-backed persistent memory filesystem for [pi](https://github.com/mariozechner/pi-coding-agent) agents, inspired by [Letta Code's Context Repositories](https://www.letta.com/blog/context-repositories).\n\n## Install\n\n```bash\npi install /path/to/pi-context-repo\n# or after publishing:\npi install npm:pi-context-repo\n```\n\n## How it works\n\nMemory is stored as markdown files with YAML frontmatter in `.pi/memory/` (a separate git repo inside your project).\n\n- **`system/`** files are pinned to the system prompt every turn\n- **Other files** appear in the tree — the agent reads them on demand (progressive disclosure)\n- **Git versioning** tracks all memory changes with informative commits\n- **Frontmatter** enforces `description`, `limit`, and optional `read_only` per file\n\n- **`$MEMORY_DIR`** env var injected into shell so bash commands can reference memory\n\n### Scaffolded structure (auto-created on first run)\n\n```\n.pi/memory/\n├── system/\n│   ├── persona.md  — Agent identity and behavior\n│   ├── user.md     — User preferences and context\n│   ├── project.md  — Codebase knowledge and conventions\n│   └── style.md    — Coding preferences\n└── reference/\n    └── README.md   — How to use reference/\n```\n\n## Tools\n\n| Tool            | Description                                                    |\n| --------------- | -------------------------------------------------------------- |\n| `memory_write`  | Write/update a memory file (auto-stages, respects `read_only`) |\n| `memory_delete` | Delete a memory file and stage the removal                     |\n| `memory_commit` | Commit staged changes with a descriptive message               |\n| `memory_search` | Search memory files by content (`git grep`)                    |\n| `memory_log`    | Show recent commit history                                     |\n| `memory_backup` | Create a timestamped backup snapshot                           |\n\n## Commands\n\n| Command            | Description                           |\n| ------------------ | ------------------------------------- |\n| `/memory`          | Show tree, status, and recent history |\n| `/init`            | Initialize or re-analyze memory       |\n| `/remember [text]` | Explicitly save something to memory   |\n| `/memory-diff`     | Show uncommitted changes              |\n| `/memory-backup`   | Create a timestamped backup           |\n| `/memory-backups`  | List available backups                |\n| `/memory-restore`  | Restore from a backup                 |\n| `/memory-export`   | Export memory to a directory          |\n| `/memory-import`   | Import memory from another directory  |\n\n## UI\n\n- **Status widget** shows uncommitted/unpushed counts in pi footer\n- **Sync reminder** in system prompt when changes need committing/pushing\n- **Reflection reminder** every 15 turns prompting memory consolidation\n- **Drift detection** warns about legacy/orphan memory fragments in system prompt\n\n## Design\n\nAdapted from Letta Code's [memoryGit.ts](https://github.com/letta-ai/letta-code/blob/main/src/agent/memoryGit.ts) and [Context Repositories](https://docs.letta.com/letta-code/memory) concept:\n\n- Files as memory units with metadata frontmatter\n- `system/` subdir always loaded (like Letta's pinned memory blocks)\n- File tree always visible for on-demand loading\n- Git for versioning, history, and eventual multi-agent sync\n- Natural memory application — no \"I remember that...\" narration\n- Git worktree helpers for isolated background edits (reflection, migration)\n- System prompt drift detection and stripping\n- `$MEMORY_DIR` / `$PI_MEMORY_DIR` env vars for shell access\n","readmeFilename":"README.md","_rev":"1-0209f0ae96d6ea7e9e41c0b81afdebc0"}