Package Exports
- opencode-agentmemory-launcher
Readme
Agentmemory Launcher for OpenCode
OpenCode plugin that auto-starts the agentmemory backend with health-check supervision.
Requirements
- Node.js ≥ 18.0.0
- OpenCode with plugin support
- agentmemory backend (auto-installed via
npx @agentmemory/agentmemoryif not present)
What It Does
This plugin automatically starts the agentmemory backend (REST API + iii-engine) when OpenCode loads its configuration. It runs once per OpenCode process and health-checks the backend every 60 seconds, restarting it if the process dies.
Installation
From npm (recommended)
Add to your OpenCode config:
// opencode.json
{
"plugin": ["opencode-agentmemory-launcher@latest"]
}OpenCode will automatically install the package at startup. See the OpenCode Plugins documentation for more details.
From local file
Place the plugin file in .opencode/plugins/:
.opencode/plugins/
└── agentmemory-launcher.tsFiles in this directory are automatically loaded at startup.
Manual Installation (from GitHub Releases)
- Download the latest release from GitHub Releases
- Extract the archive
- Copy the
dist/folder into.opencode/plugins/agentmemory-launcher/:
.opencode/plugins/agentmemory-launcher/
├── agentmemory-launcher.js
├── agentmemory-launcher.js.map
├── agentmemory-launcher.d.ts
└── agentmemory-launcher.d.ts.map- Add to your OpenCode config:
// opencode.json
{
"plugin": ["./plugins/agentmemory-launcher/agentmemory-launcher.js"]
}Usage
This launcher starts the agentmemory backend. To use agentmemory with OpenCode, also install the agentmemory plugin and refer to the OpenCode agentmemory plugin usage guide for setup instructions, available tools, and configuration options.
How It Works
- On first config load: The plugin starts a health-check interval (60s)
- Health check: Pings
GET /agentmemory/healthon the backend - Auto-restart: If the health check fails, spawns
npx @agentmemory/agentmemoryin a detached process - Debug mode: Set
OPENCODE_AGENTMEMORY_DEBUG=1for verbose logging
Environment Variables
| Variable | Default | Description |
|---|---|---|
AGENTMEMORY_URL |
http://localhost:3111 |
Backend API URL |
OPENCODE_AGENTMEMORY_DEBUG |
unset | Set to 1 for debug logging |
API
The plugin exports a single object conforming to the @opencode-ai/plugin interface:
import type { Plugin } from "@opencode-ai/plugin";
export const AgentmemoryLauncherPlugin: Plugin;This plugin implements the config lifecycle hook, which is called each time OpenCode loads its configuration.
Development
# Install dependencies
npm install
# Type-check
npm run typecheck
# Build
npm run build
# Run tests
npm testCommunity
License
GNU Affero General Public License v3.0
Copyright
Copyright (C) 2026 Cle2ment.