Skip to content
Conduit

mcp server

memor-ia

naicud/memor-iacommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

Before you start

  • uv (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "memor-ia": {
      "command": "uvx",
      "args": [
        "memoria"
      ]
    }
  }
}

same format Cursor, GitHub Copilot CLI, Junie, JetBrains AI Assistant, Augment (Auggie CLI), Factory Droid, Kiro, Devin CLI +12

Values in angle brackets are placeholders. Restart Claude Desktop after editing its config.Claude Desktop docs

README

synced Oct 22, 2026

MEMOR-IA 🧠

Proactive Memory Framework for AI Agents

Inspired by Mem0 — extended with agent orchestration, proactive intelligence, and dream consolidation.

Python 3.11+ License: MIT MCP Tools: 97 Tests: 4700+


Table of Contents: Install · Quick Start · MCP Server · Architecture · Features · Use Cases · Examples · Documentation · Tests


Why MEMORIA?

NeedMEMORIA Solution
Agent needs to remember across sessionsPersistent markdown + vector + graph storage
Context window is limitedProactive suggestions surface relevant memories
Multiple agents need shared knowledgeTeam sharing with coherence checking
Memories become stale over timeDream consolidation auto-promotes/forgets
Need to detect injection attacksAdversarial protection layer
Want to predict user behaviorMarkov chain action prediction
Need real-time event notificationsStreaming (SSE/WebSocket) + webhooks
Want multi-instance collaborationFederation protocol with CRDT sync
Need visual memory explorationBuilt-in React dashboard with interactive graph

Install

Requirements: Python ≥ 3.11

# Core only (zero dependencies)
pip install -e .

# With MCP server (recommended)
pip install -e ".[mcp]"

# With graph support (FalkorDB):
pip install -e ".[graph]"

# Full install (all optional deps):
pip install -e ".[full]"

With UV (recommended):

uv pip install -e ".[full]"

Quick Start

from memoria import Memoria

m = Memoria()

# Store memories
m.add("User prefers TypeScript for frontend", user_id="daniel")
m.add("Working on React dashboard project", user_id="daniel")

# Hybrid search (keyword + vector + graph → RRF fusion)
results = m.search("language preferences", user_id="daniel")

# Proactive suggestions
suggestions = m.suggest(context="starting a new web project", user_id="daniel")

# User profiling
profile = m.profile(user_id="daniel")

# Cross-database insights
insights = m.insights(user_id="daniel")

Architecture (9 Layers, 28 Subsystems)

mindmap
  root((MEMOR-IA))
    L1 — Core Services
      Identity & Context
      Communication Bus
      Consolidation Engine
      ACL & Namespaces
    L2 — Hybrid Recall & Storage
      Keyword + Vector + Graph → RRF Fusion
      FalkorDB Graph / InMemory
      SQLite-vec Embeddings
      Markdown Files ~/.memoria/
      Procedural Memory
      Self-Edit Engine
    L3 — Proactive Intelligence
      User Profiler
      Insight Analyzer
      Suggestion Engine
      Trigger System
      Episodic Memory
    L4 — Cognitive Services
      User DNA Fingerprint
      Dream Consolidation Engine
      Preference Learning
      Session Resurrection
    L5 — Multi-Agent & Sharing
      Memory Broadcasting
      Team Coherence Check
      DNA Sync Across Agents
      Coordinator Protocol
    L6 — Behavioral Prediction
      Next-Action Prediction
      Anomaly Detection
      Timing Optimization
      Difficulty Estimation
    L7 — Emotional Intelligence
      Emotion Analysis
      Empathy Triggers
      Fatigue Detection
    L8 — Cross-Product Intelligence
      Product Tracking
      Behavioral Fusion
      Habit Intelligence
      Contextual Engine
      Business Intelligence
    Platform Services
      GDPR Compliance & Audit Trail
      Webhooks & Event Notifications
      Summarization & Deduplication
      Structured Memory Templates
      Real-time Streaming SSE/WS
      Multi-modal Attachments
      Plugin Extensibility
      Web Dashboard D3.js
      Federation Protocol CRDT

Data Flow

graph LR
    A[AI Agent] -->|MCP Protocol| B[MEMORIA Server]
    B --> C[Layer 1: Core]
    C --> D[Layer 2: Storage]
    D --> E[(SQLite-vec)]
    D --> F[(FalkorDB Graph)]
    D --> G[(Markdown Files)]
    C --> H[Layer 3: Proactive]
    H --> I[Layer 4: Cognitive]
    I --> J[Layer 5: Multi-Agent]
    J --> K[Layer 6: Prediction]
    K --> L[Layer 7: Emotional]
    L --> M[Layer 8: Cross-Product]
    
    style A fill:#4A90D9,color:#fff
    style B fill:#7B68EE,color:#fff
    style E fill:#FF6B6B,color:#fff
    style F fill:#FF6B6B,color:#fff
    style G fill:#FF6B6B,color:#fff

Storage Architecture

graph TB
    subgraph "Memory Tiers"
        W[Working Memory<br/>ephemeral, fast]
        R[Recall Memory<br/>persistent, searchable]
        A[Archival Memory<br/>cold, compressed]
    end
    
    subgraph "Backends"
        SQ[(SQLite + sqlite-vec<br/>vectors & metadata)]
        FK[(FalkorDB<br/>knowledge graph)]
        MD[(Markdown Files<br/>human-readable)]
    end
    
    W -->|promote| R
    R -->|archive| A
    R --> SQ
    R --> FK
    R --> MD
    
    subgraph "97 MCP Tools"
        T1[Core CRUD 7]
        T2[Tiered & ACL 5]
        T3[Episodic 5]
        T4[Procedural 4]
        T5[Intelligence 20]
        T6[Defensive 6]
        T7[GDPR & Audit 5]
        T8[Webhooks 3]
        T9[Summarization & Dedup 6]
        T10[Templates 3]
        T11[Streaming 5]
        T12[Attachments 5]
        T13[Plugins 5]
        T14[Dashboard 5]
        T15[Federation 5]
        T16[Resources 7 + Prompts 5]
    end

Features

Core

  • 📁 File-based persistent memory (Markdown + YAML frontmatter)
  • 🎭 Agent identity & context isolation (contextvars)
  • 🔗 Inter-agent communication (Mailbox, MessageBus, Permissions)
  • 📦 Context management (token window, compaction, prompt building)
  • 💤 Dream consolidation system (5-gate auto-trigger)
  • 🎯 Agent orchestration (teams, spawn, fork)

Storage

  • 🔮 Knowledge graph (FalkorDB or zero-dep InMemoryGraph fallback)
  • 🧲 Semantic vector search (sqlite-vec or pure Python cosine fallback)
  • 📝 Entity extraction (regex-based, no LLM dependency)
  • 📊 Temporal tracking (trending concepts, confidence decay)

Intelligence

  • 🧠 Proactive suggestion engine with cooldowns
  • 📈 Pattern detection (repetition, sequence, temporal)
  • 👤 Client profiling (expertise map, working patterns)
  • ⚡ Event-driven triggers (MessageBus integration)
  • 💡 Cross-database insight generation

Recall

  • 🔄 Hybrid recall pipeline (3 strategies in parallel)
  • 🏆 Reciprocal Rank Fusion (RRF) for result merging
  • 🎯 Context filtering and deduplication
  • 🔌 Pluggable strategy architecture
  • 🔌 MCP Server (Claude Desktop, Cursor integration)

Episodic & Procedural

  • 📖 Episodic memory (session timelines, event recording, temporal search)
  • ⚙️ Procedural memory (workflow recording, pattern extraction, step suggestions)
  • ✏️ Memory self-editing (importance scoring, budget management)

User DNA & Cognitive

  • 🧬 User DNA (behavioral fingerprinting, coding style, communication profile)
  • 💤 Dream Engine (6-phase consolidation cycles, memory replay, insight synthesis)
  • 🎛️ Preference Engine (structured preference learning, conflict resolution, confidence evolution)
  • 🔄 Context Resurrection (session snapshots, thread tracking, perfect resumption)

Multi-Agent & Prediction

  • 📡 Multi-Agent Sharing (memory broadcasting, team coherence, DNA sync)
  • 🔮 Behavioral Prediction (Markov chain action prediction, anomaly detection, timing optimization)
  • 💜 Emotional Intelligence (12-emotion analysis, empathy triggers, fatigue/burnout detection)

Cross-Product Intelligence

  • 🏢 Product Ecosystem Intelligence (product tracking, usage profiling, adoption analysis)
  • 🔀 Cross-Domain Behavioral Fusion (behavior correlation, workflow detection, churn prediction)
  • 🔄 Habit & Routine Intelligence (habit tracking, routine optimization, disruption alerts)
  • 🎯 Contextual Intelligence Engine (situation awareness, intent inference, proactive assistance)
  • 💰 Business Intelligence Memory (revenue signals, segment classification, lifecycle tracking)

Defensive Intelligence

  • 🛡️ Adversarial Memory Protection (poison detection, hallucination guards, consistency verification, tamper proofing)
  • 🧩 Cognitive Load Management (load tracking, overload prevention, complexity adaptation, focus optimization)

Platform Services (v2.1–v3.0)

  • 🔒 GDPR Compliance — Right-to-be-forgotten, data export, consent tracking, full audit trail
  • 🔔 Webhooks — Event-driven HTTP notifications with HMAC signing and retry logic
  • 📝 Summarization — Extractive text summarization with key fact extraction
  • 🧹 Deduplication — Similarity-based duplicate detection and smart merge
  • 📋 Templates — Structured memory creation with predefined schemas (10 built-in + custom)
  • 📡 Real-time Streaming — SSE and WebSocket channels with filtered subscriptions
  • 📎 Multi-modal Attachments — Binary file storage (images, documents, code) linked to memories
  • 🔌 Plugin System — Extensible architecture with discover/register/activate lifecycle
  • 🖥️ Web Dashboard — Built-in SPA with D3.js knowledge graph visualization, memory explorer, audit log
  • 🌐 Federation Protocol — Peer-to-peer multi-instance sync with PKI trust and CRDT conflict resolution

Key Differentiators vs Mem0

FeatureMem0MEMORIA
Memory storage✅✅
Vector search✅✅
Knowledge graph✅✅
Agent orchestration❌✅
Proactive suggestions❌✅
Dream consolidation❌✅
Communication layer❌✅
Context management❌✅
Zero-config default❌✅
MCP Server (97 tools)❌✅
Behavioral fingerprinting (User DNA)❌✅
Dream-like consolidation cycles❌✅
Cross-session resurrection❌✅
Multi-agent memory sharing❌✅
Behavioral prediction❌✅
Emotional intelligence❌✅
Episodic & procedural memory❌✅
Memory self-editing❌✅
Cross-product behavioral intelligence❌✅
Adversarial memory protection❌✅
Cognitive load management❌✅
GDPR compliance & audit trail❌✅
Webhooks & event notifications❌✅
AI summarization & deduplication❌✅
Structured memory templates❌✅
Real-time streaming (SSE/WebSocket)❌✅
Multi-modal attachments❌✅
Plugin extensibility❌✅
Web dashboard with graph viz❌✅
Federation protocol (CRDT sync)❌✅

Feature Matrix (28 Subsystems)

SubsystemKey CapabilitiesModule
Core MemoryCRUD, hybrid search, RRF fusionmemoria.core
Knowledge GraphEntity extraction, relation mappingmemoria.graph
Proactive IntelligenceSuggestions, profiling, insightsmemoria.intelligence
Tiered StorageWorking/recall/archival tiers, ACLmemoria.tiered
Episodic MemorySession timelines, event recordingmemoria.episodic
Procedural MemoryWorkflow patterns, step suggestionsmemoria.procedural
User DNABehavioral fingerprinting, digital twinmemoria.user_dna
Dream Engine6-phase cognitive consolidationmemoria.dream
Preference EnginePreference learning, conflict resolutionmemoria.preferences
Context ResurrectionSession snapshots, perfect resumptionmemoria.resurrection
Multi-Agent SharingBroadcasting, team coherence, DNA syncmemoria.sharing
Behavioral PredictionAction prediction, anomaly detectionmemoria.prediction
Emotional Intelligence12-emotion analysis, empathy, fatiguememoria.emotional
Product IntelligenceProduct tracking, usage profiling, adoptionmemoria.product_intel
Behavioral FusionCross-product correlation, workflow detectionmemoria.fusion
Habit IntelligenceHabit tracking, routine optimization, anchorsmemoria.habits
Contextual IntelligenceSituation awareness, intent inference, proactivememoria.contextual
Business IntelligenceRevenue signals, segmentation, lifecycle, valuememoria.biz_intel
Adversarial ProtectionPoison detection, hallucination guards, tamper proofmemoria.adversarial
Cognitive LoadLoad tracking, overload prevention, focus optimizationmemoria.cognitive
GDPR & AuditRight-to-forget, data export, consent, audit trailmemoria.gdpr
WebhooksHTTP event notifications, HMAC signing, retrymemoria.webhooks
Summarization & DedupExtractive summarization, duplicate detection & mergememoria.summarizer
TemplatesStructured schemas, 10 built-in + custom templatesmemoria.templates
StreamingSSE/WebSocket channels, filtered subscriptionsmemoria.streaming
Multi-modalBinary attachments, metadata extractionmemoria.multimodal
Plugin SystemDiscover/register/activate extensibilitymemoria.plugins
Web DashboardReact SPA, Recharts, canvas graph, REST API, CRUDmemoria.dashboard
FederationP2P sync, PKI trust, CRDT conflict resolutionmemoria.federation

Examples

python3 examples/01_basic_memory.py      # CRUD operations
python3 examples/02_knowledge_graph.py   # Graph building & queries
python3 examples/03_semantic_search.py   # Vector similarity search
python3 examples/04_proactive_agent.py   # Profiling & suggestions
python3 examples/05_full_pipeline.py     # All layers end-to-end

MCP Server

MEMORIA exposes 97 tools, 7 resources, and 5 prompts via Model Context Protocol for integration with Claude Desktop, Cursor, VS Code, and any MCP-compatible client.

📖 Full reference: docs/MCP_SERVER.md — complete tool signatures, parameters, examples, client configs, and Docker deployment.

Quick Start

# Install with MCP support
pip install -e ".[mcp]"

# Start in stdio mode (for Claude Desktop, Cursor)
memoria-mcp

# Start in HTTP mode (for testing, web apps)
memoria-mcp --transport http --port 8080

Claude Desktop Configuration

Add to your Claude Desktop config:

{
  "mcpServers": {
    "memoria": {
      "command": "memoria-mcp",
      "args": [],
      "env": {
        "MEMORIA_PROJECT_DIR": "/path/to/your/project"
      }
    }
  }
}

Docker

# Start MEMORIA + FalkorDB
docker compose up -d

# MEMORIA MCP on http://localhost:8080
# FalkorDB on localhost:6379

Available Tools (97)

Core CRUD (7)

ToolDescription
memoria_addStore a new memory
memoria_searchHybrid search (keyword + vector + graph)
memoria_getRetrieve a memory by ID
memoria_deleteDelete a memory
memoria_suggestGenerate proactive suggestions
memoria_profileGet user profile
memoria_insightsGenerate cross-database insights

