# kamysh/mimir [Health: Active]

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

## Description
Persistent reasoning memory for AI coding agents, with evidence provenance, typed belief relationships and a revisioned experience ledger. Uses PostgreSQL and Apache AGE.

## Tools
Capabilities this server exposes over MCP:

- **insert_belief** — Add an independently sourced belief with `content`, `probability` [0,1], `confidence` [0,1], `provenance` (`basis`, `reference`), and `supporting_passage_id` pointing to an existing indexed document passage
- **delete_belief** — Remove a belief and all its edges by `id
- **insert_pattern** — Add a pattern with `situation`, `approach`, `success_rate` [0,1]
- **delete_pattern** — Remove a pattern by `id
- **delete_project** — Remove all beliefs and document chunks tagged with a `project
- **record_support** — Add a SUPPORTS edge from `from_id` to `to_id` with `weight
- **record_cause** — Add a CAUSES edge from `from_id` to `to_id` with `weight` (traversed by `query_intervention`; no auto-propagation)
- **record_defeat** — Add a DEFEATS edge and trigger defeat propagation cascade
- **record_contradiction** — Add a bidirectional CONTRADICTS relation between `id_a` and `id_b
- **get_belief** — Get a belief by `id
- **list_beliefs** — List all beliefs
- **list_patterns** — List all patterns
- **get_contradictions** — Find all actively contradicting belief pairs
- **query_relevant** — Hybrid retrieval: text match + graph expansion, ordered by probability
- **propagate_from** — Run defeat propagation from a seed belief `id
- **query_intervention** — Counterfactual `P(downstream \
- **update_confidence** — Update the `confidence` value of a belief
- **decay_all** — Apply time decay to all beliefs (`decay_factor` defaults to 0.99)
- **load_document** — Parse a markdown file into chunks, embed, and index for semantic search
- **query_document** — Semantic search over indexed document chunks
- **clear_document** — Remove all chunks and embeddings for a document `path
- **add_evidence** — Ground a belief in a document passage: GROUNDS edge from a `chunk_id` to a `belief_id` (`weight` default 1.0). Adds local positive evidence; never becomes a causal edge
- **get_evidence** — List the document passages grounding a `belief_id`, strongest first

## 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/kamysh/mimir), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
nix build github:kamysh/mimir#mimir
```

2. Check the setup:

```sh
./result/bin/mimir --version
```

3. Check the setup:

```sh
./result/bin/mimir-mcp --version
```

4. Run:

```sh
docker run -d \
  --name postgres-ai \
  --restart always \
  -p 127.0.0.1:5432:5432 \
  -v mimir_data:/var/lib/postgresql/data \
  kamysh/postgres-ai:latest
```

5. Configure:

```sh
curl -fsSL https://raw.githubusercontent.com/kamysh/mimir/v3.3.3/mimir-setup/create-db-user.sh \
  | bash -s -- --container postgres-ai --host localhost --port 5432 --user mimir --db mimir
```

6. Install:

```sh
mkdir -p "$HOME/.local/bin"
```

## Documentation

## What kamysh/mimir does

kamysh/mimir provides persistent reasoning memory for AI coding agents through MCP. It separates observations and document passages from the beliefs derived from them, allowing an agent to preserve decisions, rejected approaches, confidence values, and the evidence behind a conclusion.

Beliefs can carry probability, confidence, provenance, and a link to an indexed document passage. Patterns record a situation, an approach, and its observed success rate. The system also models relationships between beliefs, so an agent can distinguish support, defeat, contradiction, and causal hypotheses rather than storing all context as untyped notes.

## How it works

PostgreSQL stores the application data, while Apache AGE provides the graph used for typed belief relationships. Mimir applies its database migrations when it first connects, including creation of the AGE graph. Document ingestion splits Markdown files into chunks, creates embeddings, and indexes those chunks for semantic retrieval.

Retrieval can combine text matching with graph expansion and order results by belief probability. Defeat relationships can trigger propagation cascades. Causal edges are available to intervention queries, but recording a causal relationship does not automatically propagate values through the graph. Evidence edges connect document chunks to beliefs as local support and remain distinct from causal edges.

## Setup and configuration

A complete installation requires a PostgreSQL database, the `mimir` CLI and `mimir-mcp` binaries, and registration of the MCP server with an agent client. The repository documents Nix builds for both binaries and a Docker-based PostgreSQL setup using `kamysh/postgres-ai:latest`, which includes pgvector and Apache AGE.

The database can be run in a container or supplied independently. Database credentials are configured through PostgreSQL connection settings, including a `.pgpass` entry in the documented setup path. Mimir does not install a database, start a daemon, create a judge, or schedule maintenance automatically. The MCP process is launched by the registered client when needed.

Codex and Claude Code are documented client integrations. An optional judge can review recorded experiences when separately launched; embedding and judge operations can use configured external providers.

## Tools and capabilities

The MCP surface includes tools for:

- Creating, reading, listing, updating, and deleting beliefs and patterns.
- Recording support, defeat, cause, and contradiction relationships.
- Finding active contradictions and running defeat propagation.
- Performing counterfactual intervention queries over causal relationships.
- Applying time decay to beliefs and deleting project-scoped data.
- Loading, searching, and clearing indexed Markdown documents.
- Adding evidence from document passages and listing evidence for a belief.
- Retrieving relevant beliefs through combined text and graph expansion.

Belief fields support probability and confidence values between zero and one. Evidence records retain the referenced passage and a weight, making it possible to inspect which indexed observations ground a conclusion.

## Limitations and notes

The reasoning graph and local search can run locally, but document embedding may send chunks to a configured cloud embedding provider. A configured API judge can likewise send selected experiences and retrieved tool results to its provider. The judge is optional and is not started as part of normal installation.

Causal relationships support intervention queries but do not perform automatic causal propagation. Evidence added through a grounding edge is treated as local positive evidence and is not converted into a causal edge. Database preparation, binary installation, and MCP client registration are separate setup requirements.

_Full upstream README: https://allmcps.com/mcp/kamysh-mimir/readme_

