OpenLTM – Local, self-decaying memory for AI coding agents
OpenLTM is an open-source, MIT-licensed long-term memory plugin for AI coding agents like Claude Code, OpenCode, and Pi. It provides automatic semantic memory capture, recall, and importance-weighted decay, with no cloud dependency. The plugin stores memory locally in SQLite and offers hooks, commands, and a graph visualizer.
Uh oh!
There was an error while loading. Please reload this page.
Notifications You must be signed in to change notification settings
Fork 0
Star 13
BranchesTags
Open more actions menu
Folders and files
NameName
Last commit message
Last commit date
Latest commit
History
243 Commits
243 Commits
.claude-plugin
.claude-plugin
.github
.github
agents
agents
assets
assets
commands
commands
docs
docs
graph-app
graph-app
hooks
hooks
migrations
migrations
packages
packages
scripts
scripts
skills
skills
src
src
.env.schema
.env.schema
.gitignore
.gitignore
.npmrc
.npmrc
.pre-commit-config.yaml
.pre-commit-config.yaml
.trufflehogignore
.trufflehogignore
AGENTS.md
AGENTS.md
CHANGELOG.md
CHANGELOG.md
CLAUDE.md
CLAUDE.md
CONTRIBUTING.md
CONTRIBUTING.md
LICENSE
LICENSE
README.md
README.md
bun.lock
bun.lock
bunfig.toml
bunfig.toml
install.sh
install.sh
package.json
package.json
tsconfig.json
tsconfig.json
Repository files navigation
You explained your auth layer once. Why does Claude ask again tomorrow?
Long-Term Memory for AI coding agents — Claude Code, OpenCode, and Pi
Persistent semantic memory that survives every session, every update, every compaction.
📣 Now open source
OpenLTM was born as a private memory layer for Claude Code. Today it's fully open source under MIT.
Same engine — automatic capture, semantic recall, importance-weighted decay, a queryable memory graph — now yours to read, fork, and extend. What started as one developer's "stop re-explaining my codebase" plugin is now an open foundation for agent memory across Claude Code, OpenCode, and Pi.
🔓 MIT licensed — no cloud, no account, no telemetry. Your memory lives in a local SQLite DB you own.
🧩 Provider-agnostic — one core (@rohirik/openltm-core), thin adapters per host.
🛠 Hackable — hooks, skills, janitor providers, and the graph visualizer are all in the open.
Migrating from an earlier install? The marketplace is now RohiRIK/OpenLtm and the plugin is openltm. Your existing memory database carries over.
The philosophy
Four ideas. No exceptions.
Memory should be automatic. Hooks do the work. The session end hook extracts patterns, the session start hook injects them back. You shouldn't have to remember to remember.
Decay is a feature, not a bug. A gotcha from six months ago that you never revisited probably no longer applies. Set importance: 5 to make something permanent — everything else ages out naturally.
Semantic over keyword. FTS5 full-text search runs first; if it returns nothing, vector embeddings kick in. You search by meaning, not exact words — "how we handle async errors" finds the right memory even if you never wrote those exact words.
Zero config, zero lock-in. Install once, works everywhere. Every setting has a sane default. The DB lives outside the plugin directory so it survives every update. No cloud, no telemetry, no account.
What you get
🔍 Recall Past decisions, patterns, and gotchas — before you start work
🧠 Learn Every session, automatically — no manual note-taking
💉 Inject Top context at session start so Claude picks up where it left off
⏳ Decay Stale memories fade while critical knowledge lives forever
🕸 Graph Traverse relationships between memories for reasoning chains
🗺 Visualize See your entire memory network in a browser-based explorer
⚡ Vec Recall Semantic vector (KNN) recall via sqlite-vec; degrades to JS-cosine when unavailable
🔌 Extensions sqlite-vec + Honker (queue/cron/pub-sub) loaded dynamically; graceful fallback without system libsqlite3
Install
Marketplace (recommended)
claude plugin marketplace add https://github.com/RohiRIK/OpenLtm claude plugin install openltm
Restart Claude Code. That's it. Four Claude Code hooks + one git post-commit hook auto-wire, four commands load, five skills activate, and your openltm.db migrates or creates itself.
bunx (no clone)
bunx @rohirik/openltm-core # auto-detect Claude Code, OpenCode bunx @rohirik/openltm-core --pi # experimental Pi adapter bunx @rohirik/openltm-core --dry-run --claude # preview without writing
Dev / git clone
git clone https://github.com/RohiRIK/OpenLtm ~/Projects/OpenLtm cd ~/Projects/OpenLtm && bash install.sh
Quick Start
Start a new session. Context is injected at the top automatically.
Then try:
/openltm:memory recall auth — what do we know about auth in this project? /openltm:memory learn — save something worth keeping /openltm:health — memory health + decay summary /openltm:project init — set a goal for the current project
That's it. The rest is hooks doing the work.
The shape of memory
Claude Code │ ├── 4 Commands ──┐ ├── 5 Skills ──┼──▶ openltm MCP server ──▶ openltm.db └── 5 Hooks ──┘ (memories, tags, context_items, memory_relations, memories_fts)
Full deep-dive — schema, hook architecture, decay formula, ADRs — in How It Works and Architecture.
SQLite Extensions: The plugin loads sqlite-vec (vec0 / KNN vector search) and Honker (async embedding queue, leader-elected cron, pub-sub) when a system extension-enabled libsqlite3 is available. Both degrade gracefully — missing binary or library leaves the capability off and falls back to JS-cosine, file-watch polling, or in-process cron. Controlled with LTM_DISABLE_VEC, LTM_DISABLE_HONKER, LTM_SQLITE_LIB, and LTM_HONKER_EXT env vars.
Verify
/openltm:health # plugin health + hooks + decay /openltm:memory recall test # returns results (or "no results" on fresh install)
Start a new session — you should see context injected at the top. If not, run /openltm:health to diagnose.
Go deeper
Full documentation index: docs/.
I want to… Read
Get running in five minutes Quickstart
See every install option Installation
Use every command and its flags Commands
Tune decay, injection, embedding behavior Configuration
See how it works under the hood How It Works · Architecture
Understand the schema and data model DB Spec
See all hooks, skills, and MCP tools Hooks · Skills · MCP Tools
Fix a problem Troubleshooting
See the product vision and where it's going PRD · Roadmap
Contribute a change Contributing
Check what changed Changelog
Contributing
Open an issue first to discuss the change, then send a PR. The full workflow — setup, tests, the version-bump rule, and release steps — is in CONTRIBUTING.md.
Report a Bug
License
MIT — RohiRIK
Built for Claude Code
Powered by caffeine, SQLite, and the persistent belief that context shouldn't die at the end of a session.
About
Long-Term Memory plugin for Claude Code — semantic search, context injection, session learning
Resources
Readme
License
MIT license
Contributing
Contributing
Uh oh!
There was an error while loading. Please reload this page.
Activity
Stars
13 stars
Watchers
0 watching
Forks
0 forks
Report repository
Releases 11
v2.9.0
Latest
Jun 8, 2026
+ 10 releases
Sponsor this project
Uh oh!
There was an error while loading. Please reload this page.
Packages 0
Uh oh!
There was an error while loading. Please reload this page.
Contributors
Uh oh!
There was an error while loading. Please reload this page.
Languages
TypeScript 99.3%
Other 0.7%