Runtime UX truth: SSOT OmpKeep blueprint ยท Extension UX Contract. This page owns memory-system depth; SSOT owns the live extension surface.
1. ๐ Quick Start
OmpKeep exposes one human entry command: /ok. Bare /ok opens a compact status-first menu; /ok <route> is the scriptable fast path. Low-level tools remain model-facing, not slash-command clutter.
/ok route | Action | Key options |
|---|---|---|
doctor ยท diagnostics | Health, integrity, and secret-safety checks | diagnostics --save |
graph ยท timeline ยท procedures | Read-only relationships and history | timeline --memory <id> --save |
inbox ยท learnings ยท curate ยท patches | Review candidates and patches | curate --mode=propose|auto |
maintain ยท consolidate ยท meta ยท render | Governed maintenance | maintain --report |
handoff | Snapshot state for continuation | --goal <text> |
session-sync ยท session-reindex ยท session-search | Session intelligence | --yes for writes non-interactively |
Mutating routes confirm in the TUI and require --yes when no interactive confirmation is possible.
2. ๐ง Directory Layout
Persistent data is stored by priority:
OMP_MEMORY_ROOTenvironment variableOMPKEEP_ROOTenvironment variablePI_MEMORY_ROOTenvironment variable- Legacy directory
~/.pi/agent/pi-memory/(if it exists) - Default directory
~/.omp/agent/omp-memory/
Local settings overrides cascades in settings.json:
{cwd}/.omp/settings.jsonlooking for"ompkeep".localPathor"omp".localPath(with subfolder/omp-memory){cwd}/.pi/settings.jsonlooking for"pi-persistent-intelligence".localPathor"pi-pi".localPath(with subfolder/pi-memory)
~/.omp/agent/omp-memory/ (or legacy ~/.pi/agent/pi-memory/)
โโโ memory/
โ โโโ L1.identity.jsonl # Core identity records (Human ratification only)
โ โโโ L2.playbooks.jsonl # Working workflow records (Auto-curated or manual)
โ โโโ evidence.jsonl # Trust/provenance records with bounded excerpts
โ โโโ tombstones.jsonl # Delete markers preventing record re-creation
โ โโโ reinforcement.jsonl # Outcome logs used for stability adjustments
โ โโโ inquiries.jsonl # Open questions triggered by context matching
โโโ daily/ # Daily logs matching YYYY-MM-DD.md
โโโ inbox/ # Captured candidate records before curation
โ โโโ captured.jsonl # Bounded candidate writes
โโโ patches/ # Pending patch files containing memory changes
โโโ search/ # FTS5 search index
โโโ config.json # Configuration3. ๐ฆ Hook Registration
OmpKeep hooks directly into the OMP lifecycle events.
export interface OmpExtensionAPI {
on(
event: "session_start" | "before_agent_start" | "agent_end" | "session_shutdown",
handler: (event: any, ctx: any) => Promise<any> | any,
): void
registerTool(def: {
name: string
label: string
description: string
parameters: unknown
execute(id: string, params: any): any
}): void
registerCommand(
name: string,
def: { description: string; handler(args: string, ctx: any): void },
): void
}Hook Pipeline Details
session_start: Resolves the project profile context, synchronizes FTS5 indices, and parses/exports Markdown session summaries.before_agent_start: Evaluates pending inbox candidates, launches the inbox overlay TUI, and injects context blocks into the agent turn.agent_end: Scans user turns for corrections/Guidance patterns and populates local user/assistant turn buffers.session_shutdown: Runs LLM consolidation (Claude Haiku-powered candidate extraction) and triggers auto-curation patches.
4. ๐ก Injection Pipeline
Context retrieval uses a tiered, budget-bounded assembly pipeline.
[User Prompt] โโ> [FTS5 + Semantic Vector Search] โโ> [Scope Filter] โโ> [Negative Filter] โโ> [Budget Assembly]- Relevance Selection: Retrieves top
maxRecordscandidates using hybrid SQLite FTS5 index andqmdvector search. - Profile Scope: Excludes records belonging to other repository profiles or hashes.
- Basic Scope: Drops project-scoped records that do not match the current working directory.
- Negative Scope: Removes records whose
does_not_apply_whenorknown_exceptionsmatch terms in the current prompt. - Context Compaction: Assembles the selected statements under category prefixes (
โ ๏ธ AVOID:,โ PREFER:,๐ CONVENTION:) into a compact Markdown injection block.
5. ๐จ Gotchas & Safety
- ๐จ Precedence: Programmatic settings in
config.jsonoverride runtime defaults; L1 records never auto-apply. - ๐จ Secret Blocking: Candidates matching secret-like regex signatures are blocked immediately before serialization.
- ๐จ Memory Leak: Watchers and polling timers must be fully cleared in
session_shutdownto avoid process leaks. - ๐จ Nginx Rule: Any static Markdown representation (
MEMORY.md) is a projection; JSONL files remain the sole source of truth.
6. ๐ Curation Rules
Curation requires deterministic validation before mutating memory.
- Tombstone Check: Candidates attempting to recreate a tombstoned record ID must be rejected.
- Provenance Check: Candidate text must share at least 35% overlap coverage (matched statement tokens divided by total statement tokens) with its supporting evidence.
- Poisoning Gate: Auto-curation is blocked if a candidate is sourced from repository text or third-party documentation.
- Decay Cycle: Overdue playbooks lose confidence (0.05 for
stable, 0.15 forsemi-stable) on each maintenance loop.