@nyx/crew — Multi-Agent Crew Orchestration & Git Worktree Sandboxes
An autonomous multi-agent swarm framework. Orchestrates specialized AI agents operating inside ephemeral Git worktree sandboxes with lock-free 42ns SPSC inter-agent communication.
🌿 Git Worktree Isolation
Subagents develop in dedicated, parallel Git worktree directories, eliminating file overwrite conflicts and git lock collisions.
⚡ 42ns SPSC Ring Buffer
Ultra-low-latency inter-agent IPC bypassing heavy JSON-RPC serialization and Python thread lock contention.
🛡️ BFT Quorum Consensus
Multi-agent voting ensures code changes, unit tests, and security assertions achieve cryptographic quorum before merging.
🤖 Local Model Compatibility
Assign distinct local models (e.g. Nanbeige 4.2-3B for coding, Spark-X2.5 for testing, Llama-3 for architecture review).
1. Installation
# Install via Nyx Package Manager
nypm add @nyx/crew
2. Comprehensive Practical Example
This program instantiates an Architect Agent, a Coder Agent, and a QA Fuzzer Agent working simultaneously in parallel Git worktrees to implement and test a new feature.
use @nyx/crew;
fn main() {
// 1. Create a specialized software engineering crew
let mut dev_crew = crew::create_crew("compiler_optimization_crew");
// 2. Add specialized agents with dedicated model backends and isolated worktrees
crew::add_member(
mut dev_crew,
"Architect",
"nanbeige-4.2-3b",
".worktrees/agent_architect"
);
crew::add_member(
mut dev_crew,
"Systems_Coder",
"spark-x2.5-4b",
".worktrees/agent_coder"
);
crew::add_member(
mut dev_crew,
"QA_Fuzzer",
"local-fuzz-target",
".worktrees/agent_qa"
);
println("🚀 Crew initialized with 3 agents across isolated Git worktrees.");
// 3. Dispatch high-level goal
let result = crew::execute_collaborative_goal(
&dev_crew,
"Implement SIMD AVX2 cosine distance acceleration in @nyx/tensor and run 1M fuzz iterations."
);
println("Result: {result}");
}
3. Function Reference
| Signature | Parameters | Return | Description |
|---|---|---|---|
crew::create_crew(name: str) |
name: str |
AgentCrew |
Initializes an agent crew coordinator with SPSC message ring buffers. |
crew::add_member(crew: mut ref AgentCrew, role: str, model: str, worktree: str) |
role, model, worktree |
void |
Provisions an isolated Git worktree branch and binds the specified SLM model. |
crew::execute_collaborative_goal(crew: ref AgentCrew, goal: str) |
goal: str |
str |
Executes collaborative multi-agent loop with automated branch synthesis and testing. |