# Kairn

> Kairn is an open-source MCP server for knowledge and memory. Local knowledge graph with recall and decay that gives AI agents long-term memory. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, macOS, Windows, Linux
- **Repository:** https://github.com/primeline-ai/kairn
- **MCP Registry name:** io.github.primeline-ai/kairn
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-11-23

## About

Instead of storing flat notes, Kairn keeps typed relationships such as depends-on, resolves and causes between nodes, with provenance and full-text search. A context router loads a relevant subgraph from keywords, starting with summaries and drilling into detail only when needed, so the assistant gets focused context rather than everything.

Experiences decay over time under a biological-style model, and ones that are accessed often are promoted to permanent knowledge. Storing a high-confidence fact creates both a graph node and a decaying experience. The README warns that relevance scores mean different things by result type (match, match_recency, recency, similarity), so they should not be sorted together.

Data lives in an isolated SQLite store per workspace, by default in ~/.kairn, and the README says it never leaves your machine. Install with pip, as a one-click .mcpb bundle for Claude Desktop, or with a one-line command for Claude Code or Codex. Team deployments add JWT auth and owner, maintainer, contributor and reader roles. The project is pre-1.0 and interfaces may change.

## Features

- **Knowledge graph:** Typed relationships between nodes with provenance and full-text search.
- **Context router:** Loads relevant subgraphs by keyword, summaries first.
- **Experience decay:** Old experiences fade while frequently used ones become permanent.
- **Per-workspace isolation:** Each workspace is its own SQLite store on your machine.
- **Role-based access:** JWT auth with owner, maintainer, contributor and reader roles for teams.
- **One-click bundle:** An .mcpb file installs it in Claude Desktop without Python setup.

## Good for

- Remember design decisions and recall them in later sessions
- Give a coding assistant persistent project context
- Link causes, fixes and dependencies as a graph
- Run a private memory store for a team with roles

## Install

### Claude Desktop (Claude Desktop → Settings → Extensions)

```text
https://github.com/primeline-ai/kairn/releases/download/v0.3.2/kairn-0.3.2.mcpb
```

Download the bundle and open it with Claude Desktop, or drag it onto Settings → Extensions and click Install. This server is only published as a Claude Desktop bundle.

## Tools

From the tool list in its README, going by the names, 6 names don't say. From the server's own tool labels and tool names; not verified by us.

- `kn_learn`: Store a fact as a graph node and a decaying experience
- `kn_recall`: Recall stored nodes and experiences by topic
- `kn_judge`: Five-verb relationship judgments
- `kn_doctor`: Read-only health diagnostics
- `kn_memories`: List experiences
- `kn_prune`: Prune old experiences

## FAQ

### Where is my data stored?

In a local SQLite workspace, by default ~/.kairn, and the README says it stays on your machine.

### How many tools are there?

22 MCP tools.

### Is Kairn production-ready?

The README labels it pre-1.0 with interfaces that may change.

### How do I add Kairn to Claude Code?

Run `claude mcp add kairn -- kairn serve --init ~/brain`.

### Is Kairn free?

Yes. Kairn is open source, so you can use and self-host it for free.

### What are the best alternatives to Kairn?

The closest alternatives to Kairn are Codebase Memory, XERJ, Claude Code Ultimate Guide, Nautilus Compass Memory and Myco: Agent-First Cognitive Substrate.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Nautilus Compass Memory](https://ai-powered.com/mcp/nautilus-compass-memory): Nautilus Compass Memory is an open-source MCP server for knowledge and memory.
- [Myco: Agent-First Cognitive Substrate](https://ai-powered.com/mcp/myco-agent-first-cognitive-substrate): Myco: Agent-First Cognitive Substrate is an open-source MCP server for knowledge and memory.
- [Source Library](https://ai-powered.com/mcp/source-library): Source Library is an open-source MCP server for knowledge and memory.
- [keepplain-plugin](https://ai-powered.com/mcp/keepplain-plugin): keepplain-plugin is a freemium MCP server for knowledge and memory.
- [Second Brain](https://ai-powered.com/mcp/second-brain-2): Second Brain is a freemium MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/kairn
