pp-Echo treats long-term memory as Markdown-first governed context. Markdown files are the durable source of truth; Core Memory is the governance, preview, approval, audit, and trace layer over those files. Episodic Memory, File Memory, and Learning Memory remain separate cooperating layers.
Long-term facts land in human-readable Markdown:
global/MEMORY.mdfor global user preferences and notes.- workspace
MEMORY.mdfor project facts, decisions, workflows, and notes. - workspace
memory/**/*.mdfor detailed bug, lesson, workflow, and journal notes.
These files are injected by GlobalMemoryContextHook and
ProjectMemoryContextHook, which read the files each time context is
transformed. After approval writes Markdown, the next model turn can see the
new memory.
Core Memory manages candidate lifecycle and audit. It does not act as the default prompt fact source.
Each governed item is stored in SQLite with id, scope, section, type, content, provenance, confidence, status, timestamps, supersession history, optional expiry, and metadata. Active statuses are:
pending: proposed but not applied as durable Markdown memory.active: approved and, by default, applied to Markdown.rejected: blocked or declined.archived: retained for history but no longer active governance state.
Core Memory remains bounded for previews and debug reports. The SQLite
snapshot renderer still exists, but CoreMemoryContextHook is debug-only by
default and does not insert active SQLite memories into the prompt.
CoreMemoryService is the shared policy entry point for CLI, tools, runtime,
and Web/API routes. CoreMemoryStore owns the SQLite governance ledger. The
Markdown router and writer own fact-source patches.
Important service operations:
propose(candidate, source, reason)markdown_preview(memory_id)approve(memory_id, actor, apply_to_markdown=True, immediate_effect=True)markdown_apply(memory_id, actor, reason)reject(memory_id, actor, reason)archive(memory_id, actor, reason)replace(old_id, candidate, actor, reason)snapshot(workspace_id, session_id)for debug/governance onlysearch(query, scope, workspace_id)for governance recordsaudit(memory_id, limit)export_active_core_memories_to_markdown()
Every write path records audit metadata. Markdown apply records target path, heading, marker id, before/after content hashes, diff hash, and whether immediate effect was enabled.
The safe write path is:
- Extract or submit a candidate.
- Run safety scan.
- Run dedupe check.
- Run conflict detection.
- Store as
pending. - Preview the Markdown patch.
- User approves or rejects.
- Approval applies the Markdown patch by default.
- File Memory index refreshes when available.
- The next context transform reads the updated Markdown.
CLI commands:
pp-agent memory propose "Prefer concise engineering answers." --section user_profile --type preference
pp-agent memory pending
pp-agent memory approve <memory-id>
pp-agent memory reject <memory-id>
pp-agent memory archive <memory-id>
pp-agent memory replace <old-memory-id> "Use pytest for focused checks." --type workflow
pp-agent memory snapshot
pp-agent memory audit [memory-id]
pp-agent memory compact-preview
pp-agent memory compact-apply --reason "manual review"
pp-agent memory merge-preview
pp-agent memory merge-apply --reason "dedupe"
pp-agent memory provider-status
pp-agent memory export-to-markdownFile Memory indexes durable Markdown files such as MEMORY.md,
global/MEMORY.md, and memory/**/*.md for explicit search/read workflows.
memory_search finds relevant chunks and memory_get reads exact line ranges.
This retrieval layer is separate from Core Memory governance and does not
depend on memory.enable.
Episodic Memory is the conversation-history retrieval layer: chunks, keyword/vector/hybrid retrieval, BM25, embeddings, and reranking. It recalls prior conversation details only when relevant. Retrieved snippets remain separate from Markdown Memory and Core Memory governance.
The stable memory.enable config key controls this episodic/history layer. It
is not a global switch for Core Memory or File Memory.
Learning extracts candidate lessons and can write approved or auto-applied items into Markdown memory files. Explicit user memory should prefer the Core Memory proposal/approval path so safety, review, target preview, and audit are recorded before the fact is applied.
Learning-managed sections and Core-approved bullets can coexist in
MEMORY.md; Core-approved bullets use pp-memory:id=... markers for
idempotency.
MemoryProviderPlugin is reserved for additive providers such as Honcho or
Mem0-style plugins. The built-in Markdown files remain authoritative for
durable facts. Providers may prefetch context, sync turns, extract candidates,
mirror governance writes, and report status, but they do not replace Markdown
Memory.
The default provider is LocalMemoryProviderPlugin, a small SQLite mirror
stored at .pp-agent/core-memory-provider.db. It records mirrored governance
writes and turn sync metadata for audit/debugging.
The intended prompt context order is:
- System Instructions
- Global/Project Markdown Memory
- Workspace Context
- Retrieved Episodic Memory
- Attachment/File Memory Preview
- Current Conversation