Metronix Memoryのロゴ

Metronix Memory

組織
mtrnix

Self-hosted AI agent memory — MCP memory server with durable recall for agents

公開者mtrnix
リポジトリmetronix-memory
言語Python
フォーク
16
スター
107
利用可能なツール
0
通信方式stdio
ライセンスApache-2.0
リンク
  • ツールをAIワークフローに接続

    Metronix Memoryは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには107件のスターと16件のフォークがあります。

Metronix Memory

Self-hosted AI agent memory — an MCP memory server with durable recall, hybrid RAG, and Neo4j graph context.

Metronix is self-hosted memory infrastructure for AI agents: ingest files and SaaS knowledge, retrieve with dense + sparse + graph context, store durable facts and preferences per agent, and keep long-lived knowledge fresh as projects change.

What you get

  • Durable memory for every agent — facts, preferences, and pinned context with workspace and agent scoping
  • Hybrid knowledge retrieval — dense + SPLADE sparse + Neo4j graph context, with source citations
  • Self-hosted control — Docker Compose stack, bundled local models, optional external answer generation
  • One integration surface — MCP memory server today; REST and OpenAI-compatible APIs when you need them

Quick start

Requirements: Docker with ≥6 GB RAM (8 GB recommended) and ~15 GB free disk.

bash
# One-liner (latest tagged release)
curl -fsSL https://mtrnix.com/install.sh | bash

# Or clone and install
git clone https://github.com/mtrnix/metronix-memory.git
cd metronix-memory
./install.sh                              # agent memory (default)
# ./install.sh --mode answers --openwebui -y   # optional chat UI + answers
curl http://localhost:8000/health
# {"status":"ok"}

Then connect an agent: Connecting to an agent.

Full install (prerequisites, .env, ports, troubleshooting): install.md.

Example in 5 minutes: store and find a memory

Once the stack is up (the first image build takes 10–15 minutes), this takes a few minutes. The sample output below is from a manual run; IDs and scores will differ on your stack. It needs curl and jq, and is run from the repository root, where .env lives.

1. Check the stack.

bash
curl http://localhost:8000/health
# {"status":"ok"}

2. Set an admin password and restart the API. On a new installation (empty users table), add a password for the built-in admin@metronix.local account (choose your own, at least 8 characters) to .env:

ini
AUTH_PASSWORD=<your-password>

AUTH_PASSWORD only seeds the first admin: at startup the API creates admin@metronix.local when the users table is empty and does nothing otherwise. Changing it later does not change the password of an existing account. If you already have a running installation, skip the .env change and use your current admin credentials in step 3. To change the password of an existing account, an admin can send PATCH /api/v1/users/{user_id} with {"password": "<new-password>"} (admin token required, minimum 8 characters).

On a new installation, recreate only the API container so it picks up .env:

bash
docker compose up -d --no-deps --force-recreate metronix-core
curl http://localhost:8000/health
# {"status":"ok"}

3. Log in and create a personal API key. The shared METRONIX_MCP_API_KEY only opens /mcp. The memory tools and the REST memory API need a user identity, so create a personal mtk_ key (it is shown once):

