OpenCode × Nowledge Mem
Bring your cross-tool knowledge into OpenCode, and share what you learn in OpenCode with every other tool.
{
"plugin": ["opencode-nowledge-mem"]
}OpenCode 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)
- OpenCode installed
nmemCLI in your PATH. In Nowledge Mem go to Settings > Developer Tools > Install CLI, orpip install nmem-cli
nmem status # Nowledge Mem is running
opencode --version # OpenCode is availableSetup
Add the plugin
Add "opencode-nowledge-mem" to your OpenCode config:
{
"plugin": ["opencode-nowledge-mem"]
}For global use across all projects:
{
"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 a specific version:
{
"plugin": ["opencode-nowledge-mem@0.3.0"]
}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 |
The plugin also reads ~/.nowledge-mem/config.json (shared with all Nowledge Mem integrations). Environment variables take priority.
Remote access
{
"apiUrl": "https://your-server",
"apiKey": "your-key"
}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. Confirm "opencode-nowledge-mem" appears in your opencode.json plugin array. Restart OpenCode after config changes.
Related
- Integrations overview
- Claude Code · Pi · Hermes Agent · OpenClaw · Alma
- Plugin source: nowledge-mem-opencode-plugin