A persistent memory system for OpenCode with SQLite storage and a Web UI.
| Feature | Description |
|---|---|
| Persistence | SQLite-backed storage (project + global scopes) |
| Web UI | Dark/Light theme, bilingual (EN/ZH), tag filtering |
| Export | Single or bulk memory export as Markdown |
| Plugin | Integrates with OpenCode's memory tool |
memory_save— Save a memory with tags and scopememory_search— Search memories by content and tagsmemory_delete— Delete a memory by IDmemory_list— List memories with optional scope/tag filters
- Go 1.21+
- Bun 1.1+
git clone <repo-url>
cd opencode-webmem
bun run buildAdd to your ~/.config/opencode/opencode.json:
{
"plugins": [
{
"name": "memory-server",
"type": "plugin",
"path": "path/to/plugin/dist/index.js",
"command": "path/to/bin/memory-server"
}
]
}The executable name will be memory-server.exe on Windows.
Run the server manually:
bin/memory-serverbun run build # Full build (Go + Plugin)
bun run build --ci # CI mode (minimal output)
bun run build --go-only # Go backend only
bun run build --plugin-only # Plugin only
bun run build --verify # Check environment without building
bun run build --clean # Remove build artifactsgraph TD
A[OpenCode CLI] --> B[Plugin TS]
B --> C[Memory Server Go]
C --> D[(SQLite Project)]
C --> E[(SQLite Global)]
C --> F[Web UI]
F --> C
opencode-webmem/
├── backend/ Go backend (Gin + SQLite)
│ ├── main.go
│ ├── handlers/ HTTP handlers
│ └── storage/ SQLite storage layer
├── web/ Web UI
│ ├── index.html
│ ├── style.css
│ ├── app.js
│ └── locales/ Translation files
├── plugin/ OpenCode plugin (TypeScript)
│ └── src/index.ts
├── docs/ Screenshots and docs
├── bin/ Build output
├── build.ts Unified build script (Bun)
├── package.json Build entry
└── opencode.json Plugin config template
| Setting | Default | Description |
|---|---|---|
--port |
3847 |
Server port |
--static |
web |
Static files directory |
--db |
~/.config/opencode/memories/project.db |
Project DB path |
--global-db |
~/.config/opencode/memories/global.db |
Global DB path |
--auth-token |
"" |
Bearer token for API authentication (empty = disabled) |
--rate-limit |
60 |
Max API requests per minute per IP (0 = disabled) |
--backup-dir |
<db-dir>/backups/ |
Backup directory |
--backup-interval |
168h |
Backup interval (e.g. 168h for weekly) |
| Method | Path | Description |
|---|---|---|
GET |
/health |
Health check (DB ping) |
POST |
/api/memories |
Create memory |
GET |
/api/memories |
List memories |
GET |
/api/memories/:id |
Get memory |
PUT |
/api/memories/:id |
Update memory |
DELETE |
/api/memories/:id |
Delete memory |
GET |
/api/export/:id |
Export single memory |
GET |
/api/export |
Export all memories |
MIT