Tiered & ACL (5)

ToolDescription
memoria_add_to_tierStore memory in a specific tier
memoria_search_tiersSearch across memory tiers
memoria_grant_accessGrant access to a namespace
memoria_check_accessCheck access permissions
memoria_enrichEnrich memory with graph data

Sync & Stats (2)

ToolDescription
memoria_syncSynchronize memories across instances
memoria_statsGet memory statistics

Episodic Memory (5)

ToolDescription
episodic_startStart an episodic session
episodic_endEnd an episodic session
episodic_recordRecord an event in the current episode
episodic_timelineView episode timeline
episodic_searchSearch episodic memories

Procedural Memory (4)

ToolDescription
procedural_recordRecord a procedural step
procedural_suggestGet workflow step suggestions
procedural_workflowsList recorded workflows
procedural_add_workflowAdd a complete workflow

Importance & Self-Edit (3)

ToolDescription
importance_scoreScore memory importance
self_editSelf-edit memory content
memory_budgetManage memory budget

User DNA (2)

ToolDescription
user_dna_snapshotGet user behavioral fingerprint
user_dna_collectCollect behavioral data passively

Dream Engine (2)

ToolDescription
dream_consolidateRun dream consolidation cycle
dream_journalView dream journal entries

Preferences (2)

ToolDescription
preference_queryQuery user preferences
preference_teachTeach a new preference

Resurrection (2)

ToolDescription
session_snapshotCapture session snapshot
session_resumeResume from a previous session

Sharing (2)

ToolDescription
team_share_memoryShare memory with team agents
team_coherence_checkCheck team memory coherence

Prediction (2)

ToolDescription
predict_next_actionPredict next user action
estimate_difficultyEstimate task difficulty

Emotional (2)

ToolDescription
emotion_analyzeAnalyze emotional state
emotion_fatigue_checkCheck for fatigue/burnout

Product Intelligence (2)

ToolDescription
product_trackTrack product usage and adoption
product_graphView product ecosystem graph

Behavioral Fusion (2)

ToolDescription
fusion_correlateCorrelate cross-product behaviors
fusion_detect_workflowDetect cross-product workflows

Habit Intelligence (2)

ToolDescription
habit_trackTrack user habits and routines
habit_optimizeGet routine optimization suggestions

Contextual Intelligence (2)

ToolDescription
context_situationAssess current user situation
context_infer_intentInfer user intent from context

Business Intelligence (2)

ToolDescription
biz_revenue_signalsDetect revenue opportunity signals
biz_segment_classifyClassify user into business segments

Adversarial Protection (3)

ToolDescription
adversarial_detect_poisonDetect memory poisoning attempts
adversarial_verify_consistencyVerify memory consistency and integrity
adversarial_guard_hallucinationGuard against hallucination in memories

Cognitive Load (3)

ToolDescription
cognitive_track_loadTrack cognitive load levels
cognitive_prevent_overloadPrevent cognitive overload
cognitive_optimize_focusOptimize focus and reduce complexity

GDPR & Audit (5)

ToolDescription
gdpr_forgetRight-to-be-forgotten (erase user)
gdpr_exportExport all user data (DSAR)
audit_logQuery the audit trail
audit_statsGet audit statistics
consent_manageManage user consent records

Webhooks (3)

ToolDescription
webhook_registerRegister an HTTP webhook endpoint
webhook_listList all registered webhooks
webhook_unregisterRemove a webhook

Summarization & Dedup (6)

ToolDescription
memoria_summarizeSummarize text with key fact extraction
memoria_summarize_allSummarize all memories for a user
dedup_scanScan for duplicate memories
dedup_mergeMerge duplicate memories
dedup_historyView deduplication history
dedup_statsGet deduplication statistics

Templates (3)

ToolDescription
template_createCreate a structured memory template
template_listList available templates
template_applyApply a template to create memory

Streaming (5)

ToolDescription
stream_subscribeSubscribe to real-time event channels
stream_unsubscribeUnsubscribe from a channel
stream_broadcastBroadcast an event to channels
stream_listList active channels
stream_statsGet streaming statistics

Attachments (5)

ToolDescription
add_attachmentAttach a file to a memory
get_attachmentGet attachment metadata
list_attachmentsList attachments for a memory
delete_attachmentDelete an attachment
attachment_statsGet attachment statistics

Plugins (5)

ToolDescription
plugin_discoverDiscover available plugins
plugin_listList registered plugins
plugin_activateActivate a plugin
plugin_deactivateDeactivate a plugin
plugin_statsGet plugin statistics

Web Dashboard (5)

ToolDescription
start_dashboardStart the web dashboard server
stop_dashboardStop the dashboard server
dashboard_statusCheck dashboard running status
dashboard_urlGet dashboard URL
dashboard_configGet dashboard configuration

Federation (5)

ToolDescription
federation_connectConnect to a federated peer instance
federation_disconnectDisconnect from a peer
federation_trustManage PKI trust for a peer
federation_syncSynchronize memories with a peer
federation_statusGet federation protocol status

Resources (7)

URIDescription
memoria://memoriesList all stored memories
memoria://configCurrent configuration
memoria://profile/{user_id}User profile data
memoria://statsMemory statistics
memoria://episodic/timelineEpisodic session timeline
memoria://procedural/patternsProcedural workflow patterns
memoria://budgetMemory budget status

Prompts (5)

PromptDescription
recall_contextInject relevant memories as context
suggest_nextGenerate proactive suggestions prompt
deep_recallDeep multi-strategy memory recall
consolidation_reportDream consolidation summary
episodic_recapEpisodic session recap

Tests

# Full suite (4700+ tests, ~30s)
python3 -m pytest tests/ -q

# With coverage
python3 -m pytest tests/ --cov=memoria

# E2E MCP protocol tests (real JSON-RPC conversations)
python3 -m pytest tests/test_e2e_mcp_client.py tests/test_e2e_comprehensive.py -v -s

# E2E backend tests (local — no FalkorDB needed)
python3 -m pytest tests/test_e2e_backends.py -q

# E2E with FalkorDB (requires: docker compose up falkordb)
python3 -m pytest tests/test_e2e_backends.py -q --run-falkordb

The E2E MCP tests generate detailed reports with real request/response data:

Or with Make:

make test            # Quick test run
make test-verbose    # Verbose output
make test-e2e        # E2E backend tests
make test-cov        # With coverage report

Examples

Five runnable examples in examples/:

ExampleDescription
01_basic_memory.pyCRUD operations — add, search, get, delete
02_knowledge_graph.pyEntity extraction, graph building, relationship queries
03_semantic_search.pyVector similarity search, TF-IDF embeddings
04_proactive_agent.pyUser profiling, pattern analysis, proactive suggestions
05_full_pipeline.pyAll layers end-to-end in a multi-session demo
python examples/01_basic_memory.py

Use Cases & Scenarios

Real-world examples showing how MEMORIA works across different domains and contexts.

🛠️ Developer Tooling — IDE Coding Assistant

An AI coding assistant that remembers your project context, preferences, and past decisions across sessions.

from memoria import Memoria

m = Memoria(project_dir="/projects/my-app")

# Session 1: The AI learns about the developer
m.add("User prefers TypeScript strict mode with Zod validation", user_id="dev")
m.add("Project uses Next.js 14 App Router with RSC", user_id="dev")
m.preference_teach(user_id="dev", category="framework", key="frontend", value="Next.js")
m.preference_teach(user_id="dev", category="style", key="formatting", value="Prettier + ESLint")

# Record a debugging session
m.episodic_start(session_id="debug-auth")
m.episodic_record(content="OAuth redirect loop caused by missing NEXTAUTH_URL env var",
                  event_type="insight", importance=0.9)
m.procedural_record(tool_name="next-dev", input_data="npm run dev",
                    result="Fixed after adding .env.local", success=True)

# Session 2: Next day, AI recalls everything
prefs = m.preference_query(user_id="dev", category="framework")
# → {"primary": {"value": "Next.js", "confidence": 1.0}}

results = m.search("authentication problems", user_id="dev")
# → Returns the OAuth insight from yesterday

suggestions = m.suggest(context="setting up deployment", user_id="dev")
# → "Remember to set NEXTAUTH_URL in production environment variables"

📊 SaaS Product Analytics — Churn Prevention

Track product usage patterns, detect churn signals, and predict expansion opportunities.

from memoria import Memoria

m = Memoria()

# Register products in your portfolio
m.product_register(product_id="analytics-pro", name="Analytics Pro", category="analytics")
m.product_register(product_id="dashboard-hub", name="Dashboard Hub", category="project_management")

# Track real usage events
m.product_usage_record(product_id="analytics-pro", feature="custom_reports", action="create")
m.product_usage_record(product_id="analytics-pro", feature="api_access", action="query")
m.product_usage_record(product_id="dashboard-hub", feature="team_boards", action="create")

# Lifecycle tracking
m.biz_lifecycle_update(product_id="analytics-pro",
                       days_active=90, total_events=1500,
                       feature_count=8, engagement_score=0.85,
                       usage_trend="growing", is_expanding=True)

# Revenue signals
m.biz_revenue_signal(signal_type="upsell_opportunity",
                     product_id="analytics-pro",
                     description="User hitting API rate limits, candidate for Enterprise tier",
                     impact=0.9, confidence=0.8)

# Predict churn risk
churn = m.fusion_churn_predict(product_id="analytics-pro")
# → {"churn_risk": 0.12, "factors": ["high_engagement", "growing_usage"]}

# Unified intelligence model
model = m.fusion_unified_model()
# → Cross-product insights, workflow detection, habit analysis

🤖 Multi-Agent Team — Shared Knowledge Base

Multiple AI agents collaborating on a project with shared memory and coherence checking.

from memoria import Memoria

m = Memoria()

# Agent 1 (Code Review Bot) shares knowledge
m.sharing_share(agent_id="reviewer-bot", namespace="project-alpha",
                key="coding-standards", value="All functions must have type annotations and docstrings")

# Agent 2 (Test Writer Bot) reads shared knowledge
m.sharing_share(agent_id="test-bot", namespace="project-alpha",
                key="test-patterns", value="Use pytest fixtures, minimum 80% branch coverage")

# Access control
m.acl_grant(agent_id="reviewer-bot", namespace="project-alpha", role="writer")
m.acl_grant(agent_id="test-bot", namespace="project-alpha", role="reader")
m.acl_check(agent_id="test-bot", namespace="project-alpha", operation="read")
# → {"allowed": True, "role": "reader"}

# Coherence check — detect contradictions between agents
coherence = m.sharing_coherence(team_id="project-alpha")
# → {"is_coherent": True, "conflicts": [], "shared_keys": 2}

🎓 Educational Platform — Adaptive Learning

An AI tutor that tracks cognitive load, adapts difficulty, and remembers learning patterns.

from memoria import Memoria

m = Memoria()

# Track student's cognitive state
m.cognitive_record(topic="linear_algebra", complexity=0.8)
m.cognitive_record(topic="probability", complexity=0.5)

# Check if the student is overloaded
overload = m.cognitive_check_overload()
# → {"is_overloaded": False, "load_score": 0.45, "recommendation": "can_continue"}

# Emotional state tracking
emotion = m.emotion_analyze(text="I finally understand eigenvalues! This is amazing!")
# → {"dominant": "joy", "confidence": 0.92, "valence": 0.95}

fatigue = m.emotion_fatigue_check()
# → {"is_fatigued": False, "session_duration": 45, "recommendation": "continue"}

# Predict what the student will study next
prediction = m.predict_next_action()
# → {"predicted_action": "study_probability", "confidence": 0.7}

# Difficulty estimation for new content
diff = m.estimate_difficulty(description="Introduction to Bayesian inference")
# → {"difficulty": 0.65, "estimated_time": "45min", "prerequisites": [...]}

🏥 Healthcare AI Assistant — Patient Context Memory

A medical AI that maintains patient interaction history with full audit trail.

from memoria import Memoria

m = Memoria()

# Episodic memory for patient interactions
m.episodic_start(session_id="patient-consultation-2024")
m.episodic_record(content="Patient reports persistent headaches for 2 weeks",
                  event_type="observation", importance=0.8)
m.episodic_record(content="Recommended MRI scan based on symptom duration",
                  event_type="decision", importance=0.9)

# Adversarial protection — prevent hallucinated medical data
scan = m.adversarial_scan(content="Patient has no known allergies")
# → {"is_safe": True, "risk_score": 0.01, "threats": []}

# Consistency check against known facts
check = m.adversarial_check_consistency(
    content="Patient has penicillin allergy",
    existing_facts=["Patient has no known allergies"]
)
# → {"is_consistent": False, "contradictions": ["allergy_conflict"], ...}

# Integrity verification — audit trail
m.adversarial_verify_integrity(content="MRI ordered on 2024-03-15", content_id="order-123")

# Session snapshot for handoff to next doctor
m.resurrection_capture(user_id="dr-smith", session_id="patient-consultation-2024")
# Next doctor resumes context
context = m.resurrection_resume(user_id="dr-smith")

🔌 MCP Integration — Any AI Client

All examples above work through the MCP server with any compatible client (Claude Desktop, Cursor, VS Code, custom apps):

# Start the MCP server
memoria-mcp --transport http --port 8080

# Or via Docker (recommended for production)
docker compose up -d
// MCP tool call example (from any client)
{
  "method": "tools/call",
  "params": {
    "name": "memoria_add",
    "arguments": {
      "content": "User prefers dark mode and vim keybindings",
      "user_id": "daniel"
    }
  }
}
// Response
{
  "content": [{
    "type": "text",
    "text": "{\"status\": \"created\", \"id\": \"~/.memoria/projects/.../memory/a1b2c3d4.md\"}"
  }]
}

📖 Full MCP reference with all 97 tools: docs/MCP_SERVER.md


Documentation

Comprehensive documentation in the docs/ directory:

DocumentDescription
RoadmapFeature roadmap v2.1→v3.0: 12 planned features with detailed architecture, code designs, and dependency maps
IndustrializationEnterprise deployment: AWS (EKS), Azure (AKS), GCP (GKE), Helm charts, CI/CD, security, cost estimates
Product OverviewBusiness overview, 8 use cases, market position, competitive landscape, licensing
Data ArchitectureData flow diagrams, storage format, real data examples
E2E Test ReportAuto-generated report: 11 real MCP conversation scenarios with JSON request/response data
E2E Comprehensive ReportAuto-generated report: 10 conversations covering streaming, attachments, plugins, templates, webhooks, dashboard, federation
MCP Server GuideComplete MCP reference: 97 tools, 7 resources, 5 prompts, client config (Claude Desktop, Cursor, VS Code), Docker deployment
ConfigurationEnvironment variables, backend setup (FalkorDB, SQLite-vec), Makefile targets
API ReferencePython API: Memoria class, VectorClient, GraphClient, types
Architecture9-layer deep dive, data flow, module map, recall pipeline

License

Business Source License 1.1 — see LICENSE for details.

  • Free for non-commercial use, development, testing, research, and personal projects
  • Commercial/production use requires written authorization from the Licensor
  • Converts to Apache 2.0 on March 22, 2030
↑↓ navigate openesc close