Skip to content

About

OMP plugin: Typesense-backed session memory with LLM fact extraction and a memorysearch tool

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

omp-memory

Session-memory plugin and search tool for Oh My Pi (OMP).

What it does

  • Capture — on agent_end, for every agent (chief and subagents), summarizes the full (capped) session transcript with an LLM into a handful of concrete reusable facts (or falls back to a raw transcript excerpt) and stores them in Typesense, tagged by project and file extension. Saves are idempotent per session id and are skipped entirely when there are no new messages since that session's last save — but when a save does run, it reprocesses the full cumulative transcript, not just the delta. Every 5th capture also rolls up recent facts into a cross-project "user profile" of developer preferences.
  • Dispatch tracking — wraps task tool calls, diffs the git working tree before/after, and upserts a summary of what a subagent dispatch changed.
  • Prompt injection — on before_agent_start, for every agent (chief and subagents), injects the most recent session-memory summaries for the current project and the accumulated user profile as system-prompt blocks (<session_memory>, <user_profile>).
  • memorysearch tool — lets the agent explicitly hybrid-search (keyword + vector) past session memory for the current project mid-task.

Facts are extracted and embedded via a local Typesense instance (bundled via the included docker-compose.yml), started automatically on session_start if it isn't already running.

Requirements

  • Docker (for the Typesense container; started automatically via docker compose)
  • The OMP host runtime, which provides @oh-my-pi/pi-ai and the plugin/tool APIs (pi.on, pi.zod, pi.exec, pi.cwd) at runtime — not a package dependency of this repo.

Environment variables

Variable Default Purpose
TYPESENSE_URL http://localhost:8108 Base URL of the Typesense instance
TYPESENSE_KEY omp-local-key Typesense API key (must match TYPESENSE_API_KEY in docker-compose.yml)

The defaults match the bundled docker-compose.yml for local development; override both for a shared/remote Typesense deployment.

Install

omp plugin install github:gyoz-ai/omp-memory

This runs bun install against ~/.omp/plugins, symlinks the package into node_modules, and validates that index.ts resolves and exports a plugin factory before enabling it. The tools/memorysearch.ts tool is registered from the same manifest.

Local development (symlink)

This repo's root doubles as the OMP extension directory, and tools/memorysearch.ts doubles as the OMP tool file. Symlink both into your OMP agent home:

ln -s "$(pwd)" ~/.omp/agent/extensions/memory
ln -s "$(pwd)/tools/memorysearch.ts" ~/.omp/agent/tools/memorysearch.ts

OMP live-reloads extensions and tools on file change, so no restart is required after installing.

Layout

index.ts            plugin entry point (session_start/before_agent_start/tool_call/tool_result/agent_end)
capture.ts           memory read/write logic (memoryBlocks, upsertDispatchSummary, captureSession)
extractor.ts         LLM fact-extraction helpers
lib/typesense.ts      Typesense client, schema, compose bootstrap
lib/git.ts             git diff/snapshot helpers
lib/code-files.ts      source-file filename matching
tools/memorysearch.ts  standalone memorysearch tool
docker-compose.yml    local Typesense container

lib/typesense.ts resolves docker-compose.yml relative to its own location (import.meta.url), so ensureTypesense finds and starts the right compose file no matter where this repo is checked out or symlinked from.

About

OMP plugin: Typesense-backed session memory with LLM fact extraction and a memorysearch tool

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages