Registry / ai-ml / pi-hermes-memory

pi-hermes-memory

JSON →
library0.7.15jsnpmunverified

A persistent memory, session search, and secret scanning extension for Pi agents. Version 0.7.15 adds auto-migration of legacy data. Released regularly (multiple releases in 2025). Maintains agent facts, preferences, corrections, and procedural skills across sessions using SQLite FTS5 full-text search and markdown storage. Distinguishes itself by background learning every 10 turns, auto-consolidation, two-tier (global+project) memory, and built-in secret scanning to prevent API keys/tokens from being saved. Ported from the Hermes agent framework, with 368 tests.

npm install pi-hermes-memory
INSTALL
IMPORT
SIG · PI-HERMES-MEMORY
P
pi-hermes-memory
ai-mljavascriptv0.7.15
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HermesMemory
import { HermesMemory } from 'pi-hermes-memory'
const HermesMemory = require('pi-hermes-memory')
ESM-only package since v0.7.0
MemoryManager
import { MemoryManager } from 'pi-hermes-memory'
import MemoryManager from 'pi-hermes-memory'
Not a default export; use named import
MemoryScanner
import { MemoryScanner } from 'pi-hermes-memory'
import { Scanner } from 'pi-hermes-memory'
Exported as MemoryScanner, not Scanner
createMemoryStore
import { createMemoryStore } from 'pi-hermes-memory'
Utility function for creating an in-memory store (for testing)

Initializes memory, saves a fact, searches using SQLite FTS5, and triggers background learning.

import { HermesMemory, MemoryManager } from 'pi-hermes-memory'; const memory = new HermesMemory({ dbPath: './memory.db', secrets: { scanEnabled: true, blockedPatterns: ['sk-[a-zA-Z0-9]+', 'ghp_[a-zA-Z0-9]+'] } }); const manager = new MemoryManager(memory); // Save a fact await manager.saveMemory({ type: 'fact', content: 'User prefers dark mode', category: 'preference', tags: ['ui', 'theme'] }); // Search past conversations const results = await memory.search('dark mode', { limit: 5 }); console.log(results.map(r => r.content)); // Background learning: call every 10 turns await manager.learnFromTurn({ messages: [{ role: 'user', content: 'Set dark mode please' }] }); // Index past sessions (one-time CLI command shown in README) // CLI: /memory-index-sessions
Debug
Known issues
breakingLegacy extension root migration from ~/.pi/agent/memory to ~/.pi/agent/pi-hermes-memory
fix
Upgrade to v0.7.10+ and launch Pi once to auto-migrate. No manual action needed.
affects: <0.7.10
breakingLegacy flat skills directory migration: skills/*.md moved to skills/<slug>/SKILL.md
fix
Upgrade to v0.7.10+ and launch Pi once to auto-migrate. Fixes skill index conflicts.
affects: <0.7.10
deprecatedOld memory search API (searchMemories) renamed to search in v0.7.0
fix
Use memory.search() instead of memory.searchMemories()
affects: >=0.7.0
gotchaSecret scanning blocks saving API keys; ensure secrets are not stored unintentionally
fix
Configure blockedPatterns or disable secret scanning if needed (not recommended).
affects: >=0.1.0
gotchaMemory auto-consolidation merges entries when full; data loss if consolidation fails (rare, but possible)
fix
Monitor consolidation logs. Backup memory.db regularly.
affects: >=0.1.0
gotchaESM-only package; CommonJS require() will fail
fix
Use import syntax or set type: 'module' in package.json.
affects: >=0.7.0
Errors
Common errors & fixes
Error: name "..." does not match parent directory "skills"
Legacy flat skills directory structure incompatible with Pi's skill index
fix
Upgrade to v0.7.10+ and run Pi to auto-migrate skills to nested structure.
TypeError: memory.searchMemories is not a function
API renamed in v0.7.0; using old method name
fix
Use memory.search() instead of memory.searchMemories().
Cannot find module 'pi-hermes-memory'
Package not installed or wrong import path
fix
Run 'pi install npm:pi-hermes-memory' inside the Pi agent environment.
Error: Secret scan blocked write: token detected
Attempted to save an API key or token that matched blocked patterns
fix
Remove the secret from the memory content, or configure blockedPatterns to allow it (if intentional).
Upgrade
Version history
0.7.15latest on npm
Audit
Dependencies
@earendil-works/pi-coding-agentrequiredPeer dependency required for Pi extension API
Agent activity
19 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
pi-hermes-memory — npm install pi-hermes-memory · libregistry