SuperAPIAI Directory

sqlite-graph-memory

github.com · Other AI tools

sqlite-graph-memory is a local memory tool for MCP clients such as Claude Code, Cursor, and Codex, which builds a retrieval index from the user's existing Markdown notes (including Obsidian vaults). It uses vector search to find relevant note entry points and performs graph expansion along the [[wikilinks]] links in the notes, thereby recalling notes that are not directly mentioned in the question but are connected through links. The tool stores the index in a single SQLite file, requires no LLM API key, and is licensed under MIT. After installation, the index can be built and questions asked via the command line, and it can also be connected as an MCP server to AI coding assistants so that the assistant remembers what the user has written across sessions.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS · Linux

About this tool

sqlite-graph-memory is a local tool that provides persistent memory for AI coding assistants, suitable for Claude Code, Cursor, Codex, or other MCP-compatible clients. It reads the user's existing Markdown notes folder (Obsidian vaults also work), builds a vector retrieval index, and treats the [[wikilinks]] in the notes as a graph structure, performing associative expansion during retrieval.

Main capabilities:

  • Vector search locates relevant note entry points, then graph traversal follows the [[wikilinks]] to recall notes that are not directly named in the question but are connected through links.
  • The index is stored as a single SQLite file, requiring no graph database, ETL pipeline, or separate server.
  • No LLM API key, account, or token is required.
  • Supports incremental indexing: re-running sgm-index only re-embeds newly added or changed notes, and --full forces a full rebuild.
  • Provides the CLI commands sgm-index, sgm-ask, and sgm-doctor, as well as the MCP server sgm-mcp.
  • The optional [lite] installation uses ONNX Runtime without PyTorch, with an installation size of about 155 MB; [embeddings] uses PyTorch and is suitable for GPU scenarios.

Usage:

  1. Install Python 3.12 and run pip install 'sqlite-graph-memory[lite]'.
  2. Build the index: sgm-index ./notes. The first run downloads a search model of about 1.1 GB.
  3. Ask a question: sgm-ask --ab "your question here", which outputs two lists: DIRECT memory and ASSOCIATIVE memory.
  4. Configure the server in an MCP client, using the absolute path of the index folder. Claude Code, Codex, Cursor, VS Code, Gemini CLI, and others each have their own configuration method.
  5. It can also be run via uvx without a permanent installation.

Use cases:

  • Users who have a large number of Markdown notes and want AI coding assistants to remember this content across sessions.
  • Scenarios where notes are managed with tools such as Obsidian and the assistant is expected tofind related information by following links.
  • Scenarios requiring a localized memory solution with no API key and read-only access to notes.

Limitations and notes:

  • The tool only reads notes; it does not write to or edit notes.
  • The first run requires a network connection to download the model and uses about 1.3 GB of disk space.
  • sgm-ask always returns the most recent notes, even if the notes cannot answer the question, so users need to judge the relevance themselves.
  • sgm-ask writes turnstate.db and _brain_answer.txt in the current folder, which can be adjusted via environment variables.
  • On Intel Macs or older macOS versions, pay attention to the Python version to avoid uvx falling back to an older version that does not include [lite].
  • The default MCP cold start timeout is 180 seconds, which can be adjusted via BRAIN_RECALL_TIMEOUT.
  • Some tests have known failures on Windows, but this does not affect basic installation.
  • The project is an independent project and is not affiliated with or endorsed by Andrej Karpathy.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools