Skip to content

feat(memory): per-agent memory isolation and context retrieval#4511

Closed
herjarsa wants to merge 12 commits into
code-yeongyu:devfrom
herjarsa:feat/per-agent-memory-3775
Closed

feat(memory): per-agent memory isolation and context retrieval#4511
herjarsa wants to merge 12 commits into
code-yeongyu:devfrom
herjarsa:feat/per-agent-memory-3775

Conversation

@herjarsa

@herjarsa herjarsa commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Isolated memory spaces per agent type with cross-session context retrieval.

Features

  • Per-agent memory namespaces (sisyphus, oracle, hephaestus, etc.)
  • Cross-session context retrieval
  • Memory persistence with bun:sqlite
  • Automatic context injection per agent role

Summary by cubic

Adds per‑agent persistent semantic memory with cross‑session retrieval and automatic context capture/injection. Includes a memory CLI, moves code to src/features/semantic-memory/, updates the lockfile to 4.5.1, and fixes a workspace config typo to unblock CI; fulfills #3775.

  • New Features

    • Isolated per‑agent memory with 1.5x agent‑specific ranking boost.
    • SQLite persistence via bun:sqlite, simple TF‑hash embeddings, and cosine similarity search.
    • Automatic capture/injection for primary agents via memory-context-injector and tool hooks.
    • CLI: search, recent (hours), store, delete, stats, clear; filters by agent/type/importance; optional JSON output.
    • Stats API (totals by type/agent, avg importance) and tests.
  • Migration

    • Enable the memory-context-injector hook in config to auto‑capture context.
    • Requires Bun; optional SEMANTIC_MEMORY_DB_PATH to set the DB location.

Written for commit 358d1be. Summary will update on new commits. Review in cubic

herjarsa added 7 commits May 24, 2026 11:37
- Create @oh-my-opencode/semantic-memory package with SQLite storage
- Implement simple embedding generation using term frequency hashing
- Add cosine similarity search for semantic memory retrieval
- Create memory-context-injector hook for automatic memory storage
- Add 'omo memory' CLI with search, recent, store, delete, stats, clear commands
- Support memory types: context, decision, error, pattern, insight
- Include comprehensive test suite (13 tests)

Closes code-yeongyu#2
…errors

- Remove packages/semantic-memory package
- Move implementation to src/features/semantic-memory/
- Update imports to use relative paths
- Fix type errors by removing non-existent type imports
- Update CLI command to import from local feature
Feature code-yeongyu#3775: Per-agent persistent memory system.

- agent-memory.ts with retrieveAgentMemories (weighted scoring) and storeAgentMemory
- AgentMemoryContextHook for tool.execute.before/after per-agent context injection
- Weighted agent scoring: agent-specific memories get 1.5x boost
- Automatic memory classification (decision/error/pattern/insight/context)
- Based on existing semantic-memory system (supports agentName field)

Closes code-yeongyu#3775
@herjarsa herjarsa closed this May 26, 2026
@herjarsa herjarsa reopened this May 26, 2026
@herjarsa

herjarsa commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #4404 (per-agent memory, clean version)

@herjarsa herjarsa closed this Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant