# LinkLore

Structured memory for AI agents: decisions, pitfalls and specs get recorded as the agent works, then surface next session with code context attached.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 1
- Author: linklore
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/linklore/linklore-mcp
- Updated: 2026-08-06
- HTML: https://affpapa.org/en/nevibecode/mcp/linklore

## What it does

A fresh agent session starts from zero. Decisions get argued again, pitfalls get hit twice, and the reason behind a weird implementation becomes a guess. LinkLore fixes this with MCP tools the agent reads and writes itself. Two record types — lore for decisions and pitfalls, doc for specs and plans — link to each other and to source files.

Everything lives in a `.linklore/` SQLite store inside your project. No account needed. Records point at code files, and git-diff-based drift detection shows where memory has fallen behind the code. Search by meaning, tag, file, status or period. At session start, `brief()` compiles open items and hotspots into a compact summary.

The package runs from PyPI via `uvx llre`, no clone needed. For Claude Code: `claude mcp add llre -- uvx llre`, then `uvx llre init` once in the project root. Core modules — search, ranking, tool logic — ship as compiled extensions, so reading every line and forking is not fully possible. Most of the source is open, but the crown-jewel logic is closed. Elastic License 2.0: free to install and use commercially inside your org, but you cannot offer it as a competing managed service.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `LINKLORE_LANG` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env LINKLORE_LANG=<LINKLORE_LANG> --transport stdio linklore -- uvx llre
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from llre <command>

### Codex

**Platform CLI**
```bash
codex mcp add linklore --env LINKLORE_LANG=<LINKLORE_LANG> -- uvx llre
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from llre <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "linklore": {
            "command": "uvx",
            "args": [
                "llre"
            ],
            "env": {
                "LINKLORE_LANG": "<LINKLORE_LANG>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from llre <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "linklore": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "llre"
            ],
            "env": {
                "LINKLORE_LANG": "<LINKLORE_LANG>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from llre <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e LINKLORE_LANG=<LINKLORE_LANG> linklore uvx llre
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from llre <command>

## When to use it
- Keep decisions and pitfalls from one session to the next
- Find out why code is written this way instead of guessing
- Tie specs to code files instead of separate markdown notes
- Catch memory that has drifted from the code via git-diff
- Clean up near-duplicate records and check store integrity

## Example prompts
- Set up LinkLore in this repo: PyPI package `llre`, run via `uvx llre`, register it as an MCP server, then run `uvx llre init`
- At session start call `brief()` and show open items and hotspots
- Before editing this file, pull decisions tied to it with `show(file=..., query=...)`

## Similar
- [how-it-works](https://affpapa.org/en/nevibecode/skills/how-it-works.md) — skill · 5100 installs
- [mem](https://affpapa.org/en/nevibecode/skills/mem.md) — skill · 2400 installs
- [PMB AI](https://affpapa.org/en/nevibecode/mcp/pmb-ai.md) — MCP server · ★ 287
- [Mneme Memory](https://affpapa.org/en/nevibecode/mcp/mneme-memory.md) — MCP server · ★ 182
- [Knowl](https://affpapa.org/en/nevibecode/mcp/knowl.md) — MCP server · ★ 99
- [Sugar](https://affpapa.org/en/nevibecode/mcp/sugar.md) — MCP server · ★ 98

---
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
