← Catalog

@the-forge-flow/hippo-memory-pi

PI extension for biologically-inspired long-term memory, powered by hippo-memory

Extension

Install

Install with PiG

pig install npm:@the-forge-flow/hippo-memory-pi

Install with Pi

pi install npm:@the-forge-flow/hippo-memory-pi
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "skills": [
    "./dist/skills"
  ],
  "extensions": [
    "./dist/index.js"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.9 (README.md). PiG does not review it.

The Forge Flow - Hippo Memory Extension

Hippo Memory Extension

Biologically-inspired long-term memory for PI, powered by hippo-memory

CI Status npm version License


Features

  • Bio-inspired — decay by default, retrieval strengthens, sleep consolidation
  • Auto-inject — relevant memories surface in the system prompt on every turn
  • Auto-capture — errors become error-tagged memories automatically
  • Dual store — project-local + global, with promotion during sleep
  • Hybrid search — BM25 + embeddings (@huggingface/transformers)
  • PI-native — lifecycle hooks, 17 tff-memory_* tools, 6 slash commands, bundled skill

Requirements

  • Node.js >= 22.5.0 (required by hippo-memory's built-in node:sqlite)
  • PI (pi CLI) installed

Installation

# Global (all projects)
pi install npm:@the-forge-flow/hippo-memory-pi

# Project-local
pi install -l npm:@the-forge-flow/hippo-memory-pi

# From GitHub (tracks main)
pi install git:github.com/MonsieurBarti/hippo-memory-pi

# Pin a version
pi install npm:@the-forge-flow/hippo-memory-pi@0.1.0

Add .pi/ to your .gitignore. The extension stores the project-scoped SQLite database at .pi/hippo-memory/hippo.db and it should not be committed.

Then reload PI with /reload (or restart it).

How it works

After installation, hippo-memory-pi runs invisibly:

  1. On session start, it opens two SQLite stores — project-local at .pi/hippo-memory/hippo.db and global at ~/.pi/hippo-memory/hippo.db.
  2. Before every agent turn, it runs a hybrid search against your prompt and injects any matching memories into the system prompt under ## Prior observations.
  3. On every tool result, if an error is detected, it stores an error-tagged memory automatically.
  4. On agent end, it applies a reward signal (good/bad) to the memories that were recalled for that turn.
  5. On session shutdown, if at least 5 new memories accumulated, it runs hippo's consolidation pipeline: decay, merge overlapping episodics into semantic patterns, detect conflicts, auto-share high-transfer memories to global.

Tools

17 tools, all prefixed tff-memory_:

ToolPurpose
tff-memory_rememberStore an observation
tff-memory_recallSearch memory
tff-memory_contextAuto-recall, formatted for LLM
tff-memory_decideRecord an architectural decision (90-day half-life)
tff-memory_outcomeApply good/bad reward signal
tff-memory_pinPin (infinite half-life) or unpin
tff-memory_forgetHard delete
tff-memory_invalidateWeaken memories matching a pattern
tff-memory_conflictsList detected memory conflicts
tff-memory_resolveResolve a conflict
tff-memory_inspectFull details of one entry
tff-memory_sleepRun consolidation
tff-memory_statusStore statistics
tff-memory_wm_pushPush to bounded working memory
tff-memory_wm_readRead working memory
tff-memory_sharePromote to global store
tff-memory_learn_gitScan git for lesson candidates

Slash commands

  • /memory-status — dashboard
  • /memory-sleep [--dry-run] — run consolidation
  • /memory-conflicts — list detected conflicts
  • /memory-recall "<query>" — user-triggered search
  • /memory-inspect <id> — detail view
  • /toggle-hippo-memory — disable auto-inject for this session

Configuration

Configuration is resolved in order: env vars > hippo-memory.config.json at repo root > defaults.

Env varDefaultPurpose
HIPPO_MEMORY_AUTO_INJECTtrueAuto-inject context on every turn
HIPPO_MEMORY_AUTO_CAPTUREtrueAuto-capture errors from tool results
HIPPO_MEMORY_AUTO_OUTCOMEtrueApply outcome feedback on agent end
HIPPO_MEMORY_AUTO_SLEEPtrueRun consolidation on session shutdown
HIPPO_MEMORY_AUTO_LEARN_GITtrueScan git history on first session
HIPPO_MEMORY_AUTO_SHAREtruePromote to global during sleep
HIPPO_MEMORY_RECALL_BUDGET1500Token budget for auto-inject
HIPPO_MEMORY_RECALL_LIMIT5Max memories per recall
HIPPO_MEMORY_SLEEP_THRESHOLD5Min new memories to trigger auto-sleep
HIPPO_MEMORY_SEARCH_MODEhybridbm25 or hybrid
HIPPO_MEMORY_FRAMINGobserveobserve, suggest, or assert
HIPPO_PROJECT_ROOT.pi/hippo-memoryOverride project store location
HIPPO_GLOBAL_ROOT~/.pi/hippo-memoryOverride global store location
HIPPO_HOME—Alt name for global root override

Privacy note

Auto-inject sends recalled text from past sessions into your system prompt on every turn. Run /toggle-hippo-memory to disable per-session, or set HIPPO_MEMORY_AUTO_INJECT=false to disable globally.

Development

bun install
bun run test        # vitest
bun run lint        # biome check
bun run typecheck   # tsc --noEmit
bun run build       # tsc + copy skill to dist/

Project structure

src/
├── index.ts                  # Extension entry point & PI wire-up
├── hippo-memory-service.ts   # Facade over hippo-memory SDK
├── memory-service.ts         # MemoryService interface
├── config.ts                 # Configuration loading
├── paths.ts                  # Project/global root resolution
├── types.ts                  # Domain types
├── mutex.ts                  # Write serialization
├── context-injector.ts       # Format recall for system prompt
├── error-capture.ts          # Detect + debounce errors from tool results
├── success-detector.ts       # Classify agent_end as good/bad/ambiguous
├── session-state.ts          # Anchor ids + tool result ring buffer
├── hooks/                    # 5 lifecycle hooks
├── tools/                    # 17 tff-memory_* tools + types + index
├── commands/                 # 6 slash commands + types + index
└── skill/
    └── HIPPO_MEMORY.md       # PI skill (Roxabi compress notation)

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing)
  3. Commit with conventional commits (git commit -m "feat: add something")
  4. Push to the branch (git push origin feature/amazing)
  5. Open a Pull Request

License

MIT