プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。レビューとアカウント機能は今後のステップで始まります。
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説

sqlite-graph-memory

作者:tonydziバージョン 0.3.7i★ –iパソコンで動く
レジストリ名io.github.tonydzi/sqlite-graph-memory

インストール

概要

作者による説明(英語の原文)

Recall over your markdown notes: vector search plus your [[wikilinks]] as a graph, in SQLite.

PopNx MCPの3つの柱

この3つを1つのスコアにまとめることはしません。意見、測定、人気はそれぞれ別のものだからです。

できること

このサーバーのやさしい解説はまだ書いていません。以下はレジストリから読み取った事実です。

  • 接続方法: パソコンで動く
  • トランスポート: stdio
  • カテゴリ: 検索・AIの記憶
  • 入力が必要なもの:BRAIN_INDEX_DIR

インストール

使っているAIアプリを選んで、設定をコピーしてください。

インストールの前に

  • 基本チェック:1項目中1項目に合格
  • あなたのパソコンで、あなたのユーザーと同じ権限(ファイル、ネットワーク、アプリ)で動きます。
  • 自分で入力するもの: BRAIN_INDEX_DIR, TURNSTATE_DB

必要なもの

  • PyPIPythonのuvのインストール(uvxコマンドに必要)

どのアプリを使っていますか?

上でアプリを選んでください。選んだアプリを覚えておくので、次からはボタンに「…にインストール」と表示されます。

Claude Desktop → Settings → Developer → Edit Config を開き、claude_desktop_config.json にこれを貼り付けます

{
  "mcpServers": {
    "sqlite-graph-memory": {
      "command": "uvx",
      "args": [
        "sqlite-graph-memory"
      ],
      "env": {
        "BRAIN_INDEX_DIR": "your-value",
        "TURNSTATE_DB": "your-value"
      }
    }
  }
}

ターミナルでこれを実行します

claude mcp add sqlite-graph-memory --env BRAIN_INDEX_DIR=your-value --env TURNSTATE_DB=your-value -- uvx sqlite-graph-memory

動かす前に、空欄の値を入力してください。

Cursorで開く

または、設定を自分でコピーする

プロジェクトの .cursor/mcp.json、または ~/.cursor/mcp.json に貼り付けます

{
  "mcpServers": {
    "sqlite-graph-memory": {
      "command": "uvx",
      "args": [
        "sqlite-graph-memory"
      ],
      "env": {
        "BRAIN_INDEX_DIR": "your-value",
        "TURNSTATE_DB": "your-value"
      }
    }
  }
}

ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。

VS Codeで開く

または、設定を自分でコピーする

プロジェクトの .vscode/mcp.json に貼り付けます

{
  "servers": {
    "sqlite-graph-memory": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "sqlite-graph-memory"
      ],
      "env": {
        "BRAIN_INDEX_DIR": "your-value",
        "TURNSTATE_DB": "your-value"
      }
    }
  }
}

ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。

これはパソコンで動くサーバーですが、ChatGPTがつなげるのはインターネット上のサーバーだけです。ほかのアプリを選んでください。

選んだアプリは、この端末のCookieに保存されます。アカウントは不要です。

自分で入力する値

  • BRAIN_INDEX_DIR 必須 env
    Directory holding the index. Build it once with `sgm-index /path/to/notes`.
  • TURNSTATE_DB env
    SQLite file for recall telemetry.

この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。

できること

パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。

基本チェックi

誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月6日にチェック

  • ✓ 合格

    作者とリポジトリが一致

    レジストリ名は、リポジトリを所有するGitHubアカウント tonydzi で確認済みです

  • … 未チェック

    今もメンテナンスされている

    このリポジトリはまだGitHubから読み取っていません

  • … 未チェック

    ライセンスがある

    このリポジトリはまだGitHubから読み取っていません

  • – 対象外

    エンドポイントが応答する

    これはパソコンで動くため、インターネット上のエンドポイントはありません

  • – 対象外

    OAuthでサインイン

    パソコンで動き、代わりにローカルの設定を使います

  • … 未チェック

    ツールの説明に隠れた指示がない

    パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです

