Your agent finally remembers.

opencode-mem gives OpenCode a long-term memory. It writes down what matters while you work and hands it back the moment it is useful again. Stop re‑explaining your codebase every Monday.

Free and open source. MIT licensed. Stored on your machine.

youAdd a delete button to the invoices page.

agentDone. It opens the in-app confirmation modal, not the browser confirm(). You asked for that two weeks ago.

recalled from memoryrule · never use the browser confirm() for destructive actions

Illustration. A session two weeks after you set the rule.

Every new session starts from zero. Until now.

Your agent is brilliant for an hour, then forgets everything. So you repeat yourself. Again.

Without opencode-mem

  1. youWe use pnpm here, not npm.
  2. youNo, the shared types live in packages/shared.
  3. youWe tried that retry fix last week. It broke the build.
  4. youPlease never use the browser confirm() dialog.

You, explaining it all again.

With opencode-mem

  1. agentRunning pnpm test.
  2. agentImporting the types from packages/shared.
  3. agentSkipping the retry fix: it broke the build last time.
  4. agentUsing the in-app modal for the delete flow.

You, shipping.

Three steps. Two of them you already do.

  1. Add one line

    Put opencode-mem in your OpenCode config and restart. OpenCode installs it from npm for you.

  2. Work like you always do

    When a session goes quiet, Auto-capture writes down the decisions, fixes, and preferences worth keeping. You never have to say “remember this”.

  3. Pick up where you left off

    Next session, the right memories are already in your agent's context. Nothing pasted into your prompt, nothing cluttering the chat.

youthe build fails on CI but passes locally

agentCI runs Node 20; the lockfile was made with Node 24. Pinned engines to 24.

younice, that was it

session idle · auto-capture

bug-fixCI must use Node 24, same as the lockfile

Install in under a minute

One line in your OpenCode config, then restart. The plugin writes a commented settings file on first start.

opencode.json
{
  "plugins": ["opencode-mem@latest"]
}

Then tell Auto-capture which provider to summarize with. inherit follows the model of your session.

~/.config/opencode/opencode-mem.jsonc
{
  "opencodeProvider": "anthropic",
  "opencodeModel": "inherit"
}
Full setup guide

A memory you can see, edit, and trust.

Everything opencode-mem keeps is yours to browse, pin, fix, or throw away.

Auto-capture
Writes memories for you when a session goes idle.
User Profile
Learns how you like to work, across every project.
Web UI
Browse, edit, pin, and delete memories at localhost:4747.
Markdown vault
Keep memories as plain .md files in a folder you already use.
Update-on-capture
When a fact changes, the old memory is updated instead of duplicated.
Dreaming
Merges overlapping memories and flags the ones that disagree.
Shared Skills
Write a procedure once. Your agent loads it when it needs it.
Health stats
Captures, injections, and errors for the last 14 days at a glance.
Memory Scope
Search this project, or everything you have ever worked on.

Under the hood

  • Embedded Turso/libSQL with native vector search, one shard per project
  • Local embeddings via @huggingface/transformers on ONNX, default Xenova/nomic-embed-text-v1
  • 12+ local embedding models, or any OpenAI-compatible endpoint
  • On OpenCode v2, memory context goes into the system context, not your prompt or transcript
How storage and embeddings work
mergedflaggedkept in trash

It tidies up while you are away.

Turn on Dreaming and once a day opencode-mem finds memories that say the same thing, merges them, and flags the ones that contradict each other. Superseded memories go to a trash you can restore. Pinned memories are never touched.

"dreaming": { "enabled": true }

Many repos. One memory.

A monorepo, a repo-tool workspace, a folder of services that belong together: drop one empty .opencode-mem-project file at the root and every repository underneath shares the same memory.

my-workspace/.opencode-mem-projectkernel/userspace/tools/one shared memory

Open the drawer. It is all there.

A local web UI shows every memory, your profile, your skills, and the health of the whole system.

opencode-mem web UI, Project memories view, dark themeopencode-mem web UI, Project memories view, light theme
The real opencode-mem web UI (v2.40.1), running with sample data.

Your memories live on your machine.

  • No account, no cloud. Memories are stored on your disk, under ~/.opencode-mem by default.
  • Local embeddings. Search runs on your CPU out of the box. No GPU, no embedding API needed.
  • Loopback by default. The web UI listens on 127.0.0.1. Expose it to a network and an API token becomes mandatory.
  • Secrets stay out. Recognizable credentials are redacted before anything is summarized. Wrap anything else in <private>.
  • Encrypted if you want. Turn on AES-256-GCM encryption at rest with one setting.

Auto-capture summarizes your session with the AI provider you choose, the same kind of request your agent already makes.

Open source. Check the numbers.

  • 1,818GitHub stars
  • 183forks
  • 112,646npm downloads in the last 12 months
  • 111versions published, latest v2.40.1

From the GitHub and npm APIs, fetched 2026-11-04.

Questions you might have

Does my code leave my machine?

Memories, embeddings, and the web UI stay local. The one outbound call is Auto-capture: it asks the AI provider you configure to summarize the session, much like your agent already does. Credentials are stripped first.

What does it cost?

Nothing. opencode-mem is MIT licensed and free. The only cost is the tokens Auto-capture uses on your provider, so pick a small model or inherit the one you already pay for.

Will it work with my setup?

It runs as an OpenCode plugin on v1 and v2, on Linux, Windows, and Apple Silicon Macs. Intel Macs are not supported because two native dependencies ship no x64 build there.

Do I need a GPU?

No. Local embeddings run on CPU and use about 0.5 to 2 GB of RAM while loaded. Prefer zero local load? Point it at a remote embeddings API.

Do I have to tell it what to remember?

No. Auto-capture handles it. When you want something saved right now, ask your agent to use the memory tool.

I already have AGENTS.md. Why this?

Keep stable, always-on rules in AGENTS.md. Memory is for what grows: decisions, failed attempts, bug patterns, and your preferences. They work best together.

Can I see and fix what it stored?

Yes. The web UI lists every memory with search, pin, edit, and delete, or switch to the Markdown vault and edit plain files.

Tomorrow's session already knows what today found out.