crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

Feature request: Mimir as persistent cross-session memory backend (refs #6050, #6159)

Open tcconnally opened this issue 5 months ago • 9 comments

Summary

Proposal: add Mimir as a memory backend for CrewAI, addressing feature request #6050 ("persistent cross-session memory via Agent Magnet").

What Mimir brings to CrewAI

Mimir is an open-source (MIT) persistent memory engine with 23 MCP tools. It's a single Rust binary (~8MB) with embedded SQLite — no Docker, Postgres, or cloud dependencies.

Key capabilities relevant to CrewAI:

  • Cross-session persistence: agents remember across crew kickoffs, not just within a flow
  • Hybrid search: BM25 (FTS5) + dense embeddings + RRF fusion for accurate recall
  • Confidence decay: memories naturally decay unless reinforced
  • Encryption: AES-256-GCM at rest for production deployments
  • MCP-native: 23 tools accessible directly from CrewAI agents via MCP

Integration path

CrewAI has a memory abstraction in src/crewai/memory/. A Mimir backend would:

  1. Implement the memory storage interface (like the existing Qdrant/Chroma backends)
  2. Provide remember(), recall(), search() via Mimir's MCP tools or Python client
  3. Enable cross-crew and cross-session memory by scoping on app_name/user_id

Why this helps CrewAI

  • #6050 explicitly asks for persistent cross-session memory — Mimir is purpose-built for this
  • #6159 asks for behavioral memory (capturing agent action patterns) — Mimir's confidence decay and entity categorization are designed for exactly this
  • #5057 flags memory prompt injection — Mimir's encryption and structured entity types prevent injection surfaces
  • No cloud lock-in — runs alongside CrewAI locally

Happy to contribute a PR implementing the integration.

tcconnally avatar Jun 15 '26 19:06 tcconnally

From building agent memory infrastructure, a few things matter more than the specific storage engine: cross-agent isolation (each agent needs its own memory space but may need shared namespaces for coordination), decay-weighted importance scoring (without it, old irrelevant context crowds out useful recent information), and hybrid retrieval combining keyword and semantic search. We settled on BM25 + vector similarity fusion, which consistently outperforms either alone in our LoCoMo benchmarks across 1,540 conversational queries. The persistent cross-session requirement is the right call — agents that forget between crew kickoffs are fundamentally limited. Our full deploy stack runs as a single binary with Docker: https://github.com/dakera-ai/dakera-deploy/blob/main/docker/docker-compose.yml

ferhimedamine avatar Jun 15 '26 21:06 ferhimedamine

Hey team! I would love to work on this feature request and implement the Mimir integration for the unified memory system. Please assign this issue to me!

Jacopos311 avatar Jun 17 '26 22:06 Jacopos311

@Jacopos311 that's great — thanks for offering to pick this up! A couple of pointers so you don't start from zero:

  • There's already a published adapter, crewai-mimir (pip install crewai-mimir), that wraps Mimir as a CrewAI storage backend via the MCP tools. It's a solid starting point / reference for the storage-interface wiring — happy to hand off context on it.
  • Canonical repo is Perseus-Computing-LLC/mimir (the tcconnally/mimir link and "23 tools" in the issue body are stale — current is 43 MCP tools, v2.7.0).

The most useful next step is probably aligning with the maintainers on whether this lands as a first-party backend in src/crewai/memory/ or stays an external package, since that shapes the interface. I'm glad to review PRs, answer Mimir-side questions, or pair on the integration.

@ferhimedamine — agreed on decay-weighted scoring + BM25/vector fusion; Mimir does exactly that (FTS5 + dense embeddings + RRF), so it should slot into those requirements well.

tcconnally avatar Jun 29 '26 19:06 tcconnally

Okay, thanks!

Jacopos311 avatar Jun 30 '26 09:06 Jacopos311

For CrewAI, I’d make the memory backend contract explicit around scope and authority.

A crew can have several memory lanes:

agent_private_memory = local observations / tool history
crew_memory          = shared working knowledge for one crew
project_memory       = durable decisions and constraints
user_memory          = cross-project preferences, carefully promoted

Those should not all be recalled or written the same way.

Given the prompt-injection concerns in #5057, I’d also avoid treating recalled memory as instruction by default. A memory record should carry metadata like:

memory_type: observation | inference | verified_fact | decision | directive
source: tool | user | agent | file | external
status: candidate | accepted | superseded | rejected
last_confirmed_at

Then CrewAI can render memory as prior context, evidence, or constraint depending on type and status.

The important distinction is:

persistent memory != durable authority

I’ve been exploring a similar Personal AI OS / Memory Vault pattern: raw traces and agent observations are useful, but durable memory needs scope, provenance, and promotion rules.

Refs:

  • https://github.com/hegu-1/personal-memory-vault-starter
  • https://github.com/hegu-1/personal-ai-os

hegu-1 avatar Jul 03 '26 09:07 hegu-1

Reliability note

Production automation failures usually reduce to a contract issue before a model/prompt issue:

  1. Success criteria — durable artifact id (message/booking/row), not only node green
  2. Side-effect before complete — never blind-retry without an idempotency key on the business object
  3. Tool vs path split — external action can succeed while the node/agent path still errors (silent-green / false-red)

If you have one failing execution + expected vs actual, reply with stack/version and I will send a free root-cause checklist.

IgorGanapolsky avatar Jul 23 '26 01:07 IgorGanapolsky

Saw the proposal for Mimir as a persistent backend for CrewAI. I have experience building pluggable, high-performance memory layers.

Me333-jjj avatar Aug 02 '26 19:08 Me333-jjj

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Sep 02 '26 12:09 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Sep 08 '26 12:09 github-actions[bot]