@zhafron/pi-memory

extensionmaintained

Memory management extension for pi coding agent

by · v1.0.2 · published 5mo ago

$ pi install npm:@zhafron/pi-memory
downloads/mo
0
stars
11
last push
5mo ago
open issues
0

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

2.0K downloads · last 12 weeks (weekly)

README

pi-memory

Memory management extension for pi coding agent.

Features

  • Long-term Memory: Store crucial facts, decisions, and preferences in MEMORY.md
  • Identity Management: Define AI persona in IDENTITY.md
  • User Profile: Store user context in USER.md
  • Daily Logging: Track day-to-day activities in daily/YYYY-MM-DD.md
  • Auto Context Injection: MEMORY.md, IDENTITY.md, USER.md automatically injected into system prompt
  • First Run Setup: Interactive bootstrap process for new installations
  • Cross-platform: Works on Windows, macOS, and Linux

Installation

pi install git:github.com/tickernelz/pi-memory

Or via npm:

pi install npm:@zhafron/pi-memory

Configuration

Add to ~/.pi/agent/settings.json:

{
  "pi-memory": {
    "memoryDir": "~/.pi/agent/memory",
    "dashboard": false
  }
}
SettingTypeDefaultDescription
memoryDirstring~/.pi/agent/memoryMemory directory location
dashboardbooleanfalseEnable dashboard widget

Memory Files

FilePurpose
MEMORY.mdLong-term memory (crucial facts, decisions, preferences)
IDENTITY.mdAI identity (name, persona, behavioral rules)
USER.mdUser profile (name, preferences, context)
daily/YYYY-MM-DD.mdDaily logs (day-to-day activities)
BOOTSTRAP.mdFirst run setup instructions (deleted after setup)

Tools

memory

Unified memory management tool.

Actions:

ActionDescriptionParameters
readRead memory filetarget: memory, identity, user, daily
writeWrite to memory filetarget: memory, identity, user, daily; content; mode: append/overwrite
searchSearch memory filesquery, max_results (optional)
listList all files-

Targets:

TargetFilePurpose
memoryMEMORY.mdLong-term memory (crucial facts, decisions, preferences)
identityIDENTITY.mdAI identity (name, persona, behavioral rules)
userUSER.mdUser profile (name, preferences, context)
dailydaily/YYYY-MM-DD.mdDaily logs (day-to-day activities)

Examples:

# Read memory files
memory --action read --target memory
memory --action read --target identity
memory --action read --target user
memory --action read --target daily --date 2026-02-18

# Write to memory files
memory --action write --target memory --content "Remember to use PostgreSQL for all projects"
memory --action write --target identity --content "- **Name**: Jarvis" --mode overwrite
memory --action write --target user --content "- **Location**: New York (EST)"
memory --action write --target daily --content "Fixed critical bug in auth module"

# Search and list
memory --action search --query "PostgreSQL"
memory --action list

First Run Flow

  1. Extension detects no MEMORY.md exists
  2. Creates BOOTSTRAP.md with setup instructions
  3. AI reads BOOTSTRAP.md and asks user questions interactively
  4. AI writes to MEMORY.md, IDENTITY.md, USER.md
  5. AI deletes BOOTSTRAP.md manually
  6. Setup complete

Context Injection

The following files are automatically injected into the system prompt at session start:

  • MEMORY.md — Long-term memory
  • IDENTITY.md — AI identity
  • USER.md — User profile

Daily logs are not auto-injected and must be accessed via the memory tool.

License

MIT