Enhanced Memory logo

Enhanced Memory

Community
BjornMelin

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

PublisherBjornMelin
Repositoryenhanced-mem-vector-rag
LanguagePython
Forks
4
Stars
16
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Enhanced Memory exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    16 stars and 4 forks from the linked repository.

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.

Installation

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>"
      }
    }
  }
}

Use Enhanced Memory MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Enhanced Memory is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Enhanced Memory as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Enhanced Memory MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "enhanced-mem-vector-rag": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Enhanced Memory MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Enhanced Memory MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Enhanced Memory to help me with this task?
Enhanced Memory
Sure. I read it.
Here is what I found using Enhanced Memory.

Frequently asked questions

What is the Enhanced Memory MCP server used for?

Enhanced Memory is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Enhanced Memory MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Enhanced Memory with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Enhanced Memory MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Enhanced Memory connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Enhanced Memory MCP to TypingMind?

Enhanced Memory runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Enhanced Memory MCP provide in TypingMind?

Enhanced Memory exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Enhanced Memory MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Enhanced Memory requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