OpenCode × Nowledge Mem
Bring your cross-tool knowledge into OpenCode, and share what you learn in OpenCode with every other tool.
For your agent
Give this line to your agent. It should read the live guide before changing anything:
Read https://mem.nowledge.co/docs/integrations/opencode.mdx, then help me install or update Nowledge Mem for OpenCode. Use the recommended path first, verify the setup with the success check in the guide, and summarize what changed.opencode plugin opencode-nowledge-mem -gOpenCode is a powerful terminal coding agent. Nowledge Mem adds the layer above: knowledge from all your other AI tools, decisions made in Claude Code, preferences set in Cursor, insights from ChatGPT, searchable inside OpenCode. And what you learn in OpenCode flows back to every other tool.
Before You Start
- Nowledge Mem running locally (installation) or a reachable remote Mem server
- OpenCode installed
nmemCLI in your PATH. In Nowledge Mem go to Settings → Preferences → Developer Tools → Install CLI, orpip install nmem-cli
nmem status # Nowledge Mem is running
opencode --version # OpenCode is availableSetup
Install the plugin
Install the npm plugin and let OpenCode update your config:
opencode plugin opencode-nowledge-mem -gUse -g for global use across all projects. Omit it when you only want the plugin in the current project.
If you prefer editing config manually, add the plugin name yourself:
{
"plugin": ["opencode-nowledge-mem"]
}Restart OpenCode
Close and reopen OpenCode so it loads the plugin.
Verify the integration
Ask OpenCode to check your Nowledge Mem connection:
What was I working on recently?You should see OpenCode call nowledge_mem_working_memory and return your current context. That's success: OpenCode can now see knowledge from your other tools.
Update
To pin or replace a specific version:
opencode plugin opencode-nowledge-mem@0.3.3 -g --forceCustomize Safely
Use OpenCode's own instruction surfaces, not the installed plugin files:
AGENTS.mdin the repo when this project needs shared behavior~/.config/opencode/AGENTS.mdfor your personal defaultsinstructionsinopencode.jsonwhen you want host-level config instead of file-based guidance
Do not edit the installed Nowledge Mem plugin package directly. For the full host-by-host map, see Customize Integration Behavior.
What You Can Do
Find knowledge from other tools
Ask "what did we decide about the database?" and OpenCode searches across decisions you made in Claude Code, insights from ChatGPT, notes from Cursor, not just this session.
Save knowledge for everywhere
When you reach a conclusion in OpenCode, the agent saves it so your next Claude Code session, Cursor project, or ChatGPT conversation can find it too.
Start with today's context
Your Working Memory briefing and relevant past knowledge are ready before you type. No repeating yourself across tools.
Create resumable handoffs
Wrap up in OpenCode, then pick up right where you left off in Claude Code or any other tool. Decisions, plans, and context carry over automatically.
Tools
| Tool | What it does |
|---|---|
nowledge_mem_working_memory | Read today's Working Memory: focus areas, priorities, recent activity. |
nowledge_mem_search | Search knowledge from all your tools. Supports label, date, and deep mode filters. |
nowledge_mem_save | Save a decision, insight, or preference so any tool can find it. |
nowledge_mem_update | Update an existing memory with refined information. |
nowledge_mem_thread_search | Search past conversations from any tool. |
nowledge_mem_save_thread | Save the current session as a full conversation thread. |
nowledge_mem_save_handoff | Save a curated handoff summary (lighter, agent-composed). |
nowledge_mem_status | Check Nowledge Mem server connectivity and diagnostics. |
How Session Capture Works
Nowledge Mem captures OpenCode sessions in two complementary ways:
Background auto-sync. The desktop app periodically polls OpenCode's session database and imports conversations based on your sync policy. Enable OpenCode in Settings > Thread Sync to activate this. No plugin needed for auto-sync.
Plugin full session capture. nowledge_mem_save_thread reads the current session's messages via OpenCode's SDK client and posts them to Nowledge Mem over HTTP. Safe to run multiple times, handles large sessions, and works in both local and remote mode.
Plugin proactive knowledge save. nowledge_mem_save captures individual decisions and insights during the conversation. nowledge_mem_save_handoff creates a curated summary at wrap-up. Both complement the full transcript with focused, high-value takeaways.
The plugin also handles long sessions gracefully. When OpenCode trims earlier context to stay within limits, the plugin automatically re-introduces your Nowledge Mem tools so the agent stays connected.
Background auto-sync reads OpenCode's local database directly, so it only works when Nowledge Mem and OpenCode are on the same machine. In remote mode, use the plugin's save tools or nmem t save from the client machine.
Configuration
No config needed for local use.
| Env Variable | Default | What it does |
|---|---|---|
NMEM_API_URL | (local) | Remote Nowledge Mem server URL |
NMEM_API_KEY | (none) | API key for remote access |
For a persistent shared setup, configure this machine once with nmem config client .... Environment variables still take priority when you need a temporary override.
Remote access
nmem config client set url https://your-server
nmem config client set api-key your-keyOpenCode uses that same shared config for both nmem command tools and HTTP full-session capture.
See Access Mem Anywhere.
Troubleshooting
nmem not found. Install with pip install nmem-cli, then run nmem status to verify.
Server not responding. Start the Nowledge Mem desktop app, or check nmem status for diagnostics.
Plugin not loading. Re-run opencode plugin opencode-nowledge-mem -g --force, confirm "opencode-nowledge-mem" appears in your opencode.json plugin array, then restart OpenCode.
Related
- Integrations overview
- Claude Code · Pi · Hermes Agent · OpenClaw · Alma
- Plugin source: nowledge-mem-opencode-plugin