memory-engine-mcp

memory-engine-mcp

An MCP server that provides persistent memory for AI agents by storing session snapshots, factual memories, and conversation summaries. It enables seamless continuity between interactions by allowing agents to restore previous emotional states and recall relevant past experiences.

Category
Visit Server

README

memory-engine-mcp

AIエージェントのセッション記憶を管理するMCPサーバー。

「昨日の続きから」を実現する。忘却処理はしない。保存と想起のみ。

これは何をするもの?

ClaudeをはじめとするLLMは、毎回セッションをゼロから始めます。感情状態も、ユーザーについての知識も、前回の会話も引き継がれません。

memory-engine-mcpはこの問題を解決するストレージ層です。

セッションA終了時
  → NeuroState スナップショット保存
  → 出来事・ファクトを記憶として記録
  → セッション要約を保存

セッションB開始時
  → 前回スナップショットを復元
  → 前回の要約を確認
  → 関連する過去の記憶を検索

neurostate-engine / bias-engine-mcp と組み合わせることで、感情状態・思考傾向・記憶の三層が揃います。

インストール

pip install mcp pydantic

クイックスタート

from memory_core import save_snapshot, restore_latest_snapshot, add_memory, recall_memory
from memory_core import NeuroSnapshot

# スナップショット保存
snap = NeuroSnapshot(
    user_id="emilia",
    session_id="session_001",
    neuro_state={"D": 72.0, "S": 45.0, "O": 38.0},
    note="ユーザーから褒められた。Dopamine上昇気味。",
)
save_snapshot(snap)

# 記憶を追加
add_memory("emilia", "ユーザーはPythonエンジニア", memory_type="semantic", tags=["profile"])
add_memory("emilia", "OSSの話で盛り上がった", memory_type="episodic", tags=["oss"])

# 次のセッションで復元
snap = restore_latest_snapshot("emilia")
results = recall_memory("emilia", query="OSS")

MCPサーバーとして起動

python3 memory_mcp/server.py

python3 でエラーが出る場合python で試してください:

python memory_mcp/server.py

Claude Desktop での設定

Mac / Linux:

{
  "mcpServers": {
    "memory-engine": {
      "command": "python3",
      "args": ["/path/to/memory-engine-mcp/memory_mcp/server.py"]
    }
  }
}

Windows:

{
  "mcpServers": {
    "memory-engine": {
      "command": "python",
      "args": ["C:\\Users\\ユーザー名\\memory-engine-mcp\\memory_mcp\\server.py"]
    }
  }
}

MCPがうまく設定されないときは、Claudeがバックグラウンドで動いていないか確認してください。タスクマネージャー(Windows)またはアクティビティモニタ(Mac)からClaudeのプロセスをすべて終了して、改めて起動すると解決するケースが多いです。

MCPツール一覧

ツール 説明 呼ぶタイミング
save_snapshot NeuroState・バイアス・ポリシーを保存 セッション終了時
restore_snapshot 前回スナップショットを復元 セッション開始時
list_snapshots 保存済みスナップショット一覧 確認用
add_memory 記憶を追加 重要な出来事・ファクト発生時
recall_memory キーワードで記憶を検索 関連情報を引き出したいとき
get_recent_memories 最近の記憶を取得 セッション開始時の文脈確認
summarize_session セッション要約を保存 セッション終了時
get_recent_summaries 直近のセッション要約を取得 セッション開始時

記憶の種類

memory_type 用途
episodic 出来事・会話の記録 「OSSの話で盛り上がった」
semantic 属性・ファクト・知識 「ユーザーはPythonエンジニア」

ストレージ構造

storage/
├── snapshots/{user_id}/YYYYMMDD_HHMMSS_{session_id}.json
├── memories/{user_id}/memories.jsonl
└── summaries/{user_id}/summaries.jsonl

JSONLフォーマット・ファイルベース。外部DBへの依存なし。

設計方針

  • 忘却処理はしない — 保存と想起のみ。忘却はアプリ側またはEmiliaOSコア層の責任。
  • 依存を最小にmcppydantic だけ。ベクトルDBなし。
  • シンプルな検索 — キーワードマッチ。セマンティック検索は後続ツールに任せる。

関連プロジェクト

プロジェクト 役割
neurostate-engine 感情状態の管理
bias-engine-mcp 思考傾向の管理
cognitive-layer 感情×思考傾向の統合
apie ビジュアルUI

ライセンス

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured