v0.4.0 · Open Source

Memory for
AI agents.

Store context locally. Recall what matters. See why it was returned. Embed in Rust or connect through HTTP and gRPC.

From context to continuity.

  1. 01

    Store

    Save facts and episodes with scope and retry-safe writes.

  2. 02

    Recall

    Retrieve relevant context with a score explanation for each hit.

  3. 03

    Replay

    Query historical memory to inspect what an agent knew at the time.

Core Capabilities

Built for Recall.

Explainable Recall

Every hit includes scoring and planning traces. Inspect why a memory matched and which filters shaped the result.

Testable Quality

Check expected and disallowed results in CI, with score and explanation assertions.

Append-only Changefeed

Follow ordered memory changes for audit logs, external indexes, and replication.

Durable Timeline

Keep historical versions, compact records, and move snapshots between backends.

Built for builders.

01 Install in Seconds

Add Mnemara with durable sled storage.

cargo add mnemara --features sled

02 Store Episode Context

Link records to episodes, actors, and open goals.

03 Recall With Explanation

Retrieve episode context with explanations. Or run the daemon from the source checkout.

cargo run -p mnemara-server
main.rs
View Rust store and recall example
use std::collections::BTreeMap;

use mnemara::{
    EPISODE_SCHEMA_VERSION, EpisodeContext, EpisodeContinuityState,
    EpisodeSalience, MemoryQualityState, MemoryRecord, MemoryRecordKind,
    MemoryScope, MemoryStore, MemoryTrustLevel, RecallFilters, RecallQuery,
    RecallTemporalOrder, SledMemoryStore, SledStoreConfig, UpsertRequest,
};

let store = SledMemoryStore::open(
    SledStoreConfig::new("./mnemara-data"),
)?;

let scope = MemoryScope {
    tenant_id: "default".into(),
    namespace: "agent".into(),
    actor_id: "ava".into(),
    conversation_id: Some("thread-42".into()),
    session_id: Some("session-7".into()),
    source: "cli".into(),
    labels: vec!["ops".into()],
    trust_level: MemoryTrustLevel::Verified,
};

store.upsert(UpsertRequest {
    record: MemoryRecord {
        id: "storm-follow-up".into(),
        scope: scope.clone(),
        kind: MemoryRecordKind::Episodic,
        content: "Reconnect storm follow-up is still open after rollback.".into(),
        summary: Some("Open reconnect storm follow-up".into()),
        source_id: None,
        metadata: BTreeMap::new(),
        quality_state: MemoryQualityState::Active,
        created_at_unix_ms: 1_717_240_000_000,
        updated_at_unix_ms: 1_717_240_000_000,
        expires_at_unix_ms: None,
        importance_score: 0.92,
        artifact: None,
        episode: Some(EpisodeContext {
            schema_version: EPISODE_SCHEMA_VERSION,
            episode_id: "reconnect-storm".into(),
            summary: Some("Reconnect storm remediation".into()),
            continuity_state: EpisodeContinuityState::Open,
            actor_ids: vec!["ava".into()],
            goal: Some("Close the reconnect rollout checklist".into()),
            causal_record_ids: vec!["storm-root-cause".into()],
            related_record_ids: vec!["rollback-note".into()],
            salience: EpisodeSalience {
                reuse_count: 4,
                novelty_score: 0.3,
                goal_relevance: 0.95,
                unresolved_weight: 0.9,
            },
            ..Default::default()
        }),
        historical_state: Default::default(),
        lineage: vec![],
    },
    idempotency_key: Some("storm-follow-up-v1".into()),
}).await?;

let results = store.recall(RecallQuery {
    scope,
    query_text: "what changed in the reconnect storm?".into(),
    max_items: 5,
    token_budget: None,
    filters: RecallFilters {
        episode_id: Some("reconnect-storm".into()),
        unresolved_only: true,
        temporal_order: RecallTemporalOrder::ChronologicalAsc,
        ..Default::default()
    },
    include_explanation: true,
}).await?;

Run it your way.

Embed in Rust

Use the core model with sled or file storage.

Run a daemon

Connect over HTTP or gRPC, with shared auth and limits.

Use an SDK

Integrate through JavaScript or Python.

Community Driven

Open source. Yours to build on.

MIT-licensed. Inspect the code, build on it, and contribute.