engram-memory-protocol

Enforces save, search, and session-summary rules for Engram persistent memory tools.

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/jhannka/php-skills --skill engram-memory-protocol-jhannka
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: engram-memory-protocol
Source: https://github.com/jhannka/php-skills/tree/main/skills/memory-protocol
Command: npx skills add https://github.com/jhannka/php-skills --skill engram-memory-protocol-jhannka

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agents lose context between sessions, causing repeated mistakes and forgotten decisions. This Skill defines a strict discipline for when and how to persist decisions, bugfixes, and discoveries into Engram-style persistent memory so knowledge survives across sessions and compactions. ## Core Features & Use Cases - Save Rules: Triggers mem_save immediately after decisions, bugfixes, pattern discoveries, and preference changes, using structured What/Why/Where/Learned content and stable topic keys. - Search Rules: Mandates mem_context before mem_search on recall requests, and proactive mem_search before similar work or when a user references a project or problem. - Session Close Rules: Requires mem_session_summary with goal, discoveries, accomplishments, next steps, and relevant files before ending a session, plus a recovery procedure after compaction. - Use Case: After fixing a non-obvious production bug, the agent immediately saves the root cause and fix location to memory, then recalls it automatically weeks later when a similar bug report arrives. ## Quick Start Apply the Engram memory protocol so every decision, bugfix, and discovery in this session is saved and searchable in future sessions.

Frequently Asked Questions about engram-memory-protocol

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make an AI agent remember decisions across sessions?▼

Use a persistent memory protocol that calls mem_save immediately after every decision, bugfix, or discovery. Store structured content covering what, why, where, and what was learned, with a stable topic_key so evolving topics stay linked.

When should an agent search persistent memory before responding?▼

Search memory whenever the user references a project, feature, or problem in their first message, and proactively before starting work similar to past tasks. Run mem_context first for recall requests, then mem_search for broader queries.

What is the difference between mem_context and mem_search?▼

mem_context retrieves relevant memory for the current recall request and should be called first. mem_search performs a broader keyword-based search and is used after mem_context or proactively before similar work.

How do I preserve agent context after conversation compaction?▼

Before compaction or session end, call mem_session_summary including the goal, discoveries, accomplishments, next steps, and relevant files. After compaction, recover context from memory first, then continue the work.

Does this memory protocol work without Engram tools?▼

No, the protocol depends on Engram-style mem_save, mem_search, mem_context, and mem_session_summary tools being available to the agent. Without those memory tools, the rules cannot be executed as written.