Enhanced Memoryのロゴ

Enhanced Memory

コミュニティ
BjornMelin

Local SQLite memory for LangGraph agents, with provenance, TTL, export, and MCP.

公開者BjornMelin
リポジトリenhanced-mem-vector-rag
言語Python
フォーク
4
スター
16
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

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

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

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

  • コピーして使える設定

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

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

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

Enhanced Memory

CI Python 3.11+ License: MIT

Enhanced Memory gives agents local, durable memory. It composes LangGraph's native SQLite BaseStore with provenance, strict time-to-live (TTL) reads, deterministic export, and a standard-input/output Model Context Protocol (MCP) server.

It doesn't implement document ingestion, generic retrieval-augmented generation (RAG), crawling, agent orchestration, a hosted application programming interface (API), or another vector database. LangGraph owns storage semantics. FastMCP owns protocol behavior. SQLite owns persistence.

Install

Add the Python library to a project:

bash
uv add "enhanced-mem-vector-rag @ git+https://github.com/BjornMelin/enhanced-mem-vector-rag.git@v1.0.0"

Install the emvr-mcp command in an isolated environment:

bash
uv tool install "enhanced-mem-vector-rag @ git+https://github.com/BjornMelin/enhanced-mem-vector-rag.git@v1.0.0"

PyPI trusted publishing is tracked in issue #11. The Git tag remains the canonical install source until that publisher is verified.

For source development:

bash
git clone https://github.com/BjornMelin/enhanced-mem-vector-rag.git
cd enhanced-mem-vector-rag
uv sync --frozen
uv run pytest

Python API

Use MemoryService as the single owner of a local database connection:

python
from pathlib import Path

from emvr import MemoryRecord, MemoryService

with MemoryService(Path("memory.sqlite3")) as memory:
    record = MemoryRecord.create(
        kind="preference",
        content={"theme": "dark", "font_size": 15},
        source="settings-import",
        evidence=("user-confirmed",),
    )
    memory.upsert(
        ("users", "bjorn", "preferences"),
        "editor",
        record,
    )

    saved = memory.get(("users", "bjorn", "preferences"), "editor")
    assert saved is not None
    print(saved.content)

memory.native is a lifecycle-guarded LangGraph BaseStore, so you can pass it directly to graph.compile(store=...). Namespaces use non-empty tuples with non-empty labels that contain neither periods nor NUL bytes. The langgraph root is reserved. Namespace listing accepts * as a one-segment prefix or suffix wildcard.

The native surface supports filters, batch operations, TTL, and optional sqlite-vec indexing. Exact filters preserve JSON types, so booleans, numbers, arrays, and objects don't alias one another.

Semantic search is disabled by default. Construct the service with a LangGraph SQLite index configuration and an embedding function to enable cosine ranking. Other distance modes fail closed because the pinned SQLite adapter doesn't rank them consistently. The MCP server stays provider-free and supports exact lookup plus namespace and filter searches.

Semantic ranking supports the first 1,000 results per query. Narrow the namespace or filters instead of requesting a deeper semantic offset.

MCP server

The server uses standard input and output only. This keeps the default deployment local and avoids a remote authentication boundary.

json
{
  "mcpServers": {
    "enhanced-memory": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/BjornMelin/enhanced-mem-vector-rag.git@v1.0.0",
        "emvr-mcp"
      ],
      "env": {
        "EMVR_DB_PATH": "/absolute/path/to/memory.sqlite3"
      }
    }
  }
}

The server exposes nine tools:

  • memory_put, memory_get, memory_search, and memory_delete
  • memory_purge_namespace and memory_list_namespaces
  • memory_export, memory_sweep_expired, and memory_health

memory_put is an upsert. Every record stores its source, observation time, optional evidence, and a SHA-256 content digest. memory_export returns stable JavaScript Object Notation Lines (JSON Lines) ordered by namespace and key.

Persistence contract

Enhanced Memory preserves these storage guarantees:

  • SQLite uses write-ahead logging (WAL) with synchronous=NORMAL, foreign keys enabled, and a five-second busy timeout.
  • Expired records are swept before reads, searches, namespace listings, and exports, so callers don't receive stale records.
  • Managed content must be a JSON object with string keys and finite numbers. Integers must fit LangGraph's native 64-bit storage range, from -2^63 through 2^64 - 1.
  • TTL uses LangGraph's native minute-based sliding expiration semantics. Values must be finite, positive, and no more than 5,270,400 minutes (3,660 days).
  • Vector indexing is opt-in. LangGraph's SQLite package supplies sqlite-vec, but Enhanced Memory selects no embedding provider or model.
  • The on-disk schema is owned and migrated by langgraph-checkpoint-sqlite.

See architecture, support, and security for the operating boundary.

Development

Run every local quality gate before opening a pull request:

bash
uv sync --frozen
uv run ruff format --check .
uv run ruff check .
uv run pyright
uv run pytest
uv build

License

MIT. See the license.

インストール

TypingMind
{
  "mcpServers": {
    "enhanced-mem-vector-rag": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/BjornMelin/enhanced-mem-vector-rag.git@v1.0.0",
        "emvr-mcp"
      ],
      "env": {
        "EMVR_DB_PATH": "<EMVR_DB_PATH>"
      }
    }
  }
}

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

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Enhanced 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

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

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

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

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

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

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

よくある質問

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

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

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

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

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

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

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

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

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

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

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

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

関連するMCPサーバー

すべて見る

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

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