Dense Mem README

The full upstream README, mirrored for reference. Install config, tool schemas, adoption signals and our own overview live on the Dense Mem listing page.

Dense-Mem

English · 简体中文

Dense-Mem

Self-hosted MCP memory with exact Evidence, provenance, and governed recall.

Try Dense-Mem live

GitHub stars GitHub issues License: Apache-2.0 Go 1.26 Docker image on GHCR

Interactive documentation · Setup guide · How it works

Dense-Mem is a standalone HTTP MCP memory server using Streamable HTTP. AI clients choose what to remember; Dense-Mem stores exact Evidence, preserves its sources and lifecycle, and retrieves authorized memory across conversations.

PostgreSQL with pgvector is the durable authority. Redis is coordination only: a single-node deployment can use process memory; a multi-instance deployment requires Redis or equivalent distributed coordination.

Try the demo

Open the hosted demo to create a temporary, isolated team and try disposable memory before self-hosting.

AI clients submit Evidence; Dense-Mem preserves provenance and lifecycle and returns authorized memory.

Why Dense-Mem

  • Keep the source. Exact Evidence retains occurrences, source revisions, provenance, and an append-only lifecycle.
  • Control access. Private and team-shared memory have explicit destinations; shared visibility does not grant permission to change another owner's Evidence.
  • Follow the history. Recall returns eligible Evidence; Trace explains its provenance, and corrections or retractions preserve lineage.
  • Organize without inventing facts. Derived topics help discovery while Evidence remains canonical memory.

See Using Dense-Mem for the memory workflow and Architecture for the system design.

Quickstart

Install Docker with Compose. This fresh-install example pins the image and configuration files to the same published release:

server.ts
mkdir dense-mem-local
cd dense-mem-local
export DENSE_MEM_VERSION=v2.8.0
export DENSE_MEM_IMAGE="ghcr.io/markhuangai/dense-mem:${DENSE_MEM_VERSION}"

curl -fsSLo docker-compose.yml \
  "https://raw.githubusercontent.com/markhuangai/dense-mem/${DENSE_MEM_VERSION}/examples/docker-compose.base.yml"
curl -fsSLo .env.example \
  "https://raw.githubusercontent.com/markhuangai/dense-mem/${DENSE_MEM_VERSION}/examples/.env.example"
cp .env.example .env
${EDITOR:-vi} .env

Set these values in .env:

SettingPurpose
POSTGRES_PASSWORDPassword for the local PostgreSQL instance
CONTROL_PORTAL_TOKENPrivate control-portal access token
AI_API_KEYModel-provider credential
AI_VERIFIER_MODELChat model used to assess Evidence

The example supplies OpenAI embedding defaults. For other providers, change the endpoint, model, and dimensions together; see Configuration.

Terminal
docker compose up -d
docker compose ps
curl -fsS http://127.0.0.1:8080/ready

Startup applies migrations before readiness. Keep the image pin for later starts; consult the Operations Runbook before changing an existing database.

Connect your AI client

  1. Open the private control portal at http://127.0.0.1:8090/ with CONTROL_PORTAL_TOKEN. Create a team, then create its first credential.
  2. Open the user portal at http://127.0.0.1:8080/ui. Its Connect page shows the MCP connection details. The local MCP endpoint is http://127.0.0.1:8080/mcp.
  3. Configure your host using the MCP client guide, then try a Remember, Recall, and Trace workflow. When MCP_PUBLIC_BASE_URL is set, OAuth-capable hosts such as Claude Desktop can sign in through the browser instead of storing a key; use /mcp/c/<name> for one connection per team.

The control listener stays private. Configured hosted model providers can receive Evidence and queries; use self-hosted providers when that traffic must stay within your infrastructure. External memory automation uses /mcp.

Documentation

GoalGuide
Learn how memory worksEvidence walkthrough · Using Dense-Mem
Configure and operate a serverConfiguration · Operations
Choose deployment examplesExamples · Grafana
Integrate a clientPython / ADK / LangChain · stdio MCP proxy
Develop and testScripts · Evaluation · ADRs

The documentation site holds interactive walkthroughs and detailed reference. Directory READMEs cover the files they accompany. For documented behavior changes, link a companion gh-pages PR or explain why the site needs no update.

Dense-Mem is part of the research preprint Governed Enterprise AI Memory Beyond RAG: From Vector Retrieval to Permissioned Knowledge Graphs.

License

Apache-2.0