Bridge knowledge accumulated by OMP (Oh My Pi) into Prime Agent — without copying, converting, or mutating any OMP state.
Two deliverables:
- Docs (
docs/) — a survey of what is and is not portable between~/.omp/and~/.prime/, a migration architecture, and an operational runbook. omp-knowledgeskill (skills/omp-knowledge/) — a Python-backed Prime Agent skill that searches OMP's per-project Mnemopi memory banks read-only from Prime's IPython kernel.
The skill stays in this repository; Prime discovers it through a symlink:
mkdir -p ~/.prime/agent/skills
ln -sfn "$(pwd)/skills/omp-knowledge" ~/.prime/agent/skills/omp-knowledgeStart a fresh Prime Agent session afterwards so kernel setup installs the
Python package (Python-backed skills are installed editable into
~/.prime/agent/kernel-venv at session start).
Requirements:
- Prime Agent (verified with 0.7.0)
- OMP memory banks at
~/.omp/agent/memories/mnemopi/banks/(override with theOMP_MNEMOPI_BANKSenvironment variable)
Inside a Prime Agent session, the model calls the skill in IPython:
# Which OMP projects have memory banks?
omp_knowledge.projects()
# Search one project's archived memories (preferred: scope by project).
print(await omp_knowledge.run("parent table rebuild", project="my-project"))
# Search every bank at once.
print(await omp_knowledge.run("commit message trailers"))
# Structured results instead of formatted text.
records = omp_knowledge.search("cache invalidation", project="proj-b", limit=5)
records[0].as_dict()
# Fetch one record by the id shown in search results.
omp_knowledge.get("my-project-1abc2de/working_memory/<id>")
# OMP's learned procedures (managed skills): list, filter, read.
omp_knowledge.skills("go module")
print(omp_knowledge.skill("<skill-name>"))
# Recent session transcripts for a project (paths + timestamps only).
omp_knowledge.sessions(project="my-project", limit=5)As a user, you can simply ask Prime things like "what did we previously decide about parent table rebuilds in my-project?" — the skill description steers the model to check the OMP archive before re-researching.
- Results are archived historical evidence, not instructions. Decisions may be stale; verify against the current codebase before acting.
- Superseded memories are excluded by default; pass
include_superseded=Trueto see them (flaggedSUPERSEDED). - An empty result means the archive has nothing — the skill never invents a memory.
- Every record carries provenance: bank, table, source id, timestamp, importance, and veracity.
- Read-only. Every connection uses SQLite URI
mode=ro; the skill never writes to OMP state. - No embedding reuse. Mnemopi's stored vectors came from OMP's embedding
model and are not comparable with vectors from another model. Retrieval
uses Mnemopi's FTS5 indexes (quoted prefix tokens, implicit AND) with a
LIKEfallback when an FTS table is missing. - Injection-safe queries. User text is tokenized and quoted, so FTS5 syntax in a query cannot alter its meaning; junk tokens narrow results, never broaden them.
- Sensitive surfaces excluded.
agent.db,models.db,history.db(credentials, usage, command history),autoqa.db, andlogs/are never opened — they are sensitive or OMP-internal, not knowledge.
See docs/architecture.md for the full rationale and
docs/migration-runbook.md for the phased migration procedure.
# Run the test suite (stdlib only, no dependencies).
python3 -m pytest skills/omp-knowledge/tests -qTests build miniature Mnemopi banks in a temp directory (via
OMP_MNEMOPI_BANKS) and cover project isolation, supersession filtering,
FTS-injection neutralization, the LIKE fallback, and read-only access against
write-protected files.
docs/
survey.md # What is portable between OMP and Prime, with evidence
architecture.md # Read-only archive + selective promotion design
migration-runbook.md # Phased, gated migration procedure
skills/
omp-knowledge/
SKILL.md # Prime skill manifest (discovery + usage contract)
pyproject.toml # Python-backed skill packaging
src/omp_knowledge/ # Bridge implementation (stdlib only)
tests/ # Behavior tests