Network-AI
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**TypeScript/Node.js multi-agent orchestrator — shared state, guardrails, budgets, and cross-framework coordination**
If Network-AI is useful to you, consider giving it a star ⭐ — it helps others find the project.
Network-AI is a TypeScript/Node.js multi-agent orchestrator that adds coordination, guardrails, and governance to any AI agent stack.
- **Shared blackboard with locking** — atomic propose → validate → commit prevents race conditions and split-brain failures across parallel agents
- **Guardrails and budgets** — FSM governance, per-agent token ceilings, HMAC / Ed25519 audit trails, and permission gating
- **Context signal-over-noise (v5.15)** — ContextComposer assembles token-budgeted, relevance-ranked context packs (semantic/lexical × recency decay × scope affinity, position-aware layout); context_pack + blackboard_search MCP tools let agents pull curated state instead of dumping the whole board into their window
- **32 adapters** — LangChain (+ streaming), AutoGen, CrewAI, OpenAI Assistants, OpenAI Responses (Assistants successor), LlamaIndex, Semantic Kernel, Haystack, DSPy, Agno, MCP, Custom (+ streaming), OpenClaw, A2A, Codex, MiniMax, NemoClaw, APS, Copilot, LangGraph, Anthropic Computer Use, Claude Agent SDK (agentic loops), OpenAI Agents SDK, Vertex AI, Gemini (Developer API), Pydantic AI, Browser Agent, Hermes (NousResearch Hermes / any OpenAI-compatible endpoint), Orchestrator (hierarchical multi-orchestrator), and RLM (Recursive Language Model / any RLM-compatible HTTP endpoint) — no glue code, no lock-in
- **Persistent project memory (Layer 3)** — context_manager.py injects decisions, goals, stack, milestones, and banned patterns into every system prompt so agents always have full project context
- **v5.0 modules** — Agent VCR (record/replay), comparison runner, coverage reporter, goal DSL, approval inbox, job queue, gRPC/HTTP transport, playground REPL, adapter test harness, and more
- **Model-interaction lifecycle governance (v5.13)** — GovernedModelGateway absorbs the model refusal → fallback → billing chain (cross-model fallback, fallback-credit repricing, effort governance, thinking-block handoff) behind one governed, budgeted, audited call
> **The silent failure mode in multi-agent systems:** parallel agents writing to the same key
> use last-write-wins by default — one agent's result silently overwrites another's mid-flight.
> The outcome is split-brain state: double-spends, contradictory decisions, corrupted context,
> no error thrown. Network-AI's propose → validate → commit mutex prevents this at the
> coordination layer, before any write reaches shared state.
**Use Network-AI as:**
- A **TypeScript/Node.js library** — import { createSwarmOrchestrator } from 'network-ai'
- An **MCP server** — npx network-ai-server --port 3001
- A **CLI** — network-ai bb get status / network-ai audit tail
- A **Claude Code plugin** — /plugin install network-ai@network-ai
- A **Gemini CLI extension** — gemini extensions install https://github.com/Jovancoding/Network-AI
- An **OpenClaw skill** — clawhub install network-ai
**5-minute quickstart →** | **Architecture →** | **All adapters →** | **Benchmarks →**
---
🛡️ Model-Interaction Lifecycle Governance
Most governance tools stop at the agent boundary — they police which tools an agent may call *before* it acts. Network-AI also governs the layer underneath: **how an agent talks to the model.** When a frontier model declines a request with a classifier refusal, Network-AI absorbs the refusal → fallback → billing chain and presents one governed, budgeted, audited call.
- **GovernedModelGateway** — detect stop_reason:"refusal", audit which classifier fired, route to a fallback model, and redeem the fallback-credit token so the retry is repriced as a cache read.
- **ModelBudget** — per-model USD accounting with fallback-credit repricing; never sums tokens across models.
- **RefusalTelemetry** — a refusal is an HTTP 200, invisible to error-rate monitoring; emitted as a discrete non-error signal with an unservedRefusalCount gap to alert on.
- **EffortPolicy** — turn the effort cost dial into a policy object: cap sub-agents at low, require justification for xhigh/max.
- **ThinkingBlockManager** — keep thinking blocks unchanged on the same model; strip them on a cross-model fallback; guard prompts against reasoning_extraction refusals.
- **Per-sub-agent fallback** — FanOutFanIn steps and TeamRunner tasks each carry their own fallback agent and per-request retry budget (RetryBudget), because a turn can refuse independently across an agent and its sub-agents.