Link
About
Local Markdown memory for AI agents
Details
- Author
- gowtham0992
- Categories
- AI, Other, Knowledge Base
Jump to
Setup
Install Link in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/gowtham0992/link
Follow the installation instructions in the repository README, then restart your MCP client.
Website·How it works·Memory·Tools & CLI·Setup·Docs·MCP Registry·PyPI·Homebrew
Link is an open-source memory layer for local AI agents. Raw sources become an inspectable Markdown wiki. Explicit "remember this" requests become reviewable memories. Agents retrieve compact, source-backed context through the CLI, MCP, official skills, or the local viewer without dumping the whole wiki into a chat window.
The wiki is the storage layer. The product is durable memory that stays on your machine, remains readable in plain files, and can be shared across multiple agents instead of locked inside one vendor profile.
Ask in your own words; Link matches by meaning, not keywords. All local, all plain files.
- Capturenotes, transcripts, docs, screenshots, and project context inraw/.
- Structuresource-backed pages underwiki/.
- Rememberexplicit preferences, decisions, facts, and project context as reviewable memory.
- Retrievecompact query packets through the CLI, MCP, official skills, or the local web viewer.
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.
Link follows Andrej Karpathy'sLLM Wiki pattern: keep knowledge outside the chat window, make claims inspectable, and let context compound over time.
Every other agent-memory system stores memory as embeddings in a vector database or as an LLM-extracted graph. Link made four architectural commitments those designs cannot bolt on:
- 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.
- Review-gated writes.Agents propose; you approve. Even the automatic session hooks capture proposals, never facts.
- No LLM in the memory layer.Ingestion and recall are deterministic — nothing can hallucinate a fact into your memory, because there is no model in the write path.
- Provably local.CI blocks outbound network code in the runtime, and the optional semantic models load offline-only after one explicit setup.
And the claims are measured, not asserted — see the benchmarks below. Named comparisons against Mem0/OpenMemory, Zep/Graphiti, and Letta:Why Link?
Plain files with no LLM in the memory layer, measured against the systems that have one everywhere:
Every number ships with its config, judge model, caveats, and the experiments thatlost— 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.
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 syncmoves reviewed memory through a git remoteyoucontrol — 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-syncruns 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 truethen, 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: 0.917, 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 — andlnk winsanswers with counts, whilelnk digestreports the weekly story including memories that haveneverbeen retrieved. The ledger stores which memory was read and when, never what you asked; it never syncs, andLINK_USAGE=offdisables 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.
Two commands: see it work, then make it yours.
brew install gowtham0992/link/link lnk proof # see the promise (~1 second, no setup) lnk setup # wire every agent you have — workspace, MCP, session hooks, one command
Already have memory scattered across tools? Bring it home as reviewable proposals — nothing is auto-accepted:
lnk import claude-code # or: cursor, codex, file --file chatgpt.txt
lnk setupdetects 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 anybrew 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 --hooksstill does exactly that.
lnk proofcreates 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:
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 --writethen creates~/link, provisions the MCP runtime, and wires the agent — including the session hooks that capture memory automatically as you work (swapclaude-codeforcodex,cursor,kiro,copilot,antigravity, or others). Drop--writeto preview the config without touching anything, or drop--agentto just create the workspace.
The installed command islnkbecauselinkis already a POSIX/macOS system utility. From a source checkout, usepython3 link.py ...instead.
Want the UI, graph, and source pages first?lnk try && lnk serve link-demo. Windows, source checkout, MCP-only, and skill-first paths are in theFirst 10 Minutes guide.
Or seed your current repo as a separate step so the first real recall is not empty:
cd /path/to/your/project lnk seed . ~/link lnk query "what is this project about?" ~/link --budget small
lnk seedreads allowlisted project files such asREADME.md,AGENTS.md,CLAUDE.md,.cursorrules, and editor rule files, blocks secret-looking values, writes a source-backed project page, and rebuilds the graph. It does not create durable memories; agents should still use reviewed memory proposals for preferences and decisions.
The Homebrew formula is maintained in the publicgowtham0992/homebrew-linktap.
http://127.0.0.1:3000 http://127.0.0.1:3000/onboard http://127.0.0.1:3000/graph http://127.0.0.1:3000/health
Use/onboardwhen you want the same first-run checklist in the local UI: readiness, project context seeding, first memory, agent wiring, and starter prompts. The web viewer is for local use only. It binds to127.0.0.1, has no user accounts or authentication, and should not be exposed to the internet unless you add your own auth layer.
lnk start link-demo --task "working on agent memory" lnk query "why does Link help agents?" link-demo --budget small lnk brief "working on agent memory" link-demo lnk benchmark "agent memory" link-demo lnk health link-demo
lnk benchmarkreports both performance and value evidence: cache/search/query timings, graph payload shape, and an estimate of how much broad wiki context the bounded Link packet avoided sending to an agent.
The/healthpage mirrors the readiness loop in the browser: validation state, interrupted writes, memory review status, and copyable repair commands. The viewer stays document-first — common paths in the top nav, deeper tools undermore, and a contents outline plus graph-related links on structured pages.
The generated demo is the public proof wiki. Generated content insidewiki/,raw/, andlink-demo/is ignored by git so personal memory is not published by accident.
Link's memory, ambient. LinkBar puts the review gate in your menu bar: a global palette (⌥⌘M) to recall or remember from any app, native notifications with one-tap Accept when a session capture lands, a live pulse while agents are writing, and a browser over every memory file — all running on the same reviewedlnkcommands as the CLI.
brew install --cask gowtham0992/link/linkbar
Unsigned on purpose (no Apple fee inflating anything): the cask strips the quarantine flag on install, so it opens like any app. Building from source instead:cd apps/LinkBar && bash Scripts/bundle.sh --install.
remember that I prefer local, source-backed memory for AI agents
In another agent connected to the same~/linkworkspace, say:
start with Link before we continue what does Link remember about local agent memory?
The second agent should recall the reviewed memory from local Markdown instead of asking you to repeat yourself.
For a clean automated version of the same idea, run:
Pick the surface that matches how you work. They all read and write the same local Markdown wiki.
These surfaces are independent.lnk serve/serve.pyis only the local web viewer. CLI commands, official skills, and MCP tools read the samewiki/files directly, so Claude, Codex, Kiro, Cursor, or another agent can use Link even when the web viewer is not running.
The local web viewer: browse source-backed memory and explore the knowledge graph — all on127.0.0.1, no accounts, no backend.
Prefer skills instead of MCP? Link ships small, lazy-loadable CLI skills underskills/. They let an agent uselnk health,lnk query,lnk ingest-status,lnk session-end, andlnk rememberdirectly, without MCP setup or a running web viewer.
skills/link-health/SKILL.md skills/link-retrieve/SKILL.md skills/link-ingest/SKILL.md skills/link-memory/SKILL.md
Run one installer from the cloned checkout:
bash integrations/codex/install.sh bash integrations/kiro/install.sh bash integrations/claude-code/install.sh bash integrations/cursor/install.sh bash integrations/copilot/install.sh bash integrations/vscode/install.sh bash integrations/antigravity/install.sh
Installers create or update~/link, install or upgradelink-mcp, write lightweight agent instructions, and preserve existing wiki data on reinstall. Use--projectwhen a repo needs separate project memory.
On Windows, use the matching PowerShell installer:
.\integrations\codex\install.ps1 .\integrations\kiro\install.ps1 .\integrations\claude-code\install.ps1 .\integrations\cursor\install.ps1 .\integrations\copilot\install.ps1 .\integrations\vscode\install.ps1 .\integrations\antigravity\install.ps1
is Link ready? start with Link before we continue seed this project into Link ingest raw/notes.md into Link remember that I prefer short release notes query Link for the release process what does Link remember about local personal memory? end this session with Link memory proposals
For CLI-first agents or Link skills, use the same startup loop directly:
lnk seed . ~/link lnk start ~/link --task "working on Link release" lnk session-end session-notes.md ~/link --limit 3
If you want one guided setup for a real workspace and an agent, uselnk onboard --agent AGENT. If your agent already has instructions and you only need MCP wiring, use the lower-level connection helper. Both preview the exact config first; add--writewhen you want Link to update the agent config file.
lnk onboard --agent codex lnk onboard --agent codex --write lnk connect codex ~/link lnk connect codex ~/link --write lnk connect kiro ~/link --write lnk verify-mcp ~/link
For agents with session-hook support — Claude Code, Codex, and Cursor — add--hooks(works withlnk onboardtoo) to make the memory loop automatic: the brief is injected at session start and proposal-only notes are captured at session end, so memory no longer depends on the agent remembering to call Link. Empty sessions and duplicate end events are skipped, and when the backlog builds up the brief nudges the agent to offer a read-onlylnk consolidatepass. Durable memory still requires your approval. Codex and Cursor hook support is new (wired to their documented schemas — report issues).
lnk connect claude-code ~/link --hooks --write lnk connect codex ~/link --hooks --write # session-start brief (Codex has no session-end event) lnk connect cursor ~/link --hooks --write lnk consolidate ~/link # read-only backlog plan, apply only with approval
Optional: hybrid semantic recall (still fully local)
Lexical recall is always the default and the fallback. Paraphrase matching is opt-in: after the two setup commands below, "how should I structure my pull requests" finds a memory saved about commit style. Until then, recall matches on shared words, and a miss tells you how to turn paraphrase matching on. Installing the optional semantic extra adds a small local static-embedding model. Recall never touches the network: the model loads offline-only after a one-time explicit setup, embeddings live in plain JSON under.link-cache/, similarity runs in-process with no vector database, and semantic-only matches carry capped confidence labels so agents verify before trusting them.
pip install "link-mcp[semantic]" # fast tier: tiny static model, instant load pip install "link-mcp[semantic-quality]" # quality tier: contextual model, best recall lnk semantic ~/link --setup # one-time model fetch, with your approval lnk semantic ~/link # status: lexical only vs hybrid, active tier python3 -m link_mcp --semantic-setup --wiki ~/link/wiki # MCP-only installs
Measured, not asserted: on the bundled 1,176-case benchmark, the quality tier lifts token-overlap hit@1 from 0.589 to 0.749 and pure-paraphrase (zero token overlap) hit@3/hit@5 by ~4×, at ~10 ms per recall with no service or vector database. On the third-party LoCoMo retrieval track (1,536 evidence-annotated questions over 5,882 conversation turns), hybrid recall lifts any-evidence hit@10 from 0.628 to 0.737 (0.794 with the opt-in rerank tier). Full methodology, honest limitations, and reproduction steps:benchmarks/RESULTS.md.
python3 -m pip install --upgrade link-mcp python3 -m link_mcp --version
{ "mcpServers": { "link": { "command": "python3", "args": ["-m", "link_mcp", "--wiki", "~/link/wiki", "--surface", "slim"] } } }
--surface slimis the recommended MCP surface for agents: six obvious tools for recall, remember, ingest, review, status, and admin escape hatches. The full compatibility surface is still available with--surface full.
On macOS/Homebrew Python, if pip reportsexternally-managed-environment, use a dedicated venv:
python3 -m venv ~/.link-mcp-venv ~/.link-mcp-venv/bin/python -m pip install --upgrade pip link-mcp
Obsidian users can import an existing vault intoraw/for agent ingest, or open~/link/wikidirectly as a vault for editing Link pages:
lnk init ~/link lnk import-obsidian ~/Documents/ObsidianVault ~/link
See theObsidian guidefor the import, edit, and validation loop.
Under the hood, Link separates source-backed knowledge from durable agent memory:
- Drop raw notes, transcripts, articles, and project context intoraw/.
- Agents compile those sources into inspectable pages underwiki/.
- Explicit "remember" requests become reviewable memory pages.
- Queries retrieve compact agent context from both the wiki and memory layer.
The storage model is plain and inspectable:
If a raw file was already ingested and later edited,lnk ingest-statusmarks it as stale and tells your agent to refresh the existing source page instead of creating a duplicate.
When an agent uses Link through the recommended MCP surface, it gets six model-facing tools. CLI and skill workflows call the same core behavior throughlnk.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





