Skip to content

feat: add MimirMemoryService + Perseus live context sample#6169

Closed
tcconnally wants to merge 4 commits into
google:mainfrom
Perseus-Computing-LLC:feat/mimir-perseus-adk-integration
Closed

feat: add MimirMemoryService + Perseus live context sample#6169
tcconnally wants to merge 4 commits into
google:mainfrom
Perseus-Computing-LLC:feat/mimir-perseus-adk-integration

Conversation

@tcconnally

Copy link
Copy Markdown

Summary

Adds two integrations requested in #6131 and #6132:

1. MimirMemoryService — persistent cross-session memory

Implements BaseMemoryService backed by Mimir (MIT-licensed, 30 MCP tools, FTS5+dense hybrid search, optional AES-256-GCM encryption).

  • Talks to the mimir binary via JSON-RPC over stdin/stdout (MCP stdio transport)
  • Implements: add_session_to_memory, add_events_to_memory, add_memory, search_memory
  • Thread-safe with subprocess isolation
  • Graceful fallback when mimir binary is not found
  • No cloud dependencies — fully local SQLite backend

Compared to existing backends:

Backend Dependencies Encryption Hybrid Search Local
InMemoryMemoryService None
VertexAiMemoryBankService GCP + Gemini Gemini-driven
VertexAiRagMemoryService GCP + RAG GCP vector
MimirMemoryService None (single binary) ✅ AES-256 ✅ BM25+FTS5+Dense

2. Perseus live context sample

Demonstrates using Perseus (MIT-licensed live context engine) to give ADK agents real-time workspace awareness via before_agent_callback.

  • Resolves directives (@file, @search, @memory) at inference time
  • Injects resolved context into the agent's instruction template
  • No hardcoded prompts — agent "knows" about workspace state dynamically

Testing

Closes: #6131, #6132

Adds a Mimir-backed memory service implementation that extends
BaseMemoryService.  Mimir (github.com/Perseus-Computing-LLC/mimir,
MIT-licensed) provides 30 MCP tools with FTS5+dense hybrid search and
optional AES-256-GCM encryption — no cloud dependencies.

- talks to the mimir binary via JSON-RPC over stdin/stdout (MCP stdio)
- implements add_session_to_memory, add_events_to_memory, add_memory,
  and search_memory
- thread-safe with subprocess isolation
- graceful fallback when mimir binary is not found

Also adds a Perseus live context sample under
contributing/samples/context_management/perseus_context/ demonstrating
workspace-aware agents via before_agent_callback + perseus-ctx.

Refs: google#6131, google#6132
@tcconnally tcconnally force-pushed the feat/mimir-perseus-adk-integration branch from 4d2f971 to 9bc71a3 Compare June 20, 2026 13:30
The Google header-check bot requires all new Python files to include
the Apache 2.0 license header, even empty __init__.py files.
@adk-bot adk-bot added the services [Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc label Jun 24, 2026
@rohityan rohityan self-assigned this Jun 24, 2026
@rohityan rohityan added the community repo [Community] FRs/issues well suited for google/adk-python-community repository label Jun 26, 2026
@rohityan

Copy link
Copy Markdown
Collaborator

Hi @tcconnally , Thank you for your contribution! We appreciate you taking the time to submit this pull request.
Closing this PR here as it belongs to adk-python-community repo.
We highly recommend releasing the feature as a standalone package that we will then share through: https://google.github.io/adk-docs/integrations/

@rohityan rohityan closed this Jun 26, 2026
tcconnally added a commit to Perseus-Computing-LLC/adk-mimir-memory that referenced this pull request Jun 26, 2026
- MimirMemoryService: persistent cross-session memory for Google ADK
- Backed by Mimir (MIT) — 30+ MCP tools, FTS5+dense hybrid search, AES-256-GCM
- Perseus context agent sample with before_agent_callback
- Zero cloud dependencies, fully local SQLite backend
- Apache-2.0 → MIT (standalone package, original implementation)

Closes google/adk-python#6131, google/adk-python#6132
See also: google/adk-python#6169 (closed — migrated to standalone)
@tcconnally

Copy link
Copy Markdown
Author

Thanks for the review @rohityan! Following your recommendation, I've released this as a standalone package:

📦 adk-mimir-memoryhttps://github.com/Perseus-Computing-LLC/adk-mimir-memory

pip install adk-mimir-memory

The package includes:

  • MimirMemoryService — drop-in persistent memory backend (AES-256-GCM, FTS5+dense hybrid search, zero cloud deps)
  • Perseus live context agent sample (from adk_mimir_memory.perseus_context import perseus_context_agent)

Next step: would love to get this listed on https://google.github.io/adk-docs/integrations/. Happy to follow whatever submission process is needed — let me know if there's a PR template or form for integration listings.

Also happy to submit a PR to adk-python-community if that's preferred over a standalone package. Let me know which path you'd recommend.

koverholt added a commit to google/adk-docs that referenced this pull request Jun 26, 2026
…y for ADK (#1877)

* feat(integrations): add Mimir Memory — persistent cross-session memory for ADK

Adds MimirMemoryService integration documentation:
- Persistent, local, encrypted memory backend for ADK agents
- AES-256-GCM encryption, FTS5+dense hybrid search
- Zero cloud dependencies — single Rust binary + SQLite
- Includes Perseus live context agent sample
- Backend comparison table vs InMemory, VertexAi, RAG

Package: https://github.com/Perseus-Computing-LLC/adk-mimir-memory
Refs: google/adk-python#6169

* Formatting edits

* Fix Mimir Memory code samples, install steps, and comparison table

* Fix unrelated link failure for Arize Phoenix

* Add link to PyPI package

---------

Co-authored-by: Kristopher Overholt <koverholt@google.com>
@rohityan

Copy link
Copy Markdown
Collaborator

Hi @tcconnally , You can find additional guidance at https://github.com/google/adk-docs/blob/main/CONTRIBUTING.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community repo [Community] FRs/issues well suited for google/adk-python-community repository services [Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Perseus context engine integration as ContextProvider

3 participants