Link gives Codex, Claude, Cursor, Kiro, VS Code, Copilot, Antigravity, and other local agents the same source-backed memory, stored locally as Markdown.
Website · How it works · Memory · Tools & CLI · Setup · Docs · MCP Registry · PyPI · Homebrew
## Quick start ```bash brew install gowtham0992/link/link # or: pip install link-mcp lnk setup # wires every agent it finds ``` Then work normally. Tell an agent "remember that we deploy on Tuesdays", approve it once, and every other agent recalls it in a new session tomorrow. What each agent gets depends on what it lets Link plug into: | Agent | How memory arrives | Session hooks | Rules checked before the tool call | Code reminders | |---|---|---|---|---| | Claude Code | hooks, MCP, compiled files | start, end, every prompt | shell, file reads and writes, Grep; asks you | yes | | Cursor | hooks, MCP, compiled rules | start, end | shell (asks you); file reads and writes (held) | no | | Codex | start hook, MCP, `~/.codex/AGENTS.md` | start | shell commands and patches (held) | no | | Gemini CLI | start hook, MCP, `GEMINI.md` | start | shell, file reads and writes; asks you | no | | Antigravity | start hook, MCP | start | shell, file reads and writes; asks you | no | | Copilot CLI and VS Code | start hook, MCP (VS Code, per project), compiled files | start | shell, file reads and writes; asks you (a block in autopilot; the cloud agent never sees Link's hooks) | no | | Windsurf | MCP, global rules file, compiled rules | none (no such event) | shell, file reads and writes (held) | no | | Devin CLI | Claude Code's hooks, which it runs | start, end | shell and files (held) | no | | Kiro | start hook, MCP, global steering file | start | shell, file reads and writes (held) | no | | Zed | MCP, global `AGENTS.md` | none (no hooks) | shell and file writes, by Zed's own permission rules; not reads | no | "Asks you": the agent shows you the call and waits. "Held": the agent can only allow or block, so Link blocks the call and the agent asks you in chat; `lnk approve
Ask in your own words; Link matches by meaning, not keywords. All local, all plain files.
## How It Works Link gives agents five simple moves: 1. **Capture** notes, transcripts, docs, screenshots, and project context in `raw/`. 2. **Structure** source-backed pages under `wiki/`. 3. **Remember** explicit preferences, decisions, facts, and project context as reviewable memory. 4. **Retrieve** compact query packets through the CLI, MCP, official skills, or the local web viewer. 5. **Hold** what you approved: rules are enforced before a tool call, memories about code are checked against the repository, and a receipt shows what each session was given. Most agent sessions start from zero. You re-explain preferences, repo decisions, project constraints, and why something matters. Link turns that repeated context into local memory agents can query. | Pain | Link's answer | |------|---------------| | Agents forget you between sessions. | Save reviewed preferences, decisions, facts, and project context. | | Notes are private or messy. | Keep raw sources local, then turn them into source-backed Markdown. | | Context windows are expensive. | Return compact query packets with provenance and follow-up actions. | | Memory needs trust. | Every page and memory can be inspected, reviewed, archived, or forgotten. | | Agents read a rule and break it anyway. | A reviewed memory can carry a rule that asks for your OK, or blocks the call, before it runs. | | Memory goes stale as the code moves on. | Memories that name files, scripts, dependencies or functions are checked against the repository and flagged, not believed. | | You cannot tell what the agent was given. | `lnk receipt` lists every memory that reached a session and whether it arrived whole. | Link follows Andrej Karpathy's [LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f): keep knowledge outside the chat window, make claims inspectable, and let context compound over time. ## Why Link Is Different Most agent-memory systems store memory as embeddings in a vector database or as an LLM-extracted graph. Link made five architectural commitments that are hard to add to those designs: 1. **Memory you can read.** Every memory is a plain Markdown file — open it, grep it, git-diff it. If Link disappeared tomorrow, your memory is still yours. 2. **Review-gated writes.** Agents propose; you approve. Even the automatic session hooks capture proposals, never facts. 3. **No LLM in the memory layer.** Saving, deduplicating, contradiction checks and recall are deterministic — nothing can hallucinate a fact into your memory, because there is no model in its write path. (Wiki pages compiled from raw sources are written by your agent, and Link treats them that way.) 4. **Provably local.** CI blocks outbound network code in the runtime, and the optional semantic models load offline-only after one explicit setup. 5. **Memory that holds when the agent acts.** A memory you reviewed can carry a rule (`ask command: git push --force`, `deny write: migrations/**`) that is checked before the agent's tool call, with no model and under a millisecond. Memories about code are re-read against your repository and flagged when the code moved on. Memories surface when the agent opens the file they describe, `lnk compile` writes reviewed memory into the files every agent already reads, and a receipt proves what reached each session. And the claims are measured, not asserted — see the benchmarks below. Named comparisons against Mem0/OpenMemory, Zep/Graphiti, and Letta: [Why Link?](https://gowtham0992.github.io/link/why-link.html) ## Benchmarks Plain files with no LLM in the memory layer, measured against the systems that have one everywhere: | What | Link | For comparison | |---|---|---| | **LoCoMo end-to-end QA** — full 1,540 questions under [mem0's own open harness](https://github.com/mem0ai/memory-benchmarks); measured on Link 3.x, not yet re-run on 5.x | **84.8%** | mem0's cloud platform: **83.2%** under the same judge — with GPT-5 writing their answers and a budget model (claude-haiku-4-5) writing Link's. Confirmed by a second, independent judge (Tencent Hunyuan 3): **85.5% vs 83.6%** | | **LongMemEval evidence retrieval** — did the memory layer put the gold evidence in context? (deterministic, no LLM judge) | **99.4%** of 500 questions | of 102 answer failures, only 3 were retrieval misses — the rest happened with the evidence already retrieved | | **Memory hygiene** — junk stored over a simulated multi-month session stream we wrote | **0%** (a CI regression floor on our own fixtures) | the same pipeline with governance off: 35.7% | | **Memory poisoning** — 18 authored prompt-injection attacks on the capture pipeline (guardrail bypass, exfil conventions, credential planting, spoofed approvals, MemGhost-class untrusted-channel writes) | **0** reach the inbox unlabeled; 0 false positives on benign directives (a CI regression floor on attacks we wrote) | to our knowledge the only published adversarial benchmark on an agent-memory write path | | **Token economics** — real recall packets, measured through the query path | **1,697–3,752 tokens** per recall (micro→large budget); a **64× larger store grows the packet 1.56×**, and the last quadrupling moves it 0.3% | bounded by the budget you ask for, not by how much you have remembered; CI-enforced. Over MCP, the *first* response of a session also carries a one-time memory brief, bounded to a hard 4,000-character budget (~365 tokens of overhead, measured) — see RESULTS.md | | **Enforced rules** — 33 forbidden tool calls, including shell disguises (`cd x && sudo …`, quoting, `bash -c`, options reordered or bundled, PowerShell), against 53 ordinary coding-agent calls; the same matcher serves every agent with rule checks in the table above | **33 of 33 caught, 0 of 53 stopped**, about 0.2 ms per decision | a rule acts only after you review it, and only you approve, clear or retire one; the hook runs as you, so it stops mistaken and disguised calls, not an agent set on escaping it | | **Staleness checks** — memories and instruction files (AGENTS.md, CLAUDE.md, Cursor rules…) checked against the repository | **0 false flags**: 345 memory references in Link's own docs and 604 instruction-file references across eight public repositories; every planted deletion caught | a reference is reported only when git history shows the thing existed | | **Bundled 1,176-case recall benchmark** — deterministic, no network, no LLM | pip default (lexical) hit@1 **0.671**; `lnk setup` provisions the fast local tier by default: **0.740**; optional quality tier **0.789**, plus rerank **0.798** | reproducible with one command; CI runs the suite and gates dataset integrity, not the score | The zeros are regression floors: CI fails any change that breaks them, on fixtures we wrote, so they say the behaviour cannot silently regress - not that a stranger's data will score the same. Every number ships with its config, judge model, caveats, and the experiments that *lost* — including LongMemEval end-to-end, where we re-judged both sides under the neutral Hunyuan 3 referee: mem0's GPT-5 answers score 91.0%, Link's budget-model answers 80.6%. Their published number holds up, and the gap tracks the answering model, not the memory layer — that's what the 99.4% evidence-retrieval row above isolates. Full methodology and reproduction steps: [benchmarks/RESULTS.md](benchmarks/RESULTS.md). ## Memory You Can Take Anywhere — And Prove Is Working Three questions every memory system should answer, and how Link answers them with mechanisms instead of promises: **"Is it on all my machines?"** `lnk sync` moves reviewed memory through a git remote *you* control — a private GitHub repo, a homelab bare repo — with no server and no account. Secrets are scanned before anything leaves, conflicts become review items instead of git markers, and private captures never sync. `lnk team-sync` runs a shared team brain on the same rails. **"What did I believe back then?"** Ask in plain language: `lnk recall "where does local data live in March"` returns what was true *then*, reconstructed from the dated files and their supersede lineage — while the same question without the date returns today's truth. Deterministic: a regex and a calendar, no model. Point-in-time accuracy from plain language: 1.00 on the hygiene benchmark's revised facts, identical to asking with an ISO date. **"Is my agent actually using this?"** The question most memory systems cannot answer about themselves. Link records retrievals locally — session briefs pushed to agents, recalls they chose to make — and `lnk wins` answers with counts, while `lnk digest` reports the weekly story including memories that have *never* been retrieved. The ledger stores which memory was read and when, never what you asked; it never syncs, and `LINK_USAGE=off` disables it. And memory reaches every agent, not just the hooked ones: the first MCP tool response of a session carries the brief, whatever tool was called. ## First Run, In Detail The quick start above is the whole install. This is what each step does. ```bash brew install gowtham0992/link/link lnk proof # see the promise (~1 second, no setup) lnk setup # wire every agent it finds — workspace, MCP, session hooks, one command ``` Already have memory scattered across tools? Bring it home as reviewable proposals — nothing is auto-accepted: ```bash lnk import claude-code # or: cursor, codex, file --file chatgpt.txt ``` `lnk setup` detects the agents installed on your machine — Claude Code, Codex, Cursor, Windsurf, Zed, Kiro, Gemini CLI — and wires them all at once; Link is agent-agnostic by design (one MCP server, one workspace, every agent reads the same memory). It is idempotent: after any `brew upgrade`, run it again and everything — workspace runtime, MCP provisioning, hooks — is refreshed. Prefer to wire one agent explicitly? `lnk onboard --agent claude-code --write --hooks` still does exactly that. `lnk proof` creates a throwaway workspace, writes one reviewed memory, and recalls it through the same path the CLI, skills, and MCP use — the core promise (one local memory, reusable by different agents, no cloud profile) in one second: ```text Cross-agent memory continuity works Memory: created and reviewed: Cross-agent Link proof Recall: found through the same bounded recall path used by CLI, skills, and MCP. Result: proof passed ``` `lnk onboard --agent claude-code --write --hooks` creates `~/link`, provisions the MCP runtime, and wires the agent. Swap `claude-code` for `codex`, `cursor`, `kiro`, `copilot`, `antigravity`, `windsurf`, `zed` or `vscode`. Session hooks - a brief at session start, proposals captured at session end - exist for Claude Code and Cursor; Codex, Gemini CLI, Antigravity and Copilot get the start brief. Rule checks before tool calls are installed for every agent in the table above except Zed, whose own permission rules carry them. Agents without a start hook get memory through MCP, where the first tool response of a session carries the same brief. Drop `--write` to preview without touching anything, or drop `--agent` to just create the workspace. `lnk disconnect
|
Web UI Read the local wiki, then review memory, ingest, graph, audits, captures, and explanations. |
CLI Script readiness, query packets, briefs, validation, backup, context-savings benchmark, and repair. |
MCP Let Codex, Claude, Cursor, Kiro, VS Code, Copilot, and other agents recall memory. |
The local web viewer: browse source-backed memory and explore the knowledge graph — all on 127.0.0.1, no accounts, no backend.