bash
LOGIN=$(curl -fsS -X POST http://localhost:8000/api/v1/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"email":"admin@metronix.local","password":"<your-password>"}')
ADMIN_JWT=$(echo "$LOGIN" | jq -r .token)
USER_ID=$(echo "$LOGIN" | jq -r .user_id)
MTK=$(curl -fsS -X POST "http://localhost:8000/api/v1/users/$USER_ID/api-keys" \
  -H "Authorization: Bearer $ADMIN_JWT" -H 'Content-Type: application/json' \
  -d '{"label":"quickstart"}' | jq -r .raw_key)
echo "key prefix: ${MTK:0:4}"
# key prefix: mtk_

4. Over MCP (the path agents use): store, search, list.

bash
mcp() { curl -fsS -X POST http://localhost:8000/mcp \
  -H "Authorization: Bearer $MTK" -H "X-Agent-Id: my-agent" \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -d "$1" | sed -n 's/^data: //p' | jq '.result.structuredContent'; }

mcp '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"metronix_memory_store","arguments":{"agent_id":"my-agent","workspace_id":"MTRNIX","content":"The staging database password rotates every 30 days.","tags":["quickstart"]}}}'
# {
#   "id": "30424ce432bd4302929a73c41eaaaa15",
#   "content_hash": "b5b6e76c2b41604dc86792982a55d4bac4b774098da6d9d8ebaccab01a9cb092",
#   "deduped": false
# }

mcp '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"metronix_memory_search","arguments":{"agent_id":"my-agent","workspace_id":"MTRNIX","query":"how often does the staging password change","top_k":3}}}' \
  | jq '.results[] | {score, content: .record.content}'
# {
#   "score": 0.75,
#   "content": "The staging database password rotates every 30 days."
# }

mcp '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"metronix_memory_list","arguments":{"agent_id":"my-agent","workspace_id":"MTRNIX","limit":5}}}' \
  | jq '.records[] | {id, kind, content}'
# {
#   "id": "30424ce432bd4302929a73c41eaaaa15",
#   "kind": "fact",
#   "content": "The staging database password rotates every 30 days."
# }

agent_id in the arguments must match the X-Agent-Id header. With the shared METRONIX_MCP_API_KEY as the Bearer token, metronix_status and metronix_search_fast work, but metronix_memory_* returns AUTH_REQUIRED: metronix_memory_search: unauthorized agent memory access.

5. Over REST: store, search, list. The same key works for the REST memory API, and both paths see the same records:

bash
curl -fsS -X POST "http://localhost:8000/api/v1/memory/records?workspace_id=MTRNIX" \
  -H "Authorization: Bearer $MTK" -H 'Content-Type: application/json' \
  -d '{"content":"Production deploys happen on Tuesdays.","agent_id":"my-agent","scope":"per_agent","kind":"fact","tags":["quickstart"]}' \
  | jq '{id, workspace_id, agent_id, scope, kind, content, status}'
# {
#   "id": "c131d23f7361448a9b8f8d9712663b86",
#   "workspace_id": "MTRNIX",
#   "agent_id": "my-agent",
#   "scope": "per_agent",
#   "kind": "fact",
#   "content": "Production deploys happen on Tuesdays.",
#   "status": "active"
# }

curl -fsS -X POST "http://localhost:8000/api/v1/memory/search?workspace_id=MTRNIX" \
  -H "Authorization: Bearer $MTK" -H 'Content-Type: application/json' \
  -d '{"query":"when do production deploys happen","agent_id":"my-agent","top_k":3}' \
  | jq '.results[] | {score, content: .record.content}'
# {
#   "score": 0.75,
#   "content": "Production deploys happen on Tuesdays."
# }
# {
#   "score": 0.15,
#   "content": "The staging database password rotates every 30 days."
# }

curl -fsS "http://localhost:8000/api/v1/memory/records?workspace_id=MTRNIX&agent_id=my-agent&limit=5" \
  -H "Authorization: Bearer $MTK" | jq '.records[] | {id, kind, content}'
# {
#   "id": "c131d23f7361448a9b8f8d9712663b86",
#   "kind": "fact",
#   "content": "Production deploys happen on Tuesdays."
# }
# {
#   "id": "30424ce432bd4302929a73c41eaaaa15",
#   "kind": "fact",
#   "content": "The staging database password rotates every 30 days."
# }

Two differences from docs/API.md that matter here. scope is lowercase (per_agent, global, session); the uppercase PER_AGENT shown there returns HTTP 422. And workspace_id=default, also shown there, is accepted although no such workspace exists (only MTRNIX is listed), so records land in a separate, unlisted workspace — pass MTRNIX or omit the parameter.

⭐ Star us if you build agents that remember.

Why Metronix

OptionWhat it gives youWhat Metronix adds
Vector DBSimilarity searchIngestion, MCP tools, durable agent memory, sparse + graph retrieval
Long contextMore tokens in one promptPersistent memory across sessions, scoping, freshness
Chat historyTranscript recallStructured facts/preferences, temporal knowledge, reusable MCP context
RAG frameworkBuilding blocksOperational backend: connectors, APIs, MCP, memory lifecycle

Benchmarks

Headline gate: LongMemEval-S Recall@10 95.4% under benchmark-protocol v1.0 (directional N=1; same answer model, same blind judge).

BenchmarkScopeLayer BRetrieval / signalStatus
LoCoMo1,986 QA in the pinned dataset¹52.8%Recall@10 85.3%directional, results not committed in this repo · harness
LongMemEval-S500 questions59.0%Recall@10 95.4%directional, results not committed in this repo · harness
MemoryAgentBench2,800 tasks63.6%Accurate Retrieval 84.7% · EventQA blended 86.8%external, not reproduced in this repo
EventQAMAB 65K + 131K86.8% blended98.0% @ 65K · 94.8% @ 131Kexternal, not reproduced in this repo
BEAM 100K400 questions32.1%Recall@10 2.9% · Layer B is the meaningful figureexternal, not reproduced in this repo

Pattern: retrieval usually finds the evidence; answer synthesis and preference following remain the hard part. Details: docs/benchmarks/longmemeval.md.

Directional = single run (N=1); the run files, manifests and the benchmark-protocol v1.0 text are not in this repository, so these numbers cannot be checked from it. External = no harness in this repository.

¹ locomo10.json at upstream commit 3eb6f2c, SHA-256 as pinned in benchmarks/locomo/README.md: 1,986 questions in 10 conversations; categories 1–4 (the harness default) = 1,540, category 5 (abstention) = 446. This table previously said 1,982, which does not match the file; which subset produced 52.8% / 85.3% is not recorded in this repository.

Retrieval (passage recall@5), reproducible

Multi-hop passage retrieval on the HippoRAG evaluation sets. Per-question results are committed in benchmarks/musique/results/2026-09-27/; the values below are recomputed from those files.

ConfigurationMuSiQue R@5 (500 held-out)2Wiki R@5 (1,000)
Production defaults (BFS graph channel, signal fusion)58.2571.85
Opt-in learned "ppr+" (PPR channel + learned fusion)62.8085.65

Caveats:

  • "ppr+" and the learned fusion are off by default (METRONIX_RETRIEVAL_GRAPH_PPR_ENABLED=false, METRONIX_RETRIEVAL_FUSION_MODE=signal).
  • This measures retrieval recall, not answer accuracy: no EM/F1 was run.
  • The MuSiQue graph is the ready-made OpenIE graph released by HippoRAG (extracted by Llama-3.3-70B), not one built by Metronix's own extractor. A graph extracted by Metronix itself (qwen2.5:3b) was measured only on a 30-question MuSiQue slice: it is much sparser (the PPR channel alone reaches the last-hop passage for 9 of 30 questions vs 29 of 30 on an oracle graph, REPORT item 7), and learned "ppr+" is +13.3 R@5 over production there with a 95% CI of 3.3 to 23.3 (research note §5.10). That slice is too small to size the gain on graphs Metronix extracts itself.
  • The 2Wiki title-mention graph structurally favours the gold passages, so the 2Wiki gain is optimistic.
  • The learned fusion was fitted on the other 500 MuSiQue questions; single run on CPU.
  • Both configurations are below HippoRAG 2 (74.7 / 90.4 as quoted in the research note §5.8) and below plain NV-Embed-v2 on MuSiQue. Not a state-of-the-art claim.

Commands and verification: docs/benchmarks/multihop-retrieval.md.

Connect an agent

RuntimeGuide
Any MCP clientConnecting to an agent · prompts.md
HermesNative provider · MCP guide
Cursor · VS Code (Copilot)Cursor · VS Code
Claude Desktop / CodeDesktop · Code
OpenCode · Codex · OpenClawOpenCode · Codex · OpenClaw
LangChain · LangGraph · LlamaIndexLangChain · LangGraph · LlamaIndex
SDKs · n8nPython · Go · n8n

Full index: docs/README.md.

Architecture

One-way layers — each level only imports downward:

text
L6  api/            REST + OpenAI-compatible API + MCP HTTP mount
L5  channels/       Legacy Telegram, Discord, Slack integrations
L4  agent/          Intent router and compatibility shims
L3  services/       Connectors, LLM, MCP, memory, auth, workspaces, knowledge
L2  processing/     Ingestion, retrieval, freshness pipeline
L1  storage/        PostgreSQL, Qdrant, Neo4j, Redis clients
L0  core/           Config, models, events, plugin interfaces
PipelineWhat it does
IngestionFetch → parse → chunk → embed → store (connectors + files)
RetrievalClassify → expand → recall → rerank → score → answer (dense + sparse + graph)
FreshnessDetect stale or conflicting memory and knowledge
MemoryStore → search → review → assemble (workspace / agent scoped)

Interactive diagram (offline): docs/architecture-diagram.html.

Admin console (optional)

Open-source web UI for connectors, uploads, channels, and health — presentation-only over the REST API:

bash
docker compose --profile admin up -d --build   # → https://localhost:3000

Details: frontend/README.md. The broader Control Center product is separate and not in this repo.

Documentation

DocPurpose
install.mdFull install, ports, troubleshooting
connecting_to_agent.mdMCP setup for any agent
prompts.mdPaste-ready agent setup prompts
docs/MCP_API.mdMCP tool reference
docs/API.mdREST API reference
docs/README.mdDocumentation index
CONTRIBUTING.mdHow to contribute

Development

bash
make dev              # uvicorn --reload
make test             # pytest unit tests
make lint             # ruff check + format check
make typecheck        # mypy src/metronix/
make migrate          # alembic upgrade head

FAQ

Is Metronix hosted?
No — it is self-hosted. You run the backend and choose where data lives.

Can multiple agents share one backend without leaking memory?
Yes. Memory is scoped by workspace and agent_id. Share a workspace for org knowledge; keep private memory per agent.

Is this for Raspberry Pi or zero-latency voice loops?
No. Metronix is a server-side backend. Run it on a machine with enough RAM, and have edge clients connect over REST/MCP.

Native Hermes provider vs MCP?
Use the native provider for automatic prefetch/write-through; use MCP for explicit knowledge-base tools. They complement each other — see Hermes MCP guide.

How does MCP authentication work?
Local/self-hosted defaults use AUTH_ENABLED=false with METRONIX_MCP_API_KEY. Hosted deployments with AUTH_ENABLED=true require a user JWT instead — see install.md and connecting_to_agent.md.

How do I verify memory actually works?
Store a distinctive record, then search via REST or metronix_memory_search. Do not rely only on asking an LLM “do you remember X?” — see install.md verify steps and connecting_to_agent.md.

Contributing & support

Bug reports and PRs welcome — see CONTRIBUTING.md.
Issues: github.com/mtrnix/metronix-memory/issues.

License

Apache License 2.0. See LICENSE.

Metronix MemoryのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Metronix Memoryに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Metronix Memoryをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Metronix MemoryのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "metronix-memory": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてMetronix MemoryのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Metronix MemoryのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Metronix Memoryを使ってこのタスクを手伝ってもらえますか?
Metronix Memory
はい、読みました。
Metronix Memoryで調べた結果をお伝えします。

よくある質問

Metronix Memory MCPサーバーは何に使いますか?

Metronix Memoryは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでMetronix Memory MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでMetronix Memoryを利用できます。

TypingMindでMetronix Memory MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Metronix Memoryを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Metronix Memory MCPをTypingMindに接続するにはどうすればよいですか?

Metronix MemoryはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでMetronix Memory MCPのどのようなツールを利用できますか?

Metronix MemoryはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Metronix Memory MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Metronix Memoryで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