Package Exports
- nomi-agent
Readme
nomi-agent
Long-term memory for OpenCode — remember preferences, decisions, patterns and lessons across sessions.
Installation
Prerequisites
- Node.js ≥ 20 — Download here
- OpenCode installed and configured
Install Nomi
npx nomi-agent installThis single command downloads and installs Nomi into your OpenCode global config. No separate npm install needed — npx handles everything automatically.
Restart OpenCode after installation. Nomi will start injecting your memories into every session immediately.
Prefer a permanent global install?
npm install -g nomi-agent nomi-agent install
Verify installation
After restarting OpenCode, ask the agent:
remember this: I prefer concise code commentsIf Nomi responds with a confirmation, the installation is working.
What it does
Nomi gives OpenCode AI a persistent memory store. The agent automatically:
- Remembers preferences, decisions, patterns, and lessons you tell it
- Recalls relevant context at the start of each session
- Injects up to ~1500 tokens of relevant memories into the system prompt
Memories are stored locally in a JSONL file at:
~/.config/opencode/nomi/memories.jsonlOverride the path with NOMI_MEMORY_PATH=/your/path.
CLI reference
npx nomi-agent install # Install into OpenCode global config
npx nomi-agent update # Reinstall after upgrading the package
npx nomi-agent uninstall # Remove all installed filesWhat install does
- Copies compiled runtime to
~/.config/opencode/nomi/ - Runs
npm installinside that directory to resolve@opencode-ai/plugin - Writes generated plugin/tool files into your OpenCode config:
~/.config/opencode/plugins/nomi-memory.ts~/.config/opencode/tools/remember.ts~/.config/opencode/tools/recall.ts~/.config/opencode/tools/forget.ts~/.config/opencode/tools/list.ts~/.config/opencode/tools/dispatch_task.ts~/.config/opencode/tools/task_status.ts~/.config/opencode/tools/task_result.ts~/.config/opencode/tools/task_abort.ts~/.config/opencode/tools/list_tasks.ts~/.config/opencode/agents/nomi.md
Memory categories
| Category | Use for |
|---|---|
preference |
Communication style, code style preferences |
decision |
Technology choices and the reasoning behind |
pattern |
Project conventions, naming, code patterns |
lesson |
Bugs fixed, pitfalls to avoid next time |
context |
Project background, key dependencies, paths |
Local Dashboard
Nomi includes a local web dashboard for browsing and managing your memories.
cd nomi-dashboard
npm install
npm run build # build frontend assets
npm run api # start Hono server at http://127.0.0.1:3210Available at http://127.0.0.1:3210
The dashboard supports: list, search, filter by category/project, create, edit, delete, bulk delete, import, export, and stats.
Configuration
| Environment variable | Default | Description |
|---|---|---|
NOMI_MEMORY_PATH |
~/.config/opencode/nomi/memories.jsonl |
Where memories are stored |
OPENCODE_CONFIG_DIR |
~/.config/opencode |
Override OpenCode config root |
NOMI_INJECTION_LIMIT |
15 |
Max number of memories injected per session |
NOMI_TOKEN_BUDGET |
1500 |
Token budget for memory injection (in tokens) |
How injection works
At the start of each session the plugin selects memories up to a ~1500-token budget, in priority order:
- Global
preferencememories - Memories tagged with the current project directory
- High-hit-count global memories
Roadmap
| Status | Feature | Description |
|---|---|---|
| ✅ Done | remember / recall tools |
Agent-callable memory save and search |
| ✅ Done | Auto-capture | Detects "remember this: X" patterns automatically |
| ✅ Done | Session injection | Memories injected into system prompt on session start |
| ✅ Done | Local Dashboard | Web UI for browsing, editing, and managing memories |
| ✅ Done | CLI installer | npx nomi-agent install one-command setup |
| ✅ Done | forget tool |
Let the agent delete memories through conversation |
| ✅ Done | list tool |
Let the agent enumerate memories without a search query |
| ✅ Done | Configurable injection budget | NOMI_INJECTION_LIMIT / NOMI_TOKEN_BUDGET env vars |
| ✅ Done | Memory expiration / TTL | expires_at field — expired memories are excluded from injection and recall |
| ✅ Done | Passive auto-learning | Extracts implicit preferences from assistant responses ("I'll always…", "Going forward…", etc.); disable with NOMI_PASSIVE_CAPTURE=false |
| ✅ Done | Multi-project task dispatch | dispatch_task(directory, prompt) tool — spawn an OpenCode session in any directory and send a prompt non-interactively via Session.promptAsync() |
| ✅ Done | Task lifecycle tools | task_status / task_result / task_abort / list_tasks — monitor and manage dispatched sessions; state persisted in tasks.jsonl |
| 💡 Exploring | Semantic search | Embedding-based similarity instead of keyword tokenization |
| 💡 Exploring | Dashboard task panel | Extend nomi-dashboard with a task queue view: real-time status, message stream, and diffs for each dispatched session |
| 💡 Exploring | Cross-session context passing | Feed one session's Session.diff() / summary as the opening prompt of the next session — enabling sequential multi-repo pipelines |
| 💡 Exploring | Memory injection into sub-agents | Automatically inject project-scoped memories into each dispatched session so sub-agents have full context without re-explaining |
| 💡 Exploring | Parallel multi-repo execution | Dispatch the same task to N directories simultaneously; aggregate results and surface a unified diff |
| 💡 Exploring | DAG task orchestration | Define task dependency graphs (A → B+C → D); Nomi triggers downstream tasks automatically on completion |
| 💡 Exploring | Workspace adapter integration | Register a custom WorkspaceAdapter so OpenCode's native workspace switcher can route to Nomi-managed remote instances |
Contributing
git clone https://github.com/Zengxiaoer991214/nomi-agent.git
cd nomi-agent
npm install
npm run check # typecheck
npm run build # compile to dist/Project layout:
src/
memory/ # Core memory store (JSONL CRUD + search)
plugins/ # OpenCode plugin definition
tools/ # remember / recall tool definitions
cli/
install.ts # npx installer
nomi-dashboard/ # Local React dashboard (private, not published)
.opencode/ # Project-local OpenCode config (for development)License
MIT © Nomi Contributors