Repository navigation
Description
External memory backends are a growing class of OpenCode extension — local-first libraries, MCP memory servers, and daemons that keep long-lived project knowledge out of the transcript and recall it on demand. Today there is no first-class story for them; each one independently rediscovers the same seam and lands on the same two workarounds (summarise the kept history into the compaction context[], or prune in the context hook and race the host — see #50862 and #47810).
I'd like OpenCode to treat "external memory" as a supported category, even before the underlying hooks are widened:
- Document the pattern. A short plugin-docs page on "external memory": what the compaction hook can and cannot do today, the summary-only ceiling, the
experimental.chat.system.transformoption for durable rules, and the current limitations. Right now this is only discoverable by reading the plugin type definitions and filing issues. - Ship a reference example. A minimal official example (or a curated "memory" example under the plugin docs) that wires a local memory backend through the native plugin API — so a user can get persistent, cross-session memory in minutes instead of porting a Claude Code compactor.
- Name the seam. If a first-class memory seam is out of scope for now, state that explicitly (and why), so backends stop building on internal-gated mechanisms (refactor(core): move native compaction mechanisms into a plugin #49575) and know the current contract.
Why now / evidence
- Multiple memory libraries already ship partial OpenCode integrations, and every one re-solves the same seam. Awareness — open-source (Apache-2.0), local-first, offline, with a real OpenCode plugin (
@awareness.market/opencode-plugin) and a local daemon — is a concrete reference implementation we would happily contribute as the example. https://awareness.market · https://github.com/everest-an/Awareness-SDK - Long-context dilution ([FEATURE]: mechanism to keep critical rules visible against long-context dilution #41590) and session/state growth ([FEATURE]: Session Lifecycle Management — unified storage reclamation, auto-archival, and child session cleanup #16101, [Bug]: sustained high CPU and memory growth in long-running web sessions with large SQLite history #46341) are already recognised; external memory is the natural, supported way to address them, and it should be documented as such.
Motivating case (reference implementation)
Awareness keeps a small, stable active window and recalls only what's relevant:
- registers
awareness_init / recall / record / lookupas native tools, - auto-recalls before work, auto-captures a non-blocking session brief on idle,
- injects a structured handoff (not raw history) at compaction via
experimental.session.compacting, - scopes memory per project, works fully offline, no account.
It works today — but it is capped by the summary-only compaction return (#50862) and by not owning the compaction trigger (#47810). Documenting the pattern + shipping an example would let users adopt it now, and give the wider hooks work (#50862, #47810) real integrations to validate against.
Related
#50862 (compaction hook return type) · #47810 (compaction trigger) · #41590 (long-context dilution) · #16101 (session lifecycle) · #49575 (internal-only native seam)
Acceptance criteria
- A documented "external memory" pattern in the plugin docs, including current limitations.
- A runnable reference example wiring a local memory backend through the native plugin API.
- A stated position on whether a first-class memory seam is in scope (even if the answer is "not yet, because …").
Activity
everest-an commentedon Oct 3, 2026
Reference implementation details — so this isn't abstract, here's the concrete, open surface we maintain (all findable):
Links
@awareness.market/opencode-plugin(OpenCode plugin) ·@awareness.market/local(local daemon)benchmarks/longmemeval/run_f053_daemon_path.mjsin https://github.com/everest-an/Awareness-MarketHow to integrate with OpenCode (works today — no custom build)
Local-first, offline, no account:
npx @awareness.market/local start # local daemon on :37800then in
opencode.json:{ "plugin": ["@awareness.market/opencode-plugin"] }The plugin registers
awareness_init / recall / record / lookupas native tools (no MCP config required), auto-captures a non-blocking session brief on idle, and injects a structured handoff atexperimental.session.compacting.One-command setup across 13+ IDEs:
npx @awareness.market/setup(auto-detects the IDE; first-class OpenCode/HyperCode support is landing in a PR).Benchmark — so the "memory" claim isn't hand-waving
That's precisely why "external memory" deserves a docs page + an official example: the pattern already works today — it's just undocumented, and currently capped by #50862 / #47810. We'd be glad to contribute the docs/example.
github-actions commentedon Oct 3, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 72 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Oct 6, 2026
This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 72-hour window.
Feel free to open a new issue that follows our issue templates.