项目介绍
Agent 开发框架 · 2026-11-09 更新 · 本站尚未实测
n3rv 是一个面向 opencode 的运行时库与配置生成器。按 README 定位,它不提供现成应用,而是把一个已有仓库(Python / Node / Go / 通用栈)脚手架化为“代理原生工作区”:生成 AGENTS.md、opencode.json、.opencode/ 下的 skills、agents、commands、plugins,以及用于记忆、代码索引和任务状态的 .n3rv/ 目录。
README 将其描述为运行在工作区底层的守护进程,同时提供 A2A 任务中枢、持久语义记忆、代码图谱和结构化 SDD 工作流。需要注意:它是绑定 opencode 这一特定客户端的框架型项目,不是可直接下载的单个 Agent 或工作流文件。
核心能力
点击能力名称查看输入、输出和原文依据。
- 四个 MCP 服务(均为 stdio 服务,由 opencode 通过
opencode.json启动):n3rv-memory(12 个工具,记忆保存/检索/时间线/裁剪等)、n3rv-hub(5 个工具,任务委派与状态查询)、n3rv-exec(8 个工具,lint/类型检查/测试/缓存统计)、n3rv-code-graph(6 个工具,AST 索引、引用、影响面)。README 称合计 31 个工具,详见docs/MCP-TOOLS.md。 - A2A 中枢:通过
127.0.0.1:19820进行跨进程任务委派,JSON-RPC + SSE,任务状态文件持久化。 - 记忆子系统:ChromaDB 向量 + SQLite 关系与裁决,另有 BM25 冲突检测与 TTL 清理。
- 代码图谱:目前 README 明确说明 AST 索引针对 Python,支持符号、导入、调用点、影响面
affected、FTS5 搜索和explore。 - 通用执行:README 声称覆盖 20 多种语言的 lint / 测试 / 类型检查链路,并以 hash 缓存结果。
- 供应商抽象:
get_provider()支持qwen、openai、local、fallback,另含 TTS 供应商与回退链。 - SDD 工作流:8 阶段
explore → propose → spec → design → tasks → apply → verify → archive,另有轻量 Spec-Kit 路径。 - 守护进程:
n3rv daemon基于 systemd 用户单元,一台机器一个 hub。
实际应用场景
适用场景
适合已经在使用 opencode、希望为代理补充跨会话记忆、代码库理解与任务委派能力的开发者;也适合需要在多项目工作区中统一 skills 与 hub 注册表的团队(n3rv org)。不适合作为独立 Agent 平台使用,也不适合只想要开箱即用图形界面的用户。
安装与接入
README 给出的安装方式为从 Git 源安装,或本地开发模式安装,然后再执行初始化与启动 hub。环境要求为 Python ≥3.11。
pip install git+https://github.com/juanmanueldaza/n3rv.git
安装后进入要配置的项目运行 n3rv init。守护进程通过 systemd 用户单元管理,具体安装、启用和状态检查请按原仓库 Quick Start 执行。
初始化后生成的 opencode.json 会注册四个 MCP 服务,并设置 N3RV_AGENT_SOURCE=opencode。README 强调四个服务均为 stdio 类型,未提供远程 HTTPS 端点,也未提供独立的 MCP 客户端配置示例,其他客户端是否可用待核验。
使用条件与限制
- 是否需要部署
- 需自行准备运行环境,具体要求见正文
- 是否需要注册
- 账号和认证要求见正文;未明确说明的项目仍待核验
- 是否需要 API Key
- 待核验
- 费用与额度
- 费用边界见正文,项目许可不代表模型或托管服务免费
- 所需权限
- 待核验
- 许可证与服务条款
- 待核验
权限费用与限制
- API Key:使用 Qwen 需要
DASHSCOPE_API_KEY,使用 OpenAI 需要OPENAI_API_KEY;默认供应商为qwen,默认模型qwen3-coder-plus,默认基地址为 DashScope 国际站兼容接口。该默认地址为境外服务端点,实际可用性与计费以供应商官方为准。 - 费用:仓库代码以 Apache-2.0 发布,但模型调用、向量服务等第三方资源费用 README 未说明,需向对应供应商核验;未发现收费模块说明。
- 权限:守护进程使用 systemd 用户单元;hub 默认仅监听本机回环地址。记忆配置
N3RV_MEMORY_PROFILE=safe可切换为只读、禁用删除与裁剪,说明默认full模式包含删除与裁剪能力,需谨慎使用。 - 限制:代码图谱索引 README 明确写为 Python AST;执行器覆盖多语言的说法来自 README 自述,未经独立核验。Windows 支持、国内网络可用性等均无资料依据,待核验。
国内使用情况
网友核验 用户经验分享
与站长实测独立,不代表官方认证或本站已实测。
最近核验:暂无有效核验。参与人数按当前项目有效身份去重;不同核验项分别统计,不合并成用户总结果。仅统计审核通过且未过期的记录。
分项统计、有效期与样本量
| 核验项目 | 有效人数 | 成功 / 部分 / 失败 / 无法判断 | 成功率 | 最近核验 / 有效期 |
|---|---|---|---|---|
| 官方网站访问 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| GitHub 仓库访问 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| 安装与运行 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 官方服务国内连接 / MCP 连接 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 国内网络情况 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| 国内模型兼容性 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 自定义 API | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 海外服务依赖 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 海外账号要求 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 中文界面 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 客户端兼容性 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 账号及费用信息 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
成功率 = 成功 ÷(成功 + 部分成功 + 失败);无法判断不计入分母。至少 5 份可判断结果才显示成功率。账号、费用、海外依赖与语言等事实项,成功表示核查结论与资料吻合,具体观察另行统计;不表示免费或没有海外依赖。不同网络、客户端和版本的结果不能直接等同。
最近有效核验
暂无审核通过且未过期的网友核验。欢迎提交真实使用记录。
查看全部有效核验 →国内实测状态:国内可用性待核验。协议兼容和官方资料说明不等于国内网络可用。
- 官方网站访问
- 尚未实测 待核验
- GitHub 仓库访问
- 尚未实测 待核验
- 官方服务国内连接
- 尚未实测 待核验
- 国内网络情况
- 尚未实测 待核验
- 国内模型兼容性
- 尚未实测 待核验
- 自定义 API
- 尚未实测 待核验
- 海外服务依赖
- 尚未实测 待核验
- 海外账号要求
- 尚未实测 待核验
- 中文界面
- 尚未实测 待核验
- 国内最后核验时间
- 尚未实测
许可与国内使用
仓库代码采用 Apache-2.0,LICENSE 文件已获取。README 说明 Evangelion 相关概念仅为隐喻,与 Gainax/Khara 无关联。许可证只覆盖本仓库代码,不覆盖 opencode 客户端、DashScope/OpenAI 等第三方模型服务或 ChromaDB 等依赖。国内使用方面,默认供应商走 DashScope 国际站地址,是否可直连、是否需要切换为 local(Ollama/vLLM 兼容)或国内端点,资料未作说明,需自行核验。项目是否仍在积极维护无法从资料确认,可通过仓库提交记录判断。
项目资料与来源
字段依据与待核验事项
access:来源确认 · pip install git+https://github.com/juanmanueldaza/n3rv.git
project_type:来源确认 · n3rv is a **runtime library and config generator** for [opencode](https://github.com/opencode-ai/opencode). It scaffolds any repo (python/node/go/generic) into an agent-native workspace: skills, MCP servers, daemon, and provider abstraction.
原始 README(折叠技术参考)
# n3rv
**Invisible engineering infrastructure for opencode agents.**
> The harness that contains, restrains, and orchestrates LLMs — A2A hub, persistent semantic memory, code graph, and structured SDD workflows. The daemon runs beneath your workspace. You never see it.
Maintained by [Juan Manuel Daza](https://github.com/juanmanueldaza) · [n3rv.daza.ar](https://n3rv.daza.ar) · Apache-2.0 · Python ≥3.11
---
## What This Is
n3rv is a **runtime library and config generator** for [opencode](https://github.com/opencode-ai/opencode). It scaffolds any repo (python/node/go/generic) into an agent-native workspace: skills, MCP servers, daemon, and provider abstraction. Satellites and standalone projects use it at runtime for provider resolution and task routing.
```
your-project/
├── AGENTS.md ← coding standards for every agent
├── opencode.json ← 4 MCP servers + env wiring
├── .opencode/ ← skills, agents, commands, plugins
├── .n3rv/ ← Geofront: memory, code_graph, hub-state, logs
│ ├── memory/chroma/ ← ChromaDB vectors (Melchior)
│ ├── memory/relations.db ← SQLite relations (Balthasar)
│ ├── code_graph.db ← AST index (symbols/imports/calls)
│ ├── exec.db ← lint/test cache (XXH3)
│ ├── hub-state/ ← persisted A2A tasks
│ └── a2a-config.yaml ← hub host/port + project name
└── .githooks/pre-push ← SDD verification gate
```
## Features
| Subsystem | What it does |
|-----------|--------------|
| **4 MCP Servers** | `n3rv-memory` (12 tools), `n3rv-hub` (5), `n3rv-exec` (8, universal 20+ langs), `n3rv-code-graph` (6) |
| **A2A Hub** | Cross-process task delegation over `127.0.0.1:19820` — `delegate_task → check_pending_tasks → complete_task`, JSON-RPC + SSE, file-persisted |
| **MAGI Memory** | ChromaDB (vectors, ONNX/hash fallback) + SQLite (relations/judgments) + SessionManager. SDD artifacts, conflict detection (BM25), TTL pruning |
| **Code Graph** | AST index (Python) — symbols, imports, call sites, blast-radius `affected`, FTS5 search, surgical `explore` (nodes+code+call_paths+blast_radius) with watcher debounce + staleness banner |
| **Universal Exec** | One toolchain for 20+ langs: `ruff→eslint→golangci→clippy→…`, `pytest→npm→go→cargo`, `mypy→tsc→vet` — XXH3 `inputHash=fileHashes:configHash:toolHash` (70× cache) + `exec_affected` via code graph (50–75% prune) |
| **Provider Abstraction** | `ModelProvider` Protocol + `get_provider("qwen"|"openai"|"local"|"fallback")` with `N3RV_PROVIDER` + `N3RV_FALLBACK_PROVIDERS`. Includes `get_tts_provider()` / `TTSFallbackProvider` |
| **Input Validation** | `n3rv.limits` — `validate_text_input`, `validate_image_input`, `validate_audio_*`, `estimate_tokens` for satellite payloads |
| **Config Generation** | Jinja2-templated scaffold of `AGENTS.md`, `opencode.json`, skills (18), agents (7), commands (8), plugins, hooks — stack-aware (python/node/go/generic) |
| **Org Mode** | Multi-satellite workspace: `n3rv org init|add-satellite|sync|protect` — shared skills, hub registry, branch protection |
| **SDD Workflow** | 8-phase `explore → propose → spec → design → tasks → apply → verify → archive` + `converge` + lighter Spec-Kit path (`spec/plan/tasks` under `.specify/`) |
| **Daemon** | `systemd --user` unit (`n3rv daemon install|enable|start|stop|status|logs`) — one hub per machine, all projects share it |
## Quick Start
```bash
# install
pip install git+https://github.com/juanmanueldaza/n3rv.git
# or for development
pip install -e ".[dev]"
# scaffold your project
cd your-project
n3rv init # auto-detects stack
n3rv init --stack python --force # explicit
# start the hub (daemon recommended)
n3rv daemon install
n3rv daemon enable --now
n3rv daemon status
# or foreground for dev
n3rv hub start
# verify
n3rv --help
n3rv-memory --help # 12 tools
n3rv-hub --help # 5 tools
n3rv-exec --help # 8 tools (via MCP)
n3rv-code-graph --help
```
Generated `opencode.json` wires all 4 MCP servers with `N3RV_AGENT_SOURCE=opencode` so every agent gets memory + hub + exec + code-graph without extra config.
## CLI Reference
```
n3rv init [--root PATH] [--project-name NAME] [--stack python|node|go|generic] [--force]
n3rv update [--dry-run] [--diff] [--force-commands] [--only marker-merge|json-merge|overwrite|skip-default] [--root PATH]
n3rv converge <change_id> [--root PATH] [--issue N] # close spec↔impl gap → sdd-*-tasks
n3rv hub start
n3rv daemon install|start|stop|status|enable [--now]|logs [--root PATH]
n3rv memory list [--type TYPE] [--scope SCOPE] [--limit N]
n3rv memory search <query> [--type TYPE] [--keyword KW] [--limit N]
n3rv memory prune --scope session|personal|project [--older-than DAYS] [--type TYPES] [--hard-delete]
n3rv memory stats
n3rv memory-list # alias for memory list
n3rv memory-search # alias for memory search
n3rv org init [--root PATH] [--org-name The-Replacement] [--force]
n3rv org add-satellite <name> [--root PATH] [--description TEXT] [--type satellite|tool]
n3rv org sync [--root PATH] [--dry-run] [--only CATEGORY]
n3rv org protect [project] [--root PATH] [--dry-run]
n3rv code-graph init [--root PATH] [--force]
n3rv code-graph index [--root PATH] [--force]
n3rv code-graph sync [--root PATH]
n3rv code-graph status [--root PATH] [--json]
n3rv code-graph query <query> [--root PATH] [--kind KIND] [--limit N] [--json]
n3rv code-graph explore <query> [--root PATH] [--max-nodes N] [--json]
n3rv code-graph node <symbol|file> [--root PATH] [--json]
n3rv code-graph files [--root PATH] [--json]
n3rv code-graph callers <symbol> [--root PATH] [--limit N]
n3rv code-graph callees <symbol> [--root PATH] [--limit N]
n3rv code-graph impact <symbol> [--root PATH] [--depth N]
n3rv code-graph affected <files...> [--root PATH] [--depth N] [--json]
```
## MCP Servers
All four are `stdio` servers launched by opencode via `opencode.json`. See [docs/MCP-TOOLS.md](docs/MCP-TOOLS.md) for the full 31-tool reference.
| Server | Command | Tools | Purpose |
|--------|---------|-------|---------|
| `n3rv-memory` | `n3rv-memory` | 12 | `memory_save/search/recall/context/timeline/stats/judge/prune/delete/session_*` |
| `n3rv-hub` | `n3rv-hub` | 5 | `delegate_task/list_pending_tasks/check_pending_tasks/complete_task/get_task` |
| `n3rv-exec` | `n3rv-exec` | 8 | `exec_lint/typecheck/test/history/diff/timeline/cache_stats/affected` — universal + cache + staleness |
| `n3rv-code-graph` | `n3rv-code-graph` | 6 | `code_graph_index/symbols/references/imports/affected/explore` — AST + FTS5 + blast radius |
Code graph and exec are twins: both use SQLite WAL + file watcher + `pending` set + `_inject_staleness` banner (`⚠️ Stale: file pending sync — Read it directly`).
## Providers
```python
from n3rv.providers.factory import get_provider, get_tts_provider
llm = get_provider() # N3RV_PROVIDER env, default "qwen"
llm = get_provider("openai:gpt-4o") # model override via colon
llm = get_provider("fallback") # N3RV_FALLBACK_PROVIDERS="qwen,openai,local"
tts = get_tts_provider() # DASHSCOPE_API_KEY + N3RV_TTS_* env
```
Implementations: `QwenProvider` (DashScope compat), `OpenAIProvider`, `LocalProvider` (Ollama/vLLM compat), `FallbackProvider`, `TTSProvider` / `TTSFallbackProvider`. All share `ProviderDefaults` from `n3rv.config`.
## Environment Variables
| Variable | Default | Purpose |
|----------|---------|---------|
| `N3RV_PROVIDER` | `qwen` | Active LLM provider: `qwen` · `openai` · `local` · `fallback` |
| `N3RV_DEFAULT_MODEL` | `qwen3-coder-plus` | Global default model ID |
| `N3RV_DEFAULT_BASE_URL` | `https://dashscope-intl.aliyuncs.com/compatible-mode/v1` | Global default base URL |
| `N3RV_FALLBACK_PROVIDERS` | — | Comma-separated fallback chain (e.g. `qwen,openai`) |
| `N3RV_TTS_FALLBACK_MODELS` | — | Comma-separated TTS models for `TTSFallbackProvider` |
| `N3RV_FALLBACK_MODELS` | — | Legacy alias, same as above |
| `DASHSCOPE_API_KEY` | — | Qwen/DashScope API key |
| `OPENAI_API_KEY` | — | OpenAI API key |
| `N3RV_LOG_LEVEL` | `INFO` | `DEBUG`·`INFO`·`WARNING`·`ERROR` |
| `N3RV_AGENT_SOURCE` | `opencode` | Agent identity for memory attribution + hub routing |
| `N3RV_HUB_URL` | `http://127.0.0.1:19820` | Hub URL for MCP delegation |
| `N3RV_MEMORY_PROFILE` | `full` | `full` (all tools) or `safe` (read-only, no delete/prune) |
| `N3RV_EXEC_DEBOUNCE_MS` | `300` | Exec watcher debounce |
| `N3RV_CODE_GRAPH_NO_WATCH` | unset | Set `1`/`true` to disable code-graph watcher |
| `N3RV_EXEC_NO_WATCH` | unset | Set `1`/`true` to disable exec watcher |
| `OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS` | unset | **Process env only** — `true` enables `background:true` subagents (`n3rv-scout`/`n3rv-sensor` parallel dispatch) |
Hub host/port can also be set in `.n3rv/a2a-config.yaml`:
```yaml
hub:
host: 127.0.0.1
port: 19820
project: my-project
```
## SDD Workflow
```
/sdd-new <change> → explore → propose → spec → design → tasks → apply → verify → archive
```
Each phase is an opencode skill (`sdd-*`) that saves to memory under `sdd-<change_id>-<phase>`. The hub tracks phase on the [The-Replacement Roadmap](https://github.com/orgs/The-Replacement/projects/2) when `--issue N` is passed.
- `n3rv converge <change_id> [--issue N]` — re-runs verify in converge mode and emits remediation tasks for any `FAIL`/`PARTIAL` acceptance criteria.
- **Spec-Kit path** (lighter, 3 artifacts) — `sdd-spec-kit-{spec,plan,tasks}` with templates under `.specify/templates/` (byte-identical to GitHub Spec Kit, see `NOTICE.md`).
Full detail: [docs/SDD-WORKFLOW.md](docs/SDD-WORKFLOW.md).
## Project Structure
```
src/n3rv/
├── cli.py, cli_memory.py, cli_code_graph.py, cli_org.py
├── config.py, platform.py, limits.py, daemon.py
├── providers/ # base, qwen, openai, local, fallback, tts, tts_fallback, factory
├── models/ # memory, a2a
├── a2a/ # hub, router, state, agent_cards
├── mcp/ # memory_service, memory_server, hub_server, exec_server, code_graph_*
│ ├── exec/ # registry (20+ langs), store, watcher, service
│ └── vector_store, relation_store, session_manager, conflict_store
└── init/ # init, update, renderer, detector, context, registry, lockfile
└── templates/ # opencode.json, AGENTS.md, skills(18), agents(7), commands(8), plugins, hooks
docs/ # ARCHITECTURE, DEPLOYMENT, MCP-TOOLS, SDD-WORKFLOW, index.html (n3rv.daza.ar)
tests/ # pytest — a2a, cli, init, mcp, org, providers, tools, limits, config
```
## Development
```bash
pip install -e ".[dev]"
ruff check . && ruff format --check .
pytest -q # or pytest -v --cov=src
mypy . --ignore-missing-imports || true
n3rv init --force # re-scaffold templates
```
CI (`.github/workflows/ci.yml`): `Lint & Format` + `Test 3.11/3.12/3.13` — 4 required checks, `strict:true`, `enforce_admins:true`, one approval, squash-merge only.
## Documentation
| Doc | Content |
|-----|---------|
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | System overview, 4 MCP servers, Evangelion map, data flows, dispatch (native subagents vs hub) |
| [docs/DEPLOYMENT.md](docs/DEPLOYMENT.md) | Install, `init`/`daemon`/`org`/`code-graph`, env vars, multi-agent machine, troubleshooting |
| [docs/MCP-TOOLS.md](docs/MCP-TOOLS.md) | All 31 tools — memory (12) + hub (5) + exec (8) + code-graph (6) |
| [docs/SDD-WORKFLOW.md](docs/SDD-WORKFLOW.md) | 8 phases, memory keys, converge, Spec-Kit, `change_id` convention |
| [EVANGELION.md](EVANGELION.md) | Full N3RV↔Evangelion concept map |
| [n3rv.daza.ar](https://n3rv.daza.ar) | Public landing (served from `docs/index.html`) |
> **Wiki:** the `docs/` directory *is* the wiki. The former `wiki-sync` workflow was removed — update `docs/*.md` directly; GitHub Wiki (if enabled) should mirror `docs/`.
## License
Apache-2.0. See `LICENSE`. Evangelion concepts are thematic metaphor only — not affiliated with Gainax/Khara.
历史前置条件说明(补充参考)
Python ≥3.11;需配合 opencode 客户端使用;使用 Qwen 需 DASHSCOPE_API_KEY,使用 OpenAI 需 OPENAI_API_KEY;默认基地址为 DashScope 国际站(境外服务);守护进程依赖 systemd 用户单元,其他平台支持情况待核验;费用未在资料中说明,待核验;Windows 支持待核验。
项目来源与清单版权许可
https://github.com/juanmanueldaza/n3rv
整理来源:https://github.com/slavakurilyak/awesome-ai-agents
清单版权与许可:
MIT License
Copyright (c) 2024 Slava Kurilyak
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.