検索・AIの記憶のほかのサーバーとの比較i

  • このカテゴリのほかの7240件のうち0%よりスターが多い
  • このカテゴリのほかの7240件のうち99%より最近レジストリに公開
  • 基本チェックの結果が、このカテゴリのほかの7240件のうち100%と同じかそれ以上

レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。

よくある質問

sqlite-graph-memoryは安全ですか?

当てはまる基本チェック1項目のうち1項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。

どんなキーやコードが必要ですか?

入力が必要なもの:BRAIN_INDEX_DIR

パソコンで動きますか、それともクラウドですか?

あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。

今もメンテナンスされていますか?

GitHubリポジトリの最終更新は–、最新バージョン(0.3.7)がレジストリに届いたのは今日です。

どのアプリで使えますか?

Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにPython (uv)も必要です。

代わりに使えるものは?

同じカテゴリには:Context7, Codebase Memory, Exa

代わりの候補

同じカテゴリで、ほかの作者が作ったサーバー。スターの多い順。

カードの見方:★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i

Context7

作者:upstash

Up-to-date docs for AI agents

パソコンでもクラウドでも★ 64,224MIT3 日前更新
インストール

Codebase Memory

作者:DeusData

Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.

パソコンで動く★ 48,148MIT20 日前更新
インストール

Exa

作者:exa-labs

Connect AI agents to Exa for web search, content fetching, and multi-step research.

クラウドで動く★ 5,213MIT44 日前更新
インストール

作者のREADME

READMEを開く

作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。

sqlite-graph-memory: persistent memory for Claude Code, Cursor and Codex over your own markdown notes

Your coding agent remembers what you already wrote down, and reaches the note a plain search misses by following the links between your notes. It is an MCP server and a CLI over any folder of markdown, Obsidian vaults included: pip install, point it at the folder, and Claude Code, Cursor, Codex or any other MCP client can recall from it.

Your agent forgets everything between sessions, and plain vector search gives it back flat, unrelated chunks. This gives it associative recall over your own markdown notes: vector search finds the entry points, the `[[wikilinks]]` you already wrote are the graph. One SQLite file, no graph database, no ETL pass, no server.

Install in your client

Already using your own agent rules and projects? The Russian existing-setup guide combines this memory backend with the optional starter-kit method, preserves existing settings, and checks recall in a fresh chat. Install one memory connection per client; the starter-kit memory plugin and manual registration are alternatives.

Build the index once (any folder of markdown; uv gives you uvx):

BRAIN_INDEX_DIR=$HOME/.sgm-index uvx --python 3.12 --from 'sqlite-graph-memory[lite]' sgm-index ~/notes

--python 3.12 is deliberate. onnxruntime has no wheels for Python 3.14 on an Intel Mac, or on Apple Silicon below macOS 14. On such a machine an unpinned uvx falls back to release 0.3.5, which has no [lite], and sgm-index then stops and asks for [embeddings].

Then point your client at the server. Use the absolute path of that index folder.

Cold-start timeout (0.3.5 and later). The MCP server starts recall in a separate process with a default deadline of 180 seconds; a first call on a clean Windows install took 89 s, which the old fixed 60 s always cut off. Override with BRAIN_RECALL_TIMEOUT (integer seconds, 1 to 600; invalid values return an error). Your MCP client's own tool timeout must also allow the longer call. On 0.3.3 and earlier the deadline is a fixed 60 s: upgrade, or use sgm-ask --ask directly, and do not report MCP recall as verified merely because the CLI works.

Claude Code

claude mcp add sqlite-graph-memory -e BRAIN_INDEX_DIR=$HOME/.sgm-index -- uvx --python 3.12 --with 'sqlite-graph-memory[lite]' sqlite-graph-memory

Cursor (~/.cursor/mcp.json; Claude Desktop, Zed and Windsurf take the same mcpServers block)

{

"mcpServers": { "sqlite-graph-memory": { "command": "uvx", "args": ["--python", "3.12", "--with", "sqlite-graph-memory[lite]", "sqlite-graph-memory"], "env": { "BRAIN_INDEX_DIR": "/absolute/path/to/.sgm-index" } } } }

VS Code (.vscode/mcp.json in the workspace)

{

"servers": { "sqlite-graph-memory": { "type": "stdio", "command": "uvx", "args": ["--python", "3.12", "--with", "sqlite-graph-memory[lite]", "sqlite-graph-memory"], "env": { "BRAIN_INDEX_DIR": "/absolute/path/to/.sgm-index" } } } }

Codex (~/.codex/config.toml)

[mcp_servers.sqlite-graph-memory]

command = "uvx" args = ["--python", "3.12", "--with", "sqlite-graph-memory[lite]", "sqlite-graph-memory"] env = { BRAIN_INDEX_DIR = "/absolute/path/to/.sgm-index" }

Size, du -sh of a fresh Python 3.12 venv on an x86_64 Mac (1 Nov 2026): the base install is 26 MB and has no torch (numpy only, enough for the graph half and the SQLite ledger); with [embeddings] (torch) it is 879 MB, 540 MB of that torch 2.2.2 CPU. With [lite], the same two models on ONNX Runtime and no torch, it is 155 MB (Windows, Python 3.12, 3 Nov 2026), installs in 12 s, and one MCP recall on the 202-note bench vault took 7.0 s against 33.8 s through torch on the same machine, with the same top hits and scores. [lite] is picked automatically when installed; SGM_BACKEND=torch forces torch (for a GPU). An index built by either backend is searched correctly by the other. Already installed with pip? Replace uvx --python 3.12 --with ... sqlite-graph-memory by sgm-mcp (examples/mcp-config.json). Agents that read files first: llms.txt.

Three commands

pip install 'sqlite-graph-memory[lite]'

sgm-index ./notes sgm-ask --ab "In which programming language is the tool behind Project Ouzel written?"

On an Intel Mac, use Python 3.12 with pip install. On a newer Python it can quietly install 0.3.5, which has no [lite].

./notes is any folder of markdown notes. Re-running sgm-index only re-embeds notes that are new or changed since the last run (tracked by a manifest next to the index); pass --full to force a complete rebuild.

To get exactly the output below, use the 202-note synthetic vault from this repo (it is not inside the pip package):

git clone --depth 1 https://github.com/tonydzi/sqlite-graph-memory && cp -R sqlite-graph-memory/bench/vault ./notes

Real output, top 5 of 12:

--- DIRECT memory (vector) ---
  1. [ 1.66] project-ouzel
  2. [ -1.33] project-avocet
  3. [ -1.79] tool-cobbleset
  4. [ -2.44] meeting-2025-10-21-lighthouse-sync
  5. [ -2.70] person-severin-ibarrondo

--- ASSOCIATIVE memory (vector+graph) ---

  1. [ 1.66] project-ouzel
  2. [ 1.14] tool-lanternfish <== +graph
  3. [ -1.33] project-avocet
  4. [ -1.79] tool-cobbleset
  5. [ -2.44] meeting-2025-10-21-lighthouse-sync

The answer lives in tool-lanternfish ("Lanternfish is written in Elixir"). The question never names Lanternfish, so the vector pass does not find it in the top 12 at all. project-ouzel links to it, so one graph hop puts it second.

If that hop found something your vector search missed, a star is how other people with a notes folder find this repo. sgm-ask --ab asks the same once per machine, in a terminal only; SGM_NO_STAR_PROMPT=1 turns it off.

That is the idea in one query, and it is not a blanket win. On this same vault vector-only ranks ahead of graph mode overall; the numbers are in bench/. --ab exists so you can measure which one wins on your own notes.

What it is

