Free, open source, local & remote, persistent memory for your AI coding agents.
14
stars
1,252
commits
TypeScript
primary language
Sep 11, 2026
updated
Shared, persistent memory for your AI coding agents.
Your agent solves something once — a migration gotcha, a flaky-test fix, why the
build breaks only on CI — and remembers it in every session after, on every
machine, across every tool. One npx command to connect; works with Claude
Code, Cursor, Codex, or any MCP client.
npx @lorekit/cli install # connect your agent — full setup below
┌─ your agent, any tool, any machine ─┐
learns something │ memory.write { scope, key, value } │
in a session ───→│ │──→ one store, your call:
recalls it next │ memory.list { scope } │←── remote (shared) or local
time it needs it └─────────────────────────────────────┘
Every coding agent starts each session with total amnesia. If you use them daily, that costs you:
.claude/ notes your agent writes are
wiped on the next CI run and rarely make it back to you.The knowledge exists. It just has nowhere to live.
You don't have to run anything yourself — LoreKit is hosted. Getting your agents connected takes three steps.
Sign in to the dashboard at lorekit.io with GitHub, then Overview → Connect your agent → Generate new token.
Pick Read + Write for agents that should learn, or Read only for context-injection-only setups like CI.
Your token is shown once — copy it now.
The fastest path is the CLI. It scaffolds three companion skills that make your agent use LoreKit on its own:
lorekit-memory — the runtime loop: reading relevant lessons when it
starts a task, and writing one whenever something goes wrong (a stuck loop, a
repeated failure, a costly wrong assumption).lorekit-setup — the authoring counterpart: wiring a self-improvement
loop into one of your own skills or workflows — a fast episodic tier that
promotes proven lessons into permanent rules, with the entrenchment guards
that keep a learning loop from reinforcing its own mistakes.lorekit-groom — the maintenance counterpart: running a grooming pass
over a store that has grown noisy — finding and merging near-duplicate
lessons, linting out low-quality ones, and setting expiry on time-bound ones —
always analysing read-only and proposing a plan before it changes anything.
For fully automated, server-side cleanup instead of an agent-driven pass, see
Retention policies — saved scoped rules
(lorekit policy create / lorekit groom) that archive stale lore, reviewed
manually or swept nightly, and never hard-delete.npx @lorekit/cli install \
--endpoint https://pqokxlhvnosogizsjztg.supabase.co/functions/v1/mcp \
--token lk_rw_<your-token>
Check that everything is wired up:
npx @lorekit/cli doctor
# → connectivity, token permission, and detected scopes, all green
Run the CLI often? Read commands like list, search, and tree are
nicer without the npx prefix. Install the binary globally once:
npm install -g @lorekit/cli
Then drop npx @lorekit/cli and call lorekit directly:
lorekit doctor
Tab completion (zsh / fish). Let install wire it, or do it by hand:
lorekit install --completions auto # detect $SHELL and set it up
lorekit completion zsh > ~/.zsh/completions/_lorekit
lorekit completion fish > ~/.config/fish/completions/lorekit.fish
It completes commands, each command's flags, and — from your local store —
scopes and scope::key addresses.
Your agent now remembers. Its lessons survive every session, reach every machine running the same token, and are there the next time any agent picks up the work.
Prefer a framework plugin? For memory that fires on host lifecycle events — no reliance on the agent choosing to use the skill — install a plugin instead. Claude Code has a one-line marketplace install; Cursor and Codex have their own bundles. See plugins/.
Using Claude Code on the web? Its sessions run in a fresh, ephemeral clone, so add
--mcp-json—npx @lorekit/cli install --global --mcp-jsonalso writes a committable, secret-free.mcp.json(auth via${LOREKIT_TOKEN}) the cloud session reads directly..mcp.jsonis usually git-ignored, so you'll need to un-ignore and commit it — the command warns if it's still ignored. See the Claude Code on the web guide.
LoreKit needs neither an account nor a network. The same memory.* tools can
run against plain markdown files on your machine instead of the shared
remote store — fully offline, nothing to sign up for.
| Remote (shared) | Local | |
|---|---|---|
| Where lessons live | A shared remote store the whole team reaches | Markdown files under ~/.lorekit/ and <repo>/.lorekit/ |
| Best for | Sharing across machines, teammates, and CI | Private, offline, or air-gapped work |
| Setup | A token (above) | No account, no token |
| Sharing | Automatic, everywhere the token is used | Commit <repo>/.lorekit/ to share via git — or gitignore it to keep private |
Local memory is two-tier, mirroring the remote scope model: a per-user
~/.lorekit/ holds global lessons, and an opt-in <repo>/.lorekit/ holds
repo- and branch-scoped ones. Reads merge both tiers with the closer scope
winning. Every lesson is a human-readable markdown file — greppable and
diffable, not a database you have to query.
To run local, point your agent's .mcp.json at the CLI's built-in local server
(no endpoint, no token needed):
{
"mcpServers": {
"lorekit": { "command": "npx", "args": ["-y", "@lorekit/cli", "mcp"] }
}
}
Then select local mode — set LOREKIT_MODE=local, or add { "mode": "local" }
to a .lorekit.json at your repo root — and create <repo>/.lorekit/ when you
want repo-scoped lessons to persist in the project.
Not committed to one? Start local and move up to the hosted store later with one command —
lorekit migrate --from ~/.lorekit --to remotepreviews the plan,--yesapplies it — so lessons are never stranded.lorekit migratealso relocates a store between the local tiers (--to home|project). You can also hard-deny a mode for privacy or CI (e.g.LOREKIT_DENY=remote).
Full details — the two-tier layout, write routing, the control model, and migration — are in packages/cli/README.md.
Lessons are partitioned by scope — a short string that says how widely a lesson applies:
global # applies everywhere
project::agent-skills # one project
repo::mthines/gw-tools # one repository
branch::mthines/gw-tools::feat/x # one branch (short-lived)
An agent reads from narrow to broad — branch, then repo, then global — and merges what it finds. So a branch-specific gotcha and a universal convention both surface, without unrelated repos leaking in. Full spec: docs/scope-format.md.
| Tool | How it connects |
|---|---|
| Claude Code | Marketplace plugin (skill + lifecycle hooks + MCP), or the CLI above |
| Cursor | A rule plus a stop hook |
| Codex | Feature-flagged hooks with an AGENTS.md fallback (experimental) |
| Any MCP client | Point it at the endpoint with a Bearer token |
All the integrations share one engine and differ only in how each host wires it up. See plugins/README.md.
| Guide | What it covers |
|---|---|
| docs/scope-format.md | How scopes work and how agents resolve them |
| docs/mcp-tools.md | The memory.* tools, with request/response examples |
| docs/api-tokens.md | Token types, permissions, and CI usage |
| docs/limits.md | Memory caps and rate limits |
| packages/cli/README.md | Every CLI command and flag |
| docs/ | Everything else — architecture, deployment, observability |
LoreKit is fully self-hostable — the whole stack (MCP server, dashboard, database) deploys to your own Supabase and Vercel projects in about five minutes. See docs/install.md.
LoreKit is an NX monorepo. To set it up locally, run the checks, and hack on any package, see DEVELOPMENT.md.
MIT © LoreKit contributors.
TypeScript
57.0%
JavaScript
28.4%
PLpgSQL
12.8%
MDX
1.6%
Free, open source, local & remote, persistent memory for your AI coding agents.
14
stars
1,252
commits
TypeScript
primary language
Sep 11, 2026
updated
Shared, persistent memory for your AI coding agents.
Your agent solves something once — a migration gotcha, a flaky-test fix, why the
build breaks only on CI — and remembers it in every session after, on every
machine, across every tool. One npx command to connect; works with Claude
Code, Cursor, Codex, or any MCP client.
npx @lorekit/cli install # connect your agent — full setup below
┌─ your agent, any tool, any machine ─┐
learns something │ memory.write { scope, key, value } │
in a session ───→│ │──→ one store, your call:
recalls it next │ memory.list { scope } │←── remote (shared) or local
time it needs it └─────────────────────────────────────┘
Every coding agent starts each session with total amnesia. If you use them daily, that costs you:
.claude/ notes your agent writes are
wiped on the next CI run and rarely make it back to you.The knowledge exists. It just has nowhere to live.
You don't have to run anything yourself — LoreKit is hosted. Getting your agents connected takes three steps.
Sign in to the dashboard at lorekit.io with GitHub, then Overview → Connect your agent → Generate new token.
Pick Read + Write for agents that should learn, or Read only for context-injection-only setups like CI.
Your token is shown once — copy it now.
The fastest path is the CLI. It scaffolds three companion skills that make your agent use LoreKit on its own:
lorekit-memory — the runtime loop: reading relevant lessons when it
starts a task, and writing one whenever something goes wrong (a stuck loop, a
repeated failure, a costly wrong assumption).lorekit-setup — the authoring counterpart: wiring a self-improvement
loop into one of your own skills or workflows — a fast episodic tier that
promotes proven lessons into permanent rules, with the entrenchment guards
that keep a learning loop from reinforcing its own mistakes.lorekit-groom — the maintenance counterpart: running a grooming pass
over a store that has grown noisy — finding and merging near-duplicate
lessons, linting out low-quality ones, and setting expiry on time-bound ones —
always analysing read-only and proposing a plan before it changes anything.
For fully automated, server-side cleanup instead of an agent-driven pass, see
Retention policies — saved scoped rules
(lorekit policy create / lorekit groom) that archive stale lore, reviewed
manually or swept nightly, and never hard-delete.npx @lorekit/cli install \
--endpoint https://pqokxlhvnosogizsjztg.supabase.co/functions/v1/mcp \
--token lk_rw_<your-token>
Check that everything is wired up:
npx @lorekit/cli doctor
# → connectivity, token permission, and detected scopes, all green
Run the CLI often? Read commands like list, search, and tree are
nicer without the npx prefix. Install the binary globally once:
npm install -g @lorekit/cli
Then drop npx @lorekit/cli and call lorekit directly:
lorekit doctor
Tab completion (zsh / fish). Let install wire it, or do it by hand:
lorekit install --completions auto # detect $SHELL and set it up
lorekit completion zsh > ~/.zsh/completions/_lorekit
lorekit completion fish > ~/.config/fish/completions/lorekit.fish
It completes commands, each command's flags, and — from your local store —
scopes and scope::key addresses.
Your agent now remembers. Its lessons survive every session, reach every machine running the same token, and are there the next time any agent picks up the work.
Prefer a framework plugin? For memory that fires on host lifecycle events — no reliance on the agent choosing to use the skill — install a plugin instead. Claude Code has a one-line marketplace install; Cursor and Codex have their own bundles. See plugins/.
Using Claude Code on the web? Its sessions run in a fresh, ephemeral clone, so add
--mcp-json—npx @lorekit/cli install --global --mcp-jsonalso writes a committable, secret-free.mcp.json(auth via${LOREKIT_TOKEN}) the cloud session reads directly..mcp.jsonis usually git-ignored, so you'll need to un-ignore and commit it — the command warns if it's still ignored. See the Claude Code on the web guide.
LoreKit needs neither an account nor a network. The same memory.* tools can
run against plain markdown files on your machine instead of the shared
remote store — fully offline, nothing to sign up for.
| Remote (shared) | Local | |
|---|---|---|
| Where lessons live | A shared remote store the whole team reaches | Markdown files under ~/.lorekit/ and <repo>/.lorekit/ |
| Best for | Sharing across machines, teammates, and CI | Private, offline, or air-gapped work |
| Setup | A token (above) | No account, no token |
| Sharing | Automatic, everywhere the token is used | Commit <repo>/.lorekit/ to share via git — or gitignore it to keep private |
Local memory is two-tier, mirroring the remote scope model: a per-user
~/.lorekit/ holds global lessons, and an opt-in <repo>/.lorekit/ holds
repo- and branch-scoped ones. Reads merge both tiers with the closer scope
winning. Every lesson is a human-readable markdown file — greppable and
diffable, not a database you have to query.
To run local, point your agent's .mcp.json at the CLI's built-in local server
(no endpoint, no token needed):
{
"mcpServers": {
"lorekit": { "command": "npx", "args": ["-y", "@lorekit/cli", "mcp"] }
}
}
Then select local mode — set LOREKIT_MODE=local, or add { "mode": "local" }
to a .lorekit.json at your repo root — and create <repo>/.lorekit/ when you
want repo-scoped lessons to persist in the project.
Not committed to one? Start local and move up to the hosted store later with one command —
lorekit migrate --from ~/.lorekit --to remotepreviews the plan,--yesapplies it — so lessons are never stranded.lorekit migratealso relocates a store between the local tiers (--to home|project). You can also hard-deny a mode for privacy or CI (e.g.LOREKIT_DENY=remote).
Full details — the two-tier layout, write routing, the control model, and migration — are in packages/cli/README.md.
Lessons are partitioned by scope — a short string that says how widely a lesson applies:
global # applies everywhere
project::agent-skills # one project
repo::mthines/gw-tools # one repository
branch::mthines/gw-tools::feat/x # one branch (short-lived)
An agent reads from narrow to broad — branch, then repo, then global — and merges what it finds. So a branch-specific gotcha and a universal convention both surface, without unrelated repos leaking in. Full spec: docs/scope-format.md.
| Tool | How it connects |
|---|---|
| Claude Code | Marketplace plugin (skill + lifecycle hooks + MCP), or the CLI above |
| Cursor | A rule plus a stop hook |
| Codex | Feature-flagged hooks with an AGENTS.md fallback (experimental) |
| Any MCP client | Point it at the endpoint with a Bearer token |
All the integrations share one engine and differ only in how each host wires it up. See plugins/README.md.
| Guide | What it covers |
|---|---|
| docs/scope-format.md | How scopes work and how agents resolve them |
| docs/mcp-tools.md | The memory.* tools, with request/response examples |
| docs/api-tokens.md | Token types, permissions, and CI usage |
| docs/limits.md | Memory caps and rate limits |
| packages/cli/README.md | Every CLI command and flag |
| docs/ | Everything else — architecture, deployment, observability |
LoreKit is fully self-hostable — the whole stack (MCP server, dashboard, database) deploys to your own Supabase and Vercel projects in about five minutes. See docs/install.md.
LoreKit is an NX monorepo. To set it up locally, run the checks, and hack on any package, see DEVELOPMENT.md.
MIT © LoreKit contributors.
TypeScript
57.0%
JavaScript
28.4%
PLpgSQL
12.8%
MDX
1.6%