Purpose
Network-AI is a TypeScript/Node.js-based multi-agent orchestrator used to add coordination, guardrails, and governance to any AI agent stack. The core problem it solves is the "silent failure mode" in multi-agent systems: parallel agents by default write to the same key in a "last write wins" manner, and one agent's result silently overwrites another agent's result, leading to split-brain states—duplicate spending, contradictory decisions, corrupted context, and no error being thrown. Network-AI prevents this at the coordination layer, before any write reaches shared state, through a propose → validate → commit mutual exclusion mechanism.
Main Capabilities
- Shared blackboard with locks: An atomic propose → validate → commit process that prevents race conditions and split-brain failures between parallel agents.
- Guardrails and budgets: FSM governance, per-agent token caps, HMAC / Ed25519 audit trails, permission gating.
- Context signal denoising (v5.15): ContextComposer assembles context packs ordered by relevance within a token budget (semantic/lexical × recency decay × scope affinity, position-aware layout); the context_pack + blackboard_search MCP tools let agents pull curated state instead of dumping the entire blackboard into the window.
- 32 adapters: LangChain (+ streaming), AutoGen, CrewAI, OpenAI Assistants, OpenAI Responses, LlamaIndex, Semantic Kernel, Haystack, DSPy, Agno, MCP, Custom (+ streaming), OpenClaw, A2A, Codex, MiniMax, NemoClaw, APS, Copilot, LangGraph, Anthropic Computer Use, Claude Agent SDK (agent loop), OpenAI Agents SDK, Vertex AI, Gemini (Developer API), Pydantic AI, Browser Agent, Hermes, Orchestrator (hierarchical multiorchestrator), 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, tech stack, milestones, and disabled patterns into every system prompt, so agents always have the complete 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 model refusal → fallback → billing chain behind a single governed, budget-constrained, auditable call (cross-model fallback, fallback credit repricing, effort governance, thinking block handoff).
How to Use
Network-AI can be used as the following forms:
- TypeScript/Node.js library:
import { createSwarmOrchestrator } from 'network-ai' - MCP server:
npx network-ai-server --port 3001 - CLI:
network-ai bb get status/network-ai audit tail - Claude Code plugin:
/plugin install network-ai@network-ai - Gemini CLI extension:
gemini extensions install https://github.com/Jovancoding/Network-AI - OpenClaw skill:
clawhub install network-ai
Start as an MCP server (no configuration required, zero dependencies):npx network-ai-server --port 3001, then connect any MCP-compatible client. Supported MCP tools include: blackboard_read / blackboard_write / blackboard_list / blackboard_delete / blackboard_exists, context_pack, blackboard_search, budget_status / budget_spend / budget_reset, token_create / token_validate / token_revoke, audit_query, config_get / config_set, agent_list / agent_spawn / agent_stop, fsm_transition. Each tool accepts an agent_id parameter, recorded as the source agent for each write.
MCP server options:--no-budget、--no-token、--no-control、--ceiling <n>、--board <name>、--audit-log <path>.
Claude Code plugin: Install from a self-hosted marketplace (no approval required):/plugin install network-ai@network-ai. The plugin runs underneath npx -y -p network-ai network-ai-server --stdio(stdio MCP transport), so it always uses the published npm package. You can use claude plugin validate . to verify the manifest locally.
OpenAI Codex: add it with a single command (using the published npm package). The repository root ships with .codex/config.toml, and any trusted checkout will automatically pick up this server; it can also be placed in ~/.codex/config.toml for global registration. In the Codex TUI, run /mcp to confirm that network-ai is connected.
Gemini CLI: the repository root ships with gemini-extension.json, which automatically wires in the stdio MCP server and the GEMINI.md context file. In the Gemini CLI, run /mcp to confirm that the tools are loaded.
CLI: global flags include --data <path>(data directory, default ./data),--env <name>(environment),--json(machine-readable output),--minimal(skip WAL replay + sweep, for fast CI/test startup).
Claude / ChatGPT / Codex: the repository root contains three integration files. Custom GPT Actions can be set up in the GPT editor → Actions → Import from URL, or by pasting the contents of openapi.yaml, with the server URL set to a running npx network-ai-server --port 3001 instance. For Claude Projects, you can copy the contents of claude-project-prompt.md (below the horizontal rule) into the Custom Instructions field of a Claude Project; instruction mode requires no server.
When to use it
- Teams that need to coordinate multiple parallel agents on the same shared state and avoid race conditions.
- Adding shared state, governance, and budgets on top of existing LangChain chains, CrewAI crews, and AutoGen agents—Network-AI is a coordination layer that sits on top of your existing stack without replacing your existing framework.
- Multi-agent applications that need per-agent token budgets, permission gating, and audit trails.
- Model interaction governance that needs cross-model fallback, refusal handling, effort policies, and thinking-block management.
- Exposing the orchestrator as a discoverable A2A agent to the Google Agent2Agent ecosystem.
Limitations
- As an MCP server, the trust boundary is transport authentication (a bearer secret over SSE/HTTP, or local stdio): once a client is admitted, the server writes on its behalf using a server-held random identity, so any agent_id can be used without knowing the shared token. When going through MCP, the caller-provided agent_token value is ignored. In-process TypeScript code retains per-agent tokens and namespaces via registerAgent().
- Adapters are dependency-free (BYOC—bring your own client) and require users to provide their own SDK objects.
- No native dependencies, no build step.
- AuthGuardian hook support for Claude Code includes --mode observe (default, audit without blocking) and --mode enforce (maps tools to resource types, requires AuthGuardian authorization, and denied calls escalate to an interactive prompt). --deny mode hard-blocks in both modes and matches the tool name plus every string field of the tool input. --allow mode matches only the tool name and the primary target. Invalid or backtracking-prone patterns cause the hook to exit with code 2, which Claude Code treats as blocking, so bad rules fail closed rather than silently disabling the deny list.
- Includes 3,679 passing assertions, across 41 test suites (
npm run test:all). - Licensed under MIT.