Graph RAG on SQLite for AI agents — a working pilot, not a framework. It is the extracted memory layer of a personal "second brain" agent setup: vector search finds the entry points, the [[wikilinks]] you already wrote by hand are the graph, and dense similarity orders what the hop dragged in (a cross-encoder rerank is opt-in with --rerank; see below for why it is no longer the default). SQLite is the only database (schema.sql).

Status: pilot, and the word is load-bearing: it runs daily in one real setup (an index of ~28k curated notes, ~93k chunks, rebuilt nightly from a ~270k-file Obsidian vault driven by Claude Code), but it is deliberately minimal and makes no attempt to be general — see What's intentionally missing, which is where the uneven test coverage is described. Published as the companion code for an upcoming write-up on lightweight Graph RAG for agents; the one design note that is already written is docs/bitemporal.md.

Why

Most Graph RAG stacks assume a graph database, an ETL pipeline, and an entity-extraction pass — HippoRAG (arXiv:2405.14831) derives its KG that way, and Graphiti/Zep maintain a temporal one. For a single-user agent over a markdown knowledge base, all three are overkill:

  • The graph already exists — Obsidian/Logseq/plain-markdown users hand-curate their edges as [[wikilinks]], and brain_ask.py just parses them. No extraction pass, and edge quality beats anything a model would mine.
  • SQLite is enough — the only things worth persisting are derived state (a per-turn ledger) and telemetry, and both are defined in schema.sql. One file, stdlib driver, zero ops.
  • Measure before adding a stage. The pilot shipped a cross-encoder reranker from day one; measured later, it lowered recall on long queries (our 184-question gold set: body nDCG@12 0.640 reranked vs 0.815 dense; DolphinBench Riley slice, 1000 sessions: R@5 0.48 vs 0.61). Since 0.3.7 it is off by default and stays available as --rerank / SGM_RERANK=1.

So the pilot's bet: *vector retrieval for entry points, hand-curated wikilinks for association, SQLite for everything that must persist.* All steps live in one file, brain_ask.py, in that order.

Architecture

Three layers, three failure-isolated components:

markdown notes (with [[wikilinks]])

│ ├── index_notes.py chunk + embed (e5-base) → .npy/.pkl index │ ├── brain_ask.py recall pipeline: │ 1. dense retrieve top-60 chunks, dedup by file │ 2. --graph +1-hop wikilink neighbours of top-15 hits (max 40) │ 3. order dense similarity → top-12 │ (--rerank: cross-encoder instead, opt-in) │ 4. --ab run vector-only AND vector+graph, diff, │ log the delta to SQLite (ab_recall) │ └── turnstate_hook.py agent Stop-hook: after every assistant turn, parse the transcript tail and append one row (ask, summary, files, tools, commands, decisions) to SQLite (turns). 0 LLM tokens, pure stdlib. turnstate_show.py = read-only viewer.

schema.sql documents both tables. The graph is not materialized in SQL: brain_ask.py parses edges from the notes at query time, bounded to 1 hop / 40 neighbours. That keeps the graph permanently in sync with the notes at zero maintenance cost; materialize an edge table only when hop depth or corpus size demands it.

Design choices that survived contact with reality
  • Graph expansion is candidate generation, not ranking (brain_ask.py). Neighbours go into the same ranking pool as vector hits, so an irrelevant linked note gets buried. That is what makes 1-hop expansion safe to leave on.
  • Entity gate (looks_like_entity in brain_ask.py). A/B telemetry showed graph expansion helps *theme* queries ("approaches to agent memory") but hurts *name/tool* lookups ("NotebookLM"): a name's card links to everything, so the hop pulls in noise. The heuristic in brain_ask.py is deliberately conservative, and switches the graph off only for name-shaped queries.
  • Crash-safety as a policy. The graph hop (brain_ask.py) and the Stop-hook (turnstate_hook.py) are both wrapped, so any failure degrades to the previous behavior: vector-only recall, no ledger row. A memory layer must never make the agent worse than having no memory layer.
  • **Measure, do

冒頭だけを表示しています。続きはリポジトリで読めます

PopNxに聞く