npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-nowledge-mem

v0.3.1

Published

Nowledge Mem plugin for OpenCode. Cross-tool knowledge: search, save, Working Memory, and distillation.

Readme

Nowledge Mem for OpenCode

Cross-tool knowledge, accessible in every OpenCode session. Your decisions, procedures, and context travel with you.

Nowledge Mem gives OpenCode access to knowledge from all your other AI tools: insights from Claude Code, Cursor, Codex, Gemini, ChatGPT, and every other environment you work in. One knowledge graph, available everywhere.

What you get

  • Start every session informed. The plugin loads your Working Memory briefing at session start: current priorities, recent decisions, open questions.
  • The agent searches for you. When past context would improve the answer, OpenCode finds it through your knowledge graph without being asked.
  • Insights stick around. Key decisions and learnings are saved to Nowledge Mem, ready for any future session in any tool.
  • Resumable handoffs. Save structured session summaries that any future session in any tool can pick up from.

Prerequisites

  1. Nowledge Mem desktop app running (or the server accessible on port 14242)
  2. nmem CLI on your PATH. In Nowledge Mem go to Settings > Developer Tools > Install CLI, or pip install nmem-cli
  3. OpenCode installed
nmem status        # Nowledge Mem is running
opencode --version # OpenCode is available

Setup

Add the plugin to your OpenCode config:

{
  "plugin": ["opencode-nowledge-mem"]
}

Or install globally:

{
  "plugin": ["opencode-nowledge-mem"]
}

Restart OpenCode to load the plugin.

Verify

Start a new OpenCode session and ask:

What was I working on recently?

OpenCode should call nowledge_mem_working_memory and return your current context. If Mem is not running, you will see a connection error in the tool output.

Update

The plugin follows OpenCode's standard plugin update mechanism. To pin a specific version:

{
  "plugin": ["[email protected]"]
}

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 (SDK extraction + HTTP). | | 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 three complementary ways:

  1. Background auto-sync (local mode). The desktop app periodically polls OpenCode's session database and imports conversations based on your sync policy. Enable OpenCode in Settings > Thread Sync. No plugin needed for this part.

  2. Plugin full session capture. nowledge_mem_save_thread reads the current session's messages via OpenCode's SDK and posts them to Nowledge Mem's thread API. Idempotent (safe to call multiple times) and handles large sessions via HTTP, not shell arguments. Works in both local and remote mode.

  3. Plugin proactive knowledge save. nowledge_mem_save captures individual decisions and insights as they happen. nowledge_mem_save_handoff creates a curated summary at wrap-up.

Remote mode note: Background auto-sync (1) reads OpenCode's local SQLite database, so it only works when both tools run on the same machine. The plugin tools (2, 3) work in both local and remote mode.

Hooks

The plugin uses two OpenCode hooks:

  • System prompt injection (experimental.chat.system.transform): teaches the agent when to read Working Memory, search proactively, and save autonomously. Active on every turn.
  • Compaction resilience (experimental.session.compacting): injects a reminder to restore Nowledge Mem context after long sessions trigger context compaction. Ensures the agent doesn't lose awareness of your knowledge tools.

For project-specific behavioral guidance, add to your AGENTS.md or OpenCode instructions. The included AGENTS.md in this package serves as a reference.

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.

Spaces

Spaces are optional. If one OpenCode process naturally belongs to one project or agent lane, launch OpenCode with:

NMEM_SPACE="Research Agent" opencode

The plugin's nmem calls and full-session thread save path will follow that lane. If you do not have a real ambient lane, stay on Default.

Shared spaces, default retrieval, and agent guidance still come from Mem's own space profile. OpenCode should pick the lane once, not invent a second plugin-local memory partition.

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 changes.

Links


Made with care by Nowledge Labs