Evaluate mnemo as a persistent memory/knowledge graph module for cf-core #63

Closed
opened 2026-06-03 18:22:53 -07:00 by pyr0ball · 1 comment
Owner

Summary

mnemo (https://github.com/zaydmulani09/mnemo) is a local-first LLM memory sidecar written in Rust. It extracts named entities and relationships from conversations, builds a persistent knowledge graph in SQLite, and injects relevant context back into future prompts in under 50ms. MIT license.

Architecture

  • Storage: SQLite with WAL mode (durable, survives restarts)
  • Graph: in-memory petgraph (rebuilt from SQLite on startup)
  • API: Axum REST API
  • SDK: Python pip package for easy integration with CF FastAPI backends
  • Deployment: single static Rust binary — drop into Docker Compose as a sidecar
  • LLM backends: Ollama (local), OpenAI, Anthropic, any OpenAI-compatible endpoint

Retrieval pipeline

6 stages: full-text search → entity lookup → graph expansion → relation filtering → scoring/ranking → context injection. Avg 4.2ms on M2 debug; 3-5x faster in release.

Why cf-core

cf-core already has preferences, tasks, and db modules. A memory module wrapping mnemo's Python SDK would give all CF products a shared, persistent knowledge graph layer without each product re-implementing it.

Scope

  1. Wrap mnemo Python SDK in a cf_core.memory module
  2. Add mnemo sidecar to compose.base.yml template (alongside ollama)
  3. Expose simple API: memory.remember(conversation), memory.recall(query), memory.entities()
  4. Gate behind feature flag: only active if mnemo sidecar is running

Products that would benefit

  • Robin (proactive local assistant — primary use case)
  • Peregrine (job search knowledge graph: companies, contacts, outcomes)
  • Kiwi (dietary preferences, flavor memory, substitution history)
  • Linnet (per-contact communication style patterns)

Notes

  • License: MIT, clean
  • 62 stars, small early-stage project — CF could be a meaningful upstream contributor
  • Contribution opportunities: Docker Compose integration, CF entity schemas, product-specific retrievers
  • See robin issue for primary use case detail
## Summary mnemo (https://github.com/zaydmulani09/mnemo) is a local-first LLM memory sidecar written in Rust. It extracts named entities and relationships from conversations, builds a persistent knowledge graph in SQLite, and injects relevant context back into future prompts in under 50ms. MIT license. ## Architecture - **Storage:** SQLite with WAL mode (durable, survives restarts) - **Graph:** in-memory petgraph (rebuilt from SQLite on startup) - **API:** Axum REST API - **SDK:** Python pip package for easy integration with CF FastAPI backends - **Deployment:** single static Rust binary — drop into Docker Compose as a sidecar - **LLM backends:** Ollama (local), OpenAI, Anthropic, any OpenAI-compatible endpoint ## Retrieval pipeline 6 stages: full-text search → entity lookup → graph expansion → relation filtering → scoring/ranking → context injection. Avg 4.2ms on M2 debug; 3-5x faster in release. ## Why cf-core cf-core already has `preferences`, `tasks`, and `db` modules. A `memory` module wrapping mnemo's Python SDK would give all CF products a shared, persistent knowledge graph layer without each product re-implementing it. ## Scope 1. Wrap mnemo Python SDK in a `cf_core.memory` module 2. Add `mnemo` sidecar to `compose.base.yml` template (alongside ollama) 3. Expose simple API: `memory.remember(conversation)`, `memory.recall(query)`, `memory.entities()` 4. Gate behind feature flag: only active if mnemo sidecar is running ## Products that would benefit - Robin (proactive local assistant — primary use case) - Peregrine (job search knowledge graph: companies, contacts, outcomes) - Kiwi (dietary preferences, flavor memory, substitution history) - Linnet (per-contact communication style patterns) ## Notes - License: MIT, clean - 62 stars, small early-stage project — CF could be a meaningful upstream contributor - Contribution opportunities: Docker Compose integration, CF entity schemas, product-specific retrievers - See robin issue for primary use case detail
Author
Owner

Implemented as circuitforge_core.memory module (MIT). Wraps AsyncMnemoClient with graceful degradation: no-ops when sidecar is absent, exponential backoff + auto-reconnect after consecutive failures (5s → 10s → 20s → 60s cap). API: remember(), recall(), entities(), stats(), wipe(). Optional dep: pip install circuitforge-core[memory]. 26 tests passing.

Implemented as `circuitforge_core.memory` module (MIT). Wraps `AsyncMnemoClient` with graceful degradation: no-ops when sidecar is absent, exponential backoff + auto-reconnect after consecutive failures (5s → 10s → 20s → 60s cap). API: `remember()`, `recall()`, `entities()`, `stats()`, `wipe()`. Optional dep: `pip install circuitforge-core[memory]`. 26 tests passing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Circuit-Forge/circuitforge-core#63
No description provided.