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

@eleboucher/opencode-memini

v0.4.14

Published

Automatic cross-session memory for opencode via memini — recall before each turn, capture after.

Readme

memini + opencode

opencode supports plugins — JS/TS modules that hook into its lifecycle. memini ships a native plugin in plugin/ that makes memory automatic: it recalls relevant memories before each turn and captures completed turns afterward, with no tool calls required from the model.

Recommended: the memory plugin

What it wires (two hooks):

  • chat.message — searches memini for the incoming user message and prepends the matches as a synthetic context part before the turn runs. It excludes this session's own captured turns (already in the live context), so they aren't echoed back as memory a turn behind; past sessions still recall.
  • event (session.idle) — once the session goes idle, stores the completed user/assistant turn back into memini (episodic, tagged with the session id) so it can be recalled later.

Install

Add the package to the plugin array in your opencode.json — a project opencode.json to scope it to one repo, or ~/.config/opencode/opencode.json for every project:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@eleboucher/opencode-memini"]
}

opencode installs it from npm with Bun at startup.

Configure

Pass options inline via the [name, options] form:

{
  "plugin": [["@eleboucher/opencode-memini", { "namespace": "my-project", "recall_limit": 8 }]]
}

| Option | Env var | Default | Purpose | | ------------------- | -------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | base_url | MEMINI_BASE_URL | http://localhost:8080 | memini REST base URL (alias: MEMINI_URL) | | namespace | MEMINI_NAMESPACE | git repo basename | tenant the memory is scoped to (X-Memini-Namespace) | | recall | MEMINI_RECALL | on | false disables recall-before-turn | | capture | MEMINI_CAPTURE | on | false disables capture-after-turn | | recall_limit | MEMINI_RECALL_LIMIT | 5 | max memories injected per turn | | recall_max_tokens | MEMINI_INJECT_RECALL_MAX_TOK | 0 | hard ceiling on the recall-block tokens (0 = unbounded); the tail is dropped with a [… N item(s) truncated by token budget] footer | | recall_min_score | MEMINI_INJECT_RECALL_MIN_SCORE | 0 | fused-score floor (>=) sent as min_score to /v1/search | | timeout_ms | MEMINI_TIMEOUT_MS | 30000 | per-request timeout | | fallback_on_error | MEMINI_FALLBACK | on | false surfaces errors instead of degrading silently | | — | MEMINI_INJECT_LABELS | — | comma-separated label toggles for each bullet: tier, confidence, age | | — | MEMINI_API_KEY | — | bearer token, if memini needs auth (env only — secret; alias: MEMINI_TOKEN) | | — | MEMINI_REQUIRE_HTTPS | — | 1 refuses to send the token over plaintext HTTP |

Inline options win over the env vars. Secrets stay in the environment: set MEMINI_API_KEY (sent as Authorization: Bearer …), and optionally MEMINI_REQUIRE_HTTPS=1 to refuse plaintext HTTP, in the shell that launches opencode — not in opencode.json.

Every option is optional, namespace included: ["@eleboucher/opencode-memini"] runs with no config. Unset, the plugin derives the namespace from the git worktree basename and sends it as the X-Memini-Namespace header, so scoping stays correct even against a remote memini (the HTTP MCP wire below can't — a remote server has no access to your cwd). Set it to share one memory pool with your other agents.

Tests

cd integrations/opencode/plugin && node --test

Alternative: manual MCP wire (tools, not automatic)

Instead of the plugin you can expose memini's memory_* tools to the model and let it call them on demand. opencode reads MCP servers from opencode.json under mcp. This wire gives the model the full tool set, including memory_recall (with tags / metadata filters), memory_list (query-less browse by tier / tags / metadata category), and memory_remember. Set metadata.category on writes to browse by subject later — see docs/categories.md.

Remote: merge opencode.json into your config.

Local (stdio): see opencode.local.json — opencode spawns memini mcp.

Mind the context budget: memini adds a handful of tools, which is light, but disable other large MCP servers you aren't using. Use the same X-Memini-Namespace as your other agents to share memory. my-project is a placeholder — replace it with your real project name, or drop the header and let memini auto-resolve from its own working directory.