chandra447/pi-hermes-memory

Hermes-style persistent memory and learning loop for Pi coding agent

What it solves

Pi Hermes Memory is an extension for the Pi agent that provides persistent memory across sessions. It prevents the agent from forgetting user preferences, project-specific facts, and lessons learned from failures, ensuring that the agent doesn't repeat the same mistakes and remembers how to solve problems over time.

How it works

The project implements a hybrid memory architecture using Markdown files for human-readable storage and a SQLite database for fast, full-text search (FTS5). It manages three primary types of knowledge:

  • Core Memory: Stores facts, preferences, and tool quirks in MEMORY.md and USER.md (capped at 5,000 characters each).
  • Skills: Procedural knowledge (how-to guides) stored as SKILL.md files, which are unlimited in size and discoverable by the agent.
  • Extended Store: A SQLite-backed mirror that allows the agent to search across all past conversations and extended memories using tools like session_search and memory_search.

To maintain this memory, the extension uses background learning (reviewing conversations every 10 turns or 15 tool calls), automatic correction detection (saving user corrections immediately), and a content scanner to block API keys and secrets from being persisted.

Who it’s for

Users of the Pi agent who want their AI assistant to maintain a long-term memory of their identity, their project conventions, and the processes they solve problems with, rather than starting every new session from scratch.

Highlights

  • Two-Tier Memory: Separate global and project-scoped memory for facts that apply everywhere versus those specific to a codebase.
  • Failure Memory: Specifically tracks what didn't work and why to prevent repeating errors.
  • Procedural Skills: Allows the agent to save step-by-step procedures as reusable documents.
  • Secret Scanning: Automatically blocks sensitive tokens and API keys from being saved to memory.
  • Session Search: Full-text search across all past conversation history via SQLite.
  • Standing Instructions: A dedicated, user-authored block of instructions that is injected into every session regardless of memory mode.
  • Auto-Consolidation: Automatically merges and cleans up memory entries when character limits are reached.

相關

  • 專案
  • 專案
  • 專案
  • 專案
  • 專案