# dense-mem [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/markhuangai/dense-mem  
**GitHub Stars:** 41  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/dense-mem

## Description
Self-hosted AI agent memory server with MCP, evidence provenance, typed claims, conflict detection, embeddings, recall, PostgreSQL, and pgvector

## Tools
Capabilities this server exposes over MCP:

- **remember** — Exact Evidence and provenance to an explicit private or shared destination.
- **ingest_session** — Feature-gated exact event excerpts into authenticated private memory.
- **retract_evidence** — Owner-authorized retirement with append-only lineage.
- **recall_memory** — Eligible Evidence, topic hints, and direct-topic follow-up.
- **trace_memory** — Evidence decisions, occurrences, revisions, and lifecycle.
- **submit_recall_session_feedback** — Conditional bounded voluntary Recall feedback.
- **export_memory_pack** — Bounded Evidence/provenance export.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/markhuangai/dense-mem), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Configure:

```sh
mkdir dense-mem-local
```

2. Configure:

```sh
cd dense-mem-local
```

3. Configure:

```sh
curl -fsSLo docker-compose.yml \
  https://raw.githubusercontent.com/markhuangai/dense-mem/main/examples/docker-compose.base.yml
```

4. Configure:

```sh
curl -fsSLo .env.example \
  https://raw.githubusercontent.com/markhuangai/dense-mem/main/examples/.env.example
```

5. Configure:

```sh
cp .env.example .env
```

6. Configure:

```sh
${EDITOR:-vi} .env
```

## Documentation

## What dense-mem does

dense-mem provides self-hosted memory for AI agents through MCP over Streamable HTTP. PostgreSQL is the durable authority for evidence, semantic state, lifecycle, provenance, search, authorization, and audit data. pgvector supports embedding-backed memory operations, while Redis is used for coordination in multi-instance deployments.

The system separates durable evidence from derived semantic state. Entities and typed values can participate in Relationships, but a Relationship becomes active only when its supporting evidence satisfies the server's policy. Lifecycle actions change effective state without removing the original evidence or its lineage.

The host model remains responsible for conversation and judgment. dense-mem handles evidence intake, validation, ownership checks, lifecycle events, support eligibility, and bounded recall. Authentication resolves an actor to a team, identity, membership, owner alias, and optional credential; clients cannot select the semantic owner by sending team or identity fields.

## How it works

Agents submit evidence through `remember`, which is also the intake path used for corpus imports. Server-side closed-schema validation and deterministic policy determine what becomes durable state. Provider output is treated as a proposal rather than an authoritative write.

Recall returns active evidence contexts and graph-shaped Relationship handles. Default recall excludes candidates and hypotheses, and only returns evidence whose active Relationship support path is eligible for the requested time. When enabled functionality produces a follow-up, `recall_memory` can include `suggested_actions`.

Evidence remains append-only for provenance. `retract_evidence` retires caller-owned evidence, while `correct_relationship` replaces an owner-controlled active Relationship and preserves the original support lineage. `trace_memory` follows a same-team Relationship through its evidence, decisions, and lineage.

## Setup and configuration

A local deployment can use the supplied Docker Compose example with PostgreSQL and pgvector. Copy the environment template, set `POSTGRES_PASSWORD`, `CONTROL_PORTAL_TOKEN`, and `AI_API_KEY`, then start the stack with Docker Compose. The MCP endpoint is exposed at `/mcp`; the example binds it at `http://127.0.0.1:8080/mcp`.

The private control portal is used to create a team and issue its first API credential. The user portal provides memory search, graph views, and management pages permitted by the authenticated session. Control-plane automation uses the private control API rather than the public MCP automation endpoint.

A single-node deployment may use process-local coordination. Multiple instances sharing a writable primary require Redis or an equivalent distributed coordination implementation. The server applies pending PostgreSQL migrations before serving and remains unready until migration completes.

## Tools and capabilities

- `remember` accepts production evidence through the governed intake path.
- `retract_evidence` retires evidence owned by the caller without deleting provenance.
- `correct_relationship` supersedes an active owner-supported Relationship while retaining lineage.
- `recall_memory` returns active evidence contexts and Relationship handles, with optional suggested actions.
- `trace_memory` follows a same-team Relationship through evidence and decisions.
- `submit_recall_session_feedback` records bounded recall-quality feedback when that feature is enabled.
- `export_memory_pack` exports selected active Relationships with support provenance.
- `eval_list_knowledge_refs` pages stable, team-scoped knowledge references.
- `eval_run_recall_case` runs recall logic and returns ranked references for deterministic scoring.

## Limitations and notes

Team visibility does not grant mutation authority: authors can change only their own evidence or owned semantic records. Recall is deliberately support-gated, so unsupported candidates and hypotheses are excluded from the default result set.

Redis is not the durable memory store; PostgreSQL remains the source of record. Browser routes are first-party interfaces, not an alternative public automation API. The project is licensed under Apache-2.0 and also provides a hosted demo for testing temporary isolated team data.

_Full upstream README: https://allmcps.com/mcp/dense-mem/readme_

