Generated banner for MIRIX
Generated logo for MIRIX

MIRIX

Memory server

Created by Mirix AI

Published in Mirix-AI/MIRIX. Publisher page

3,460 GitHub stars

What it is

Mirix is a multi-agent personal assistant designed to track on-screen activities and answer user questions intelligently. By capturing real-time visual data and consolidating it into structured memories, Mirix transforms raw inputs into a rich knowledge base that adapts to your digital experiences.
— the description by Mirix AI

AutoGineer overview, from the brain’s own files

Mirix is a memory server designed to provide AI agents with persistent, multi-modal memory. It functions by observing screen activity and processing natural language conversations, consolidating these inputs into six distinct memory components: Core, Episodic, Semantic, Procedural, Resource, and Knowledge Vault. The system uses a hybrid storage approach, leveraging PostgreSQL with pgvector for search and an optional Neo4j graph database for provenance tracking. Mirix includes an 'Auto-Dream' feature for periodic memory consolidation, deduplication, and refinement, ensuring that the agent's knowledge base remains structured and relevant over time.

How it works

Memory model: Hybrid

AutoGineer overview, from the brain’s own files

Mirix operates as a backend server that orchestrates six specialized sub-agents to manage different memory types. It captures user interactions and visual screen data, which are then processed and stored in a PostgreSQL database. The system supports full-text search via BM25 and vector similarity search. An optional graph memory layer can be enabled to map relationships between entities using Neo4j. The Auto-Dream functionality allows the system to review and merge memory entries, while the provided Python client enables agents to read from and write to these memory stores.

Folders
FolderRoleFiles
.githubagent-config1
assetsattachments3
docsdocs5
samplesexamples16
scriptsscripts34
teststests132
.vscodefolder2
dashboardfolder35
dockerfolder3
evalsfolder53
mirixfolder341

The agent writes

Requirements

Apps: Docker

Runtimes: Python >=3.10,<4.0

Databases: Neo4j, PostgreSQL, Redis, SQLite

API keys (by name): MIRIX_API_KEY

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Google Antigravity, Kiro, OpenCode, Amp, Roo Code, Cline, JetBrains Junie, Devin (ex-Windsurf)

Set it up

  1. This brain runs code automatically: 2 scripts. Review Makefile, setup.py before opening the folder in Claude Code. No step below turns a hook on for you.

    • Makefile: $(POETRY) install
    • setup.py: python setup.py
  2. Not scanned by AutoGineerThe author’s README also describes installing it with Docker Compose. Read its install section: AutoGineer did not scan that path. https://github.com/Mirix-AI/MIRIX/blob/9077e4b229dd8f61c5703b431a97788c6b61acfb/README.md#quick-start
  3. Not scanned by AutoGineerAutoGineer could not scan everything it runs. https://pypi.org/project/mirix/
  4. Created by Mirix AI. Published in Mirix-AI/MIRIX. Licence: Apache License 2.0.

Usage

AutoGineer overview, from the brain’s own files

  • Initialize a meta-agent with specific memory components.
  • Add conversation turns or tool-use logs to the memory store.
  • Retrieve context-aware memories based on user queries.
  • Trigger memory consolidation using the Auto-Dream endpoint.
  • Enable graph-based provenance for complex entity relationships.
“What did we discuss on MirixDB in last 4 days?”
The agent retrieves relevant conversation history and memory blocks from the last four days to answer the user's question.
“Deploy the service.”
The agent records the tool call, captures any resulting errors or successful fixes, and stores this as procedural memory for future reference.

Documentation by Mirix AI

Image: Mirix Logo

MIRIX - Multi-Agent Personal Assistant with an Advanced Memory System

Your personal AI that builds memory through screen observation and natural conversation

| 🌐 Website | 📚 Documentation | 📄 Paper | 💬 Discord

<!-- | [Twitter/X](https://twitter.com/mirix_ai) | [Discord](https://discord.gg/S6CeHNrJ) | -->


Key Features 🔥
  • Multi-Agent Memory System: Six specialized memory components (Core, Episodic, Semantic, Procedural, Resource, Knowledge Vault) managed by dedicated agents

  • Screen Activity Tracking: Continuous visual data capture and intelligent consolidation into structured memories

  • Privacy-First Design: All long-term data stored locally with user-controlled privacy settings

  • Advanced Search: PostgreSQL-native BM25 full-text search with vector similarity support

  • Graph Memory (optional): A provenance hypergraph over episodic and semantic memories in Neo4j, with n-ary facts that link entities through named roles and cite the memory rows they came from

  • Multi-Modal Input: Text, images, voice, and screen captures processed seamlessly

Results

Image: MIRIX-2.0 compared with other memory systems on user-centric and agent-centric tasks

MIRIX-2.0 compared with other memory systems. Each axis label gives the MIRIX-2.0 score; the value in parentheses is its lead over the strongest baseline on that axis, shown where MIRIX-2.0 leads.

  • (a) User-centric tasks (accuracy, %): conversational recall on LoCoMo and LongMemEval-S, and the document QA tracks of MemoryAgentBench (SHDocQA, MHDocQA, DetectiveQA). Baselines are A-Mem, Graphiti, MemoryBank, mem0 and HyperMem. LoCoMo uses graph memory with AutoDream; LongMemEval-S and document QA use graph memory alone.

  • (b) Agent-centric tasks (success rate, %): the six ALFWorld task types (Pick, Look, Clean, Heat, Cool, Pick Two) and five WebShop product categories (Fashion, Beauty, Electronics, Garden, Grocery), with GPT-6 Luna as the agent model. Baselines are no memory, AWM and ReasoningBank.

Quick Start

Step 1: Backend & Dashboard (Docker):

docker compose up -d --pull always

Step 2: Create an API key in the dashboard (http://localhost:5173) and set as the environmental variable MIRIX_API_KEY.

Step 3: Client (Python, mirix-client, https://pypi.org/project/mirix-client/):

pip install mirix-client

Now you are ready to go! See the example below:

from mirix import MirixClient

client = MirixClient(
    api_key="your-api-key",
    base_url="http://localhost:8531",
)

client.initialize_meta_agent(
    config={
        "llm_config": {
            "model": "gemini-3.6-flash",
            "model_endpoint_type": "google_ai",
            "api_key": "your-api-key-here",
            "model_endpoint": "https://generativelanguage.googleapis.com",
            "context_window": 1_000_000,
        },
        "embedding_config": {
            "embedding_model": "gemini-embedding-001",
            "embedding_endpoint_type": "google_ai",
            "api_key": "your-api-key-here",
            "embedding_endpoint": "https://generativelanguage.googleapis.com",
            "embedding_dim": 768,
        },
        "meta_agent_config": {
            "agents": [
                {
                    "core_memory_agent": {
                        "blocks": [
                            {"label": "human", "value": ""},
                            {"label": "persona", "value": "I am a helpful assistant."},
                        ]
                    }
                },
                "resource_memory_agent",
                "semantic_memory_agent",
                "episodic_memory_agent",
                "procedural_memory_agent",
                "knowledge_vault_memory_agent",
            ],
        },
    }
)

client.add(
    user_id="demo-user",
    messages=[
        {"role": "user", "content": [{"type": "text", "text": "The moon now has a president."}]},
        {"role": "assistant", "content": [{"type": "text", "text": "Noted."}]},
    ],
    session_id="sess-demo-001",
)

# Include tool activity when you want skills learned from the WORK PROCESS:
# tool errors, retries, and the fix that finally worked are the distiller's
# strongest signals. Pass tool results as role="tool" turns and/or a
# "tool_calls" list on assistant messages (OpenAI shape) — both are preserved
# in the session conversation store.
client.add(
    user_id="demo-user",
    messages=[
        {"role": "user", "content": [{"type": "text", "text": "Deploy the service."}]},
        {"role": "assistant", "content": "", "tool_calls": [
            {"function": {"name": "kubectl_apply", "arguments": "{\"file\": \"deploy.yaml\"}"}}
        ]},
        {"role": "tool", "name": "kubectl_apply", "content": "error: forbidden (missing RBAC)"},
        {"role": "assistant", "content": [{"type": "text", "text": "Fixed the RBAC role and redeployed successfully."}]},
    ],
    session_id="sess-demo-001",
)

memories = client.retrieve_with_conversation(
    user_id="demo-user",
    messages=[
        {"role": "user", "content": [{"type": "text", "text": "What did we discuss on MirixDB in last 4 days?"}]},
    ],
    limit=5,
)
print(memories)

For more API examples, see samples/run_client.py.

Auto-Dream Memory Consolidation

MIRIX also exposes an auto-dream endpoint for explicit memory cleanup and consolidation. Auto-dream reviews existing memories, merges duplicates, resolves stale/conflicting entries where possible, and writes the result back through the memory tools.

REST endpoint:

POST /memory/auto_dream?user_id=demo-user
Content-Type: application/json

{
  "mode": "experience",
  "dry_run": false
}

Supported mode values:

ModeMemory component(s) reviewed
coreCore memory blocks
episodicEpisodic memories
semanticSemantic memories
resourceResource memories
proceduralProcedural memories
knowledgeKnowledge Vault memories
experienceEpisodic, Semantic, and Knowledge Vault memories together

Use dry_run: true to fetch counts and inspect what would be processed without applying updates. The optional model field can override the auto-dream agent model for that request. For procedural mode, pass the target meta_agent_id and optionally last_n_sessions to distill recent session experiences.

Python client example:

result = client.auto_dream(
    user_id="demo-user",
    mode="procedural",
    meta_agent_id=meta_agent.id,
    last_n_sessions=3,
    dry_run=False,
)
print(result)
Graph Memory

MIRIX can index episodic and semantic memories into a provenance hypergraph stored in Neo4j. Entities become anchors, each extracted fact becomes an n-ary frame whose edges name the role each anchor plays, and every frame cites the memory rows it came from. With graph memory on, episodic and semantic retrieval enters through the graph, and Auto-Dream merges duplicate anchors on the graph instead of rewriting stored memories.

Graph memory is off by default. To turn it on:

  1. Start Neo4j 5.23 or later. docker compose --profile graph up -d starts Neo4j 5.26 with APOC; first set MIRIX_NEO4J_PASSWORD (at least 8 characters) in .env, because there is no default password.

  2. Install the Neo4j driver. It is in requirements.txt; after pip install -e ., run pip install "neo4j>=5.20,<6".

  3. Set MIRIX_ENABLE_GRAPH_MEMORY=true and MIRIX_NEO4J_PASSWORD to the password your Neo4j uses. MIRIX_NEO4J_URI and MIRIX_NEO4J_USER default to bolt://localhost:7687 and neo4j.

With graph memory on, POST /memory/auto_dream refines the graph only unless the request sets graph_only to false. Evaluation settings and commands are in evals/GRAPH_MEMORY.md.

Upgrading an Existing Database

Fresh databases get their full schema automatically at startup. Existing databases require manual migrations when upgrading to a version that alters tables — startup creates missing tables but never adds columns to existing ones. If migrations are pending, the server refuses to start and names the exact scripts to run.

For the skill-based procedural memory release, run against your database (in this order):

psql "$MIRIX_PG_URI" -f scripts/migrate_procedural_to_skill.sql
psql "$MIRIX_PG_URI" -f scripts/migrate_add_message_session_id.sql
psql "$MIRIX_PG_URI" -f scripts/migrate_add_message_session_id_phase2.sql   # outside a transaction (CREATE INDEX CONCURRENTLY)
psql "$MIRIX_PG_URI" -f scripts/migrate_add_conversation_message.sql
psql "$MIRIX_PG_URI" -f scripts/migrate_add_conversation_message_phase2.sql # outside a transaction
psql "$MIRIX_PG_URI" -f scripts/migrate_add_skill_experience.sql
psql "$MIRIX_PG_URI" -f scripts/migrate_add_agent_trigger_state.sql
psql "$MIRIX_PG_URI" -f scripts/migrate_backfill_procedural_scope.sql   # backfill filter_tags['scope'] from each skill's owning client

For the graph-memory release, which adds five provenance columns, also run:

psql "$MIRIX_PG_URI" -f scripts/migrate_add_graph_provenance_columns.sql

Each script is idempotent where possible and documents its own preconditions in its header. Run them once, then restart the server.

License

Mirix is released under the Apache License 2.0. See the LICENSE file for more details.

Contact

For questions, suggestions, or issues, please open an issue on the GitHub repository or contact us at [e-mail address on the upstream page](https://github.com/Mirix-AI/MIRIX/blob/9077e4b229dd8f61c5703b431a97788c6b61acfb/README.md)

Join Our Community

Connect with other Mirix users, share your thoughts, and get support:

💬 Discord Community

Join our Discord server for real-time discussions, support, and community updates: https://discord.gg/S6CeHNrJ

🎯 Weekly Discussion Sessions

We host weekly discussion sessions where you can:

  • Discuss issues and bugs

  • Share ideas about future directions

  • Get general consultations and support

  • Connect with the development team and community

📅 Schedule: Friday nights, 8-9 PM PST 🔗 Zoom Link: https://ucsd.zoom.us/j/96278791276

📱 WeChat Group

You can add the account ari_asm so that I can add you to the group chat.

Acknowledgement

We would like to thank Letta for open-sourcing their framework, which served as the foundation for the memory system in this project.

docs/security-integrity-review-2026-11-09.md

MIRIX 安全性與資料完整性修復

基準為 main 的 60cd444cc92d425f001d690734d901c78ed46b3c。 修復工作區位於 fix/security-snapshots-evaluation。

核對結果

使用程式碼檢查、修正前的失敗案例與回歸測試,確認以下 11 類問題存在。

問題修復內容驗證
API 身份驗證可繞過私有路由統一驗證 JWT/API key,使用 request state 保存驗證結果;client/org header 不再是憑證;無效 JWT 不降級接受其他身份ASGI 測試覆蓋匿名、偽造 header、無效 key/JWT 與有效憑證
client 修改/刪除缺少驗證client 查詢、更新、刪除要求自己的 dashboard JWT;限制跨組織與自行提升權限自己的 token 成功,其他 client 的 token 被拒;拒絕後不呼叫修改 manager
回應包含密碼雜湊公開 ClientResponse 與內部 Client 分開;登入仍保有內部雜湊HTTP 回應不含雜湊,實際 SQLite 登入驗證仍成功
Docker 共用 JWT/密碼預設值要求設定 JWT、PostgreSQL、Redis secret;JWT 拒絕舊公開預設值;服務埠限制在 loopback;Redis 啟用原生密碼驗證Compose 缺少任一必要 secret 時失敗;檢查所有公開埠;實際 Redis 匿名連線被拒
快照還原失敗卻顯示成功PostgreSQL 的 truncate 與 restore 在同一交易,SQL 錯誤立即中止;Neo4j 使用交易;失敗不印出 loaded實際 PostgreSQL 約束衝突保留還原前資料;Neo4j 約束衝突回滾圖清除
已刪記憶仍可搜尋補上 SQL 軟刪除條件;Redis 結果回查資料庫;圖引用只接受仍存在的記憶;不把孤立 anchor 當作記憶輸出SQLite 五種記憶搜尋、殘留快取、PostgreSQL 圖搜尋與 Neo4j 引用測試
不同數值錯誤合併保留符號、小數、日期、百分比、幣別、單位、順序與重複次數;frame 身份包含 literal;Dream 合併增加硬性檢查數值差異、相同事實、frame 身份與錯誤 LLM 合併建議測試
空快照留下舊圖空圖也必須執行交易式清除;區分「刻意未擷取圖」與「擷取失敗」將空快照還原到有舊節點的實際 Neo4j,結果為零節點
時間型別導致快照失敗對 Python/Neo4j 日期、時間、duration 等使用帶型別的 JSON 編碼實際 Neo4j 日期、時間與 duration 往返;保留奈秒精度及關係屬性
評測日期錯配使用 session 自己攜帶的日期,避免以 chunk 序號查找 session測試重疊視窗及不連續的 session 編號
QA-only 仍可修改記憶載入既有 agent;跳過初始化、ingest 與所有 Dream;加入寫入拒絕檢查初始化、尾端 Dream、記憶新增及 HTTP 寫入拒絕測試

另外補上:註冊完成後的管理員驗證、首次註冊的併發保護、API key 的 read-only 權限、user/org 與搜尋參數的租戶檢查、快照名稱路徑限制、 完整快照才發布,以及還原後清理相關 MIRIX 快取。 沒有 organization_id 的舊 client 也維持 default organization 範圍,不會因此 省略查詢的租戶條件。

驗證結果

  • 完整非 integration 測試:3,229 通過、52 跳過、242 排除。

  • 額外執行隔離 PostgreSQL/Neo4j integration 測試:9 通過。

  • Docker Compose 設定、Python 致命 lint、shell 語法、git diff --check 通過。

  • 實際 Redis:匿名存取被拒;有效密碼可存取。

主要新增測試:

  • tests/test_security_regressions.py

  • tests/test_auth_storage_regressions.py

  • tests/test_memory_identity_regressions.py

  • tests/test_snapshot_regressions.py

  • tests/test_eval_read_only_regressions.py

  • tests/test_docker_security.py

  • tests/test_security_storage_integration.py

測試使用隔離資料庫與模擬模型,沒有對正式資料執行刪除或還原,也沒有重新跑 付費 LLM 評測。此結果驗證所列缺陷及相關回歸,不代表完整的滲透測試或整個專案 沒有其他漏洞。

使用與相容性

  • SDK/評測程式需要有效 MIRIX_API_KEY;僅提供 client/org ID 不再能通過驗證。

  • 第一個 dashboard 帳號可 bootstrap;之後的註冊需要管理員 JWT。

  • Docker 使用前,設定獨立的 MIRIX_JWT_SECRET_KEY、MIRIX_PG_PASSWORD、 MIRIX_REDIS_PASSWORD。舊公開 JWT 預設值不再能啟動服務。

  • 新快照不覆寫同名目錄;PostgreSQL 工具須在 PATH 或 MIRIX_PG_BIN 中。 QA-only 需要既有 agent;保存快照時可用 --agents 納入 agents/messages。

  • 快照仍是指定資料表的備份,不是整個資料庫的完整備份。還原保留原有的 TRUNCATE ... CASCADE 行為,需留意依賴表並停止並行寫入。

  • PostgreSQL、Neo4j、Redis 不是單一共同交易。 各資料庫的失敗會明確回報; 若 PostgreSQL 已提交,後續 Neo4j/快取失敗無法回滾已提交的 PostgreSQL。

  • 已經被錯誤合併的舊記憶不會憑空復原;需從可信的原始資料或備份重新建立。

歷史上已外洩的 provider key 仍須由持有人撤銷。移除程式中的 literal 或 修改 Docker 設定不會使那些金鑰失效。

512 files · 499 not served here

Advantages

  • Supports multi-modal inputs including text, images, voice, and screen captures. evidence: README.md
  • Provides a provenance hypergraph to link entities and cite memory sources. evidence: README.md

Limitations

  • Existing databases require manual migration scripts when upgrading to versions that alter table schemas. evidence: README.md
  • Requires manual configuration and setup of external dependencies like PostgreSQL and optional Neo4j. evidence: README.md

Security

Risk level: Low risk

This brain runs

Agent instructions that run or fetch something (12)

  • .cursorrules: User-defined tools run in `ToolExecutionSandbox` for security
  • .cursorrules: Run tests with: `pytest tests/`
  • .cursorrules: Run linters before committing: `ruff check .` and `pyright`
  • .cursorrules: User-defined tools MUST run in `ToolExecutionSandbox`
  • CLAUDE.md: docker-compose up -d # starts PostgreSQL (5432), Redis (6379), API (8531), Dashboard (5173)
  • CLAUDE.md: docker-compose ps # verify all services healthy
  • CLAUDE.md: pip install -e .
  • CLAUDE.md: python scripts/start_server.py --port 8531
  • CLAUDE.md: python scripts/start_server.py --port 8899 # Terminal 1
  • CLAUDE.md: make format # ruff import sort + format
  • CLAUDE.md: make lint # ruff check + pyright
  • CLAUDE.md: make check # format + lint + test

Install scripts (2)

  • Makefile (make install): $(POETRY) install
  • setup.py: python setup.py
  • Low risk: network-instructions (CLAUDE.md:31)
  • Low risk: scripts-present (scripts/start_server.py)
  • Low risk: scripts-present (setup.py)

Attribution and licence

Created by
Mirix AI
First committed by
@wangyu-ustc
Declared authors
  • Mirix AI (declared in pyproject.toml)
Publisher
MIRIX-AI (Community)
Source
Mirix-AI/MIRIX · commit 9077e4b
Licence
Apache License 2.0 (files served here)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Mirix AI.

Install from source

499 of its files are not served here, so there is no ZIP. Mirix-AI/MIRIX at 9077e4b