# kairn

A local knowledge engine for AI agents. It stores connected facts and routes useful context into new sessions.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 13
- Author: primeline-ai
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/primeline-ai/kairn
- Updated: 2026-10-19
- HTML: https://affpapa.org/en/nevibecode/mcp/kairn

## What it does

kairn keeps agent knowledge in a local graph with typed links, source tracking, and FTS5 full-text search. Its context router starts with compact summaries and expands into details when the task calls for them. Stored experiences fade over time, while frequently used ones can become lasting knowledge.

The MCP server exposes 22 tools, including `kn_judge` for relationship decisions and `kn_doctor` for read-only health checks. Each workspace uses its own SQLite store. Team deployments can use JWT authentication and the owner, maintainer, contributor, and reader roles.

The PyPI route requires Python: run `pip install kairn-ai`, then register the server with `claude mcp add kairn -- kairn serve --init ~/brain`. Claude Desktop users can instead open the `.mcpb` bundle, which avoids a separate Python setup.

## Requirements
- Environment variables: `KAIRN_WORKSPACE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- carry decisions across agent sessions
- model dependencies as connected graph nodes
- retrieve context by topic and relevance
- keep workspace data isolated
- inspect the health of a local knowledge store

## Example prompts
- Recall decisions and dependencies related to authentication.
- Check the health of this workspace’s knowledge store.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
