agentic-flow 1.1.1 β 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +305 -158
- package/dist/agents/directApiAgent.js +108 -22
- package/dist/cli-proxy.js +120 -22
- package/dist/proxy/anthropic-to-openrouter.js +5 -1
- package/dist/router/providers/gemini.js +102 -0
- package/dist/router/router.js +65 -7
- package/dist/utils/logger.js +4 -0
- package/dist/utils/modelOptimizer.js +22 -22
- package/docs/PACKAGE_STRUCTURE.md +199 -0
- package/package.json +2 -1
- package/.claude/commands/coordination/README.md +0 -9
- package/.claude/commands/coordination/agent-spawn.md +0 -25
- package/.claude/commands/coordination/init.md +0 -44
- package/.claude/commands/coordination/orchestrate.md +0 -43
- package/.claude/commands/coordination/spawn.md +0 -45
- package/.claude/commands/coordination/swarm-init.md +0 -85
- package/.claude/commands/coordination/task-orchestrate.md +0 -25
- package/.claude/commands/memory/README.md +0 -9
- package/.claude/commands/memory/memory-persist.md +0 -25
- package/.claude/commands/memory/memory-search.md +0 -25
- package/.claude/commands/memory/memory-usage.md +0 -25
- package/.claude/commands/memory/neural.md +0 -47
- package/.claude/commands/memory/usage.md +0 -46
- package/dist/cli.js +0 -158
- package/dist/coordination/parallelSwarm.js +0 -226
- package/dist/index-with-proxy.js +0 -101
- package/dist/mcp/fastmcp/tools/memory/retrieve.js +0 -38
- package/dist/mcp/fastmcp/tools/memory/search.js +0 -41
- package/dist/mcp/fastmcp/tools/memory/store.js +0 -56
- package/docs/.claude-flow/metrics/agent-metrics.json +0 -1
- package/docs/.claude-flow/metrics/performance.json +0 -9
- package/docs/.claude-flow/metrics/task-metrics.json +0 -10
package/README.md
CHANGED
|
@@ -1,31 +1,58 @@
|
|
|
1
1
|
# π€ Agentic Flow
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Production-Ready AI Agent Orchestration with Multi-Model Router, OpenRouter Integration & Free Local Inference**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Agentic Flow works with any agent or command built or used in Claude Code. It automatically runs through the Claude Agent SDK, forming swarms of intelligent, cost and performance-optimized agents that decide how to execute each task. Built for business, government, and commercial use where cost, traceability, and reliability matter.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Agentic Flow runs Claude Code agents at near zero cost without rewriting a thing. It routes every task to the cheapest lane that still meets the bar. Local ONNX when privacy or price wins. OpenRouter for breadth. Gemini for speed. Anthropic when quality matters most. One agent. Any model. Lowest viable cost.
|
|
8
|
+
|
|
9
|
+
The system takes the Claude SDK's logic and merges it with Claude Flow memory to give every agent a durable brain. Each run logs inputs, outputs, and route decisions with artifacts, manifests, and checksums for proof and reproducibility. It self-optimizes in real time, balancing price, latency, and accuracy through a simple policy file.
|
|
10
|
+
|
|
11
|
+
Strict mode keeps sensitive data offline. Economy mode prefers ONNX or OpenRouter. Premium mode goes Anthropic first. The policy defines the rules, and the swarm enforces them automatically.
|
|
12
|
+
|
|
13
|
+
It runs anywhere: local for dev, Docker for CI, or Flow Nexus for scale. With project-scoped settings, explicit tool allowlists, and an offline privacy lane, it stays secure by default.
|
|
14
|
+
|
|
15
|
+
**Agentic Flow is the framework for autonomous efficiencyβone unified runner for every Claude Code agent, self-tuning, self-routing, and built for real-world deployment.**
|
|
16
|
+
|
|
17
|
+
Built on **[Claude Agent SDK](https://docs.claude.com/en/api/agent-sdk)** by Anthropic, powered by **[Claude Flow](https://github.com/ruvnet/claude-flow)** (101 MCP tools), **[Flow Nexus](https://github.com/ruvnet/flow-nexus)** (96 cloud tools), **[OpenRouter](https://openrouter.ai)** (100+ LLM models), **Google Gemini** (fast, cost-effective inference), **[Agentic Payments](https://www.npmjs.com/package/agentic-payments)** (payment authorization), and **ONNX Runtime** (free local CPU or GPU inference).
|
|
8
18
|
|
|
9
19
|
[](https://www.npmjs.com/package/agentic-flow)
|
|
20
|
+
[](https://www.npmjs.com/package/agentic-flow)
|
|
21
|
+
[](https://www.npmjs.com/package/agentic-flow)
|
|
10
22
|
[](https://opensource.org/licenses/MIT)
|
|
11
23
|
[](https://nodejs.org/)
|
|
24
|
+
[](https://github.com/ruvnet/)
|
|
25
|
+
[](https://github.com/ruvnet/agentic-flow#-agent-types)
|
|
12
26
|
|
|
13
27
|
---
|
|
14
28
|
|
|
15
29
|
## Why Agentic Flow?
|
|
16
30
|
|
|
17
|
-
|
|
31
|
+
**The Problem:** You need agents that actually complete tasks, not chatbots that need constant supervision. Long-running workflows - migrating codebases, generating documentation, analyzing datasets - shouldn't require you to sit there clicking "continue."
|
|
32
|
+
|
|
33
|
+
**What True Agentic Systems Need:**
|
|
34
|
+
- **Autonomy** - Agents that plan, execute, and recover from errors without hand-holding
|
|
35
|
+
- **Persistence** - Tasks that run for hours, even when you're offline
|
|
36
|
+
- **Collaboration** - Multiple agents coordinating on complex work
|
|
37
|
+
- **Tool Access** - Real capabilities: file systems, APIs, databases, not just text generation
|
|
38
|
+
- **Cost Control** - Run cheap models for grunt work, expensive ones only when needed
|
|
39
|
+
|
|
40
|
+
**What You Get:**
|
|
18
41
|
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
23
|
-
- **Auto
|
|
24
|
-
- **
|
|
25
|
-
- **Production-Ready** - Built on battle-tested Claude Agent SDK v0.1.5
|
|
26
|
-
- **Model Flexibility** - Use Claude, OpenRouter, or free local ONNX models
|
|
42
|
+
- **150+ Specialized Agents** - Researcher, coder, reviewer, tester, architect - each with domain expertise and tool access
|
|
43
|
+
- **Multi-Agent Swarms** - Deploy 3, 10, or 100 agents that collaborate via shared memory to complete complex projects
|
|
44
|
+
- **Long-Running Tasks** - Agents persist through hours-long operations: full codebase refactors, comprehensive audits, dataset processing
|
|
45
|
+
- **213 MCP Tools** - Agents have real capabilities: GitHub operations, neural network training, workflow automation, memory persistence
|
|
46
|
+
- **Auto Model Optimization** - `--optimize` flag intelligently selects best model for each task. DeepSeek R1 costs 85% less than Claude with similar quality. Save $2,400/month on 100 daily reviews.
|
|
47
|
+
- **Deploy Anywhere** - Same agentic capabilities locally, in Docker/Kubernetes, or cloud sandboxes
|
|
27
48
|
|
|
28
|
-
|
|
49
|
+
**Real Agentic Use Cases:**
|
|
50
|
+
- **Overnight Code Migration** - Deploy a swarm to migrate a 50K line codebase from JavaScript to TypeScript while you sleep
|
|
51
|
+
- **Continuous Security Audits** - Agents monitor repos, analyze PRs, and flag vulnerabilities 24/7
|
|
52
|
+
- **Automated API Development** - One agent designs schema, another implements endpoints, a third writes tests - all coordinated
|
|
53
|
+
- **Data Pipeline Processing** - Agents process TBs of data across distributed sandboxes, checkpoint progress, and recover from failures
|
|
54
|
+
|
|
55
|
+
> **True autonomy at commodity prices.** Your agents work independently on long-running tasks, coordinate when needed, and cost pennies per hour instead of dollars.
|
|
29
56
|
|
|
30
57
|
### Built on Industry Standards
|
|
31
58
|
|
|
@@ -40,7 +67,7 @@ Traditional AI frameworks require persistent infrastructure and complex orchestr
|
|
|
40
67
|
|
|
41
68
|
## π Quick Start
|
|
42
69
|
|
|
43
|
-
### Installation
|
|
70
|
+
### Local Installation (Recommended for Development)
|
|
44
71
|
|
|
45
72
|
```bash
|
|
46
73
|
# Global installation
|
|
@@ -48,29 +75,11 @@ npm install -g agentic-flow
|
|
|
48
75
|
|
|
49
76
|
# Or use directly with npx (no installation)
|
|
50
77
|
npx agentic-flow --help
|
|
51
|
-
```
|
|
52
78
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
# Launch interactive configuration wizard
|
|
57
|
-
npx agentic-flow config
|
|
58
|
-
|
|
59
|
-
# Or use direct commands
|
|
60
|
-
npx agentic-flow config set ANTHROPIC_API_KEY sk-ant-xxxxx
|
|
61
|
-
npx agentic-flow config set PROVIDER anthropic
|
|
62
|
-
npx agentic-flow config list
|
|
79
|
+
# Set your API key
|
|
80
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
63
81
|
```
|
|
64
82
|
|
|
65
|
-
The wizard helps you configure:
|
|
66
|
-
- **API Keys** - Anthropic, OpenRouter with validation
|
|
67
|
-
- **Provider Settings** - Choose default provider (anthropic/openrouter/onnx)
|
|
68
|
-
- **Model Selection** - Set default models
|
|
69
|
-
- **Custom Paths** - Configure agents directory
|
|
70
|
-
- **Advanced Options** - Proxy port, feature flags
|
|
71
|
-
|
|
72
|
-
All configuration is saved to `.env` with helpful comments.
|
|
73
|
-
|
|
74
83
|
### Your First Agent (Local Execution)
|
|
75
84
|
|
|
76
85
|
```bash
|
|
@@ -180,7 +189,7 @@ docker run --rm \
|
|
|
180
189
|
- **Pay-Per-Use** - Only pay for actual sandbox runtime (β$1/hour)
|
|
181
190
|
|
|
182
191
|
### π€ Intelligent Agents
|
|
183
|
-
- **
|
|
192
|
+
- **150+ Pre-Built Specialists** - Researchers, coders, testers, reviewers, architects
|
|
184
193
|
- **Swarm Coordination** - Agents collaborate via shared memory
|
|
185
194
|
- **Tool Access** - 200+ MCP tools for GitHub, neural networks, workflows
|
|
186
195
|
- **Custom Agents** - Define your own in YAML with system prompts
|
|
@@ -351,35 +360,34 @@ spec:
|
|
|
351
360
|
}
|
|
352
361
|
```
|
|
353
362
|
|
|
354
|
-
###
|
|
355
|
-
```javascript
|
|
356
|
-
// Lambda limitations: No MCP subprocesses, only 6 in-SDK tools
|
|
357
|
-
exports.handler = async (event) => {
|
|
358
|
-
// β claude-flow MCP server won't work (subprocess not allowed)
|
|
359
|
-
// β flow-nexus MCP server won't work (subprocess not allowed)
|
|
360
|
-
// β
Only claude-flow-sdk in-SDK tools available (6 tools)
|
|
361
|
-
|
|
362
|
-
const result = await query({
|
|
363
|
-
prompt: event.query,
|
|
364
|
-
options: {
|
|
365
|
-
mcpServers: {
|
|
366
|
-
'claude-flow-sdk': claudeFlowSdkServer // Only 6 tools work
|
|
367
|
-
// 'claude-flow': subprocess blocked by Lambda
|
|
368
|
-
// 'flow-nexus': subprocess blocked by Lambda
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
});
|
|
363
|
+
### π ONNX Local Inference (Free Offline AI)
|
|
372
364
|
|
|
373
|
-
|
|
374
|
-
|
|
365
|
+
**Run agents completely offline with zero API costs:**
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
# Auto-downloads Phi-4 model (~4.9GB one-time download)
|
|
369
|
+
npx agentic-flow \
|
|
370
|
+
--agent coder \
|
|
371
|
+
--task "Build a REST API" \
|
|
372
|
+
--provider onnx
|
|
373
|
+
|
|
374
|
+
# Router auto-selects ONNX for privacy-sensitive tasks
|
|
375
|
+
npx agentic-flow \
|
|
376
|
+
--agent researcher \
|
|
377
|
+
--task "Analyze confidential medical records" \
|
|
378
|
+
--privacy high \
|
|
379
|
+
--local-only
|
|
375
380
|
```
|
|
376
381
|
|
|
377
|
-
**
|
|
378
|
-
-
|
|
379
|
-
-
|
|
380
|
-
-
|
|
381
|
-
-
|
|
382
|
-
- β
|
|
382
|
+
**ONNX Capabilities:**
|
|
383
|
+
- β
100% free local inference (Microsoft Phi-4 model)
|
|
384
|
+
- β
Privacy: All processing stays on your machine
|
|
385
|
+
- β
Offline: No internet required after model download
|
|
386
|
+
- β
Performance: ~6 tokens/sec CPU, 60-300 tokens/sec GPU
|
|
387
|
+
- β
Auto-download: Model fetches automatically on first use
|
|
388
|
+
- β
Quantized: INT4 optimization for efficiency (~4.9GB total)
|
|
389
|
+
- β οΈ Limited to 6 in-SDK tools (no subprocess MCP servers)
|
|
390
|
+
- π See [docs](docs/ONNX_INTEGRATION.md) for full capabilities
|
|
383
391
|
|
|
384
392
|
---
|
|
385
393
|
|
|
@@ -441,50 +449,174 @@ Docker: Infrastructure costs (AWS/GCP/Azure) + Claude API costs.*
|
|
|
441
449
|
- **`production-validator`** - Deployment readiness checks
|
|
442
450
|
- **`tdd-london-swarm`** - Test-driven development
|
|
443
451
|
|
|
444
|
-
*Use `npx agentic-flow --list` to see all
|
|
452
|
+
*Use `npx agentic-flow --list` to see all 150+ agents*
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
## π― Model Optimization (NEW!)
|
|
457
|
+
|
|
458
|
+
**Automatically select the optimal model for any agent and task**, balancing quality, cost, and speed based on your priorities.
|
|
459
|
+
|
|
460
|
+
### Why Model Optimization?
|
|
461
|
+
|
|
462
|
+
Different tasks need different models:
|
|
463
|
+
- **Production code** β Claude Sonnet 4.5 (highest quality)
|
|
464
|
+
- **Code reviews** β DeepSeek R1 (85% cheaper, nearly same quality)
|
|
465
|
+
- **Simple functions** β Llama 3.1 8B (99% cheaper)
|
|
466
|
+
- **Privacy-critical** β ONNX Phi-4 (free, local, offline)
|
|
467
|
+
|
|
468
|
+
**The optimizer analyzes your agent type + task complexity and recommends the best model automatically.**
|
|
469
|
+
|
|
470
|
+
### Quick Examples
|
|
471
|
+
|
|
472
|
+
```bash
|
|
473
|
+
# Let the optimizer choose (balanced quality vs cost)
|
|
474
|
+
npx agentic-flow --agent coder --task "Build REST API" --optimize
|
|
475
|
+
|
|
476
|
+
# Optimize for lowest cost
|
|
477
|
+
npx agentic-flow --agent coder --task "Simple function" --optimize --priority cost
|
|
478
|
+
|
|
479
|
+
# Optimize for highest quality
|
|
480
|
+
npx agentic-flow --agent reviewer --task "Security audit" --optimize --priority quality
|
|
481
|
+
|
|
482
|
+
# Optimize for speed
|
|
483
|
+
npx agentic-flow --agent researcher --task "Quick analysis" --optimize --priority speed
|
|
484
|
+
|
|
485
|
+
# Set maximum budget ($0.001 per task)
|
|
486
|
+
npx agentic-flow --agent coder --task "Code cleanup" --optimize --max-cost 0.001
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
### Optimization Priorities
|
|
490
|
+
|
|
491
|
+
- **`quality`** (70% quality, 20% speed, 10% cost) - Best results, production code
|
|
492
|
+
- **`balanced`** (40% quality, 40% cost, 20% speed) - Default, good mix
|
|
493
|
+
- **`cost`** (70% cost, 20% quality, 10% speed) - Cheapest, development/testing
|
|
494
|
+
- **`speed`** (70% speed, 20% quality, 10% cost) - Fastest responses
|
|
495
|
+
- **`privacy`** - Local-only models (ONNX), zero cloud API calls
|
|
496
|
+
|
|
497
|
+
### Model Tier Examples
|
|
498
|
+
|
|
499
|
+
The optimizer chooses from 10+ models across 5 tiers:
|
|
500
|
+
|
|
501
|
+
**Tier 1: Flagship** (premium quality)
|
|
502
|
+
- Claude Sonnet 4.5 - $3/$15 per 1M tokens
|
|
503
|
+
- GPT-4o - $2.50/$10 per 1M tokens
|
|
504
|
+
- Gemini 2.5 Pro - $0.00/$2.00 per 1M tokens
|
|
505
|
+
|
|
506
|
+
**Tier 2: Cost-Effective** (2025 breakthrough models)
|
|
507
|
+
- **DeepSeek R1** - $0.55/$2.19 per 1M tokens (85% cheaper, flagship quality)
|
|
508
|
+
- **DeepSeek Chat V3** - $0.14/$0.28 per 1M tokens (98% cheaper)
|
|
509
|
+
|
|
510
|
+
**Tier 3: Balanced**
|
|
511
|
+
- Gemini 2.5 Flash - $0.07/$0.30 per 1M tokens (fastest)
|
|
512
|
+
- Llama 3.3 70B - $0.30/$0.30 per 1M tokens (open-source)
|
|
513
|
+
|
|
514
|
+
**Tier 4: Budget**
|
|
515
|
+
- Llama 3.1 8B - $0.055/$0.055 per 1M tokens (ultra-low cost)
|
|
516
|
+
|
|
517
|
+
**Tier 5: Local/Privacy**
|
|
518
|
+
- **ONNX Phi-4** - FREE (offline, private, no API)
|
|
519
|
+
|
|
520
|
+
### Agent-Specific Recommendations
|
|
521
|
+
|
|
522
|
+
The optimizer knows what each agent needs:
|
|
523
|
+
|
|
524
|
+
```bash
|
|
525
|
+
# Coder agent β prefers high quality (min 85/100)
|
|
526
|
+
npx agentic-flow --agent coder --task "Production API" --optimize
|
|
527
|
+
# β Selects: DeepSeek R1 (quality 90, cost 85)
|
|
528
|
+
|
|
529
|
+
# Researcher agent β flexible, can use cheaper models
|
|
530
|
+
npx agentic-flow --agent researcher --task "Trend analysis" --optimize --priority cost
|
|
531
|
+
# β Selects: Gemini 2.5 Flash (quality 78, cost 98)
|
|
532
|
+
|
|
533
|
+
# Reviewer agent β needs reasoning (min 85/100)
|
|
534
|
+
npx agentic-flow --agent reviewer --task "Security review" --optimize
|
|
535
|
+
# β Selects: DeepSeek R1 (quality 90, reasoning-optimized)
|
|
536
|
+
|
|
537
|
+
# Tester agent β simple tasks, use budget models
|
|
538
|
+
npx agentic-flow --agent tester --task "Unit tests" --optimize --priority cost
|
|
539
|
+
# β Selects: Llama 3.1 8B (cost 95)
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
### Cost Savings Examples
|
|
543
|
+
|
|
544
|
+
**Without Optimization** (always using Claude Sonnet 4.5):
|
|
545
|
+
- 100 code reviews/day Γ $0.08 each = **$8/day = $240/month**
|
|
546
|
+
|
|
547
|
+
**With Optimization** (DeepSeek R1 for reviews):
|
|
548
|
+
- 100 code reviews/day Γ $0.012 each = **$1.20/day = $36/month**
|
|
549
|
+
- **Savings: $204/month (85% reduction)**
|
|
550
|
+
|
|
551
|
+
### Comprehensive Model Guide
|
|
552
|
+
|
|
553
|
+
For detailed analysis of all 10 models, see:
|
|
554
|
+
π **[Model Capabilities Guide](docs/agentic-flow/benchmarks/MODEL_CAPABILITIES.md)**
|
|
555
|
+
|
|
556
|
+
Includes:
|
|
557
|
+
- Full benchmark results across 6 task types
|
|
558
|
+
- Cost comparison tables
|
|
559
|
+
- Use case decision matrices
|
|
560
|
+
- Performance characteristics
|
|
561
|
+
- Best practices by model
|
|
562
|
+
|
|
563
|
+
### MCP Tool for Optimization
|
|
564
|
+
|
|
565
|
+
```javascript
|
|
566
|
+
// Get model recommendation via MCP tool
|
|
567
|
+
await query({
|
|
568
|
+
mcp: {
|
|
569
|
+
server: 'agentic-flow',
|
|
570
|
+
tool: 'agentic_flow_optimize_model',
|
|
571
|
+
params: {
|
|
572
|
+
agent: 'coder',
|
|
573
|
+
task: 'Build REST API with auth',
|
|
574
|
+
priority: 'balanced', // quality | balanced | cost | speed | privacy
|
|
575
|
+
max_cost: 0.01 // optional budget cap in dollars
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
**Learn More:**
|
|
582
|
+
- See [benchmarks/README.md](docs/agentic-flow/benchmarks/README.md) for quick results
|
|
583
|
+
- Run your own tests: `cd docs/agentic-flow/benchmarks && ./quick-benchmark.sh`
|
|
445
584
|
|
|
446
585
|
---
|
|
447
586
|
|
|
448
587
|
## π Commands
|
|
449
588
|
|
|
450
|
-
###
|
|
589
|
+
### MCP Server Management (Direct Tool Access)
|
|
451
590
|
|
|
452
591
|
```bash
|
|
453
|
-
#
|
|
454
|
-
npx agentic-flow
|
|
592
|
+
# Start all MCP servers (213 tools)
|
|
593
|
+
npx agentic-flow mcp start
|
|
455
594
|
|
|
456
|
-
#
|
|
457
|
-
npx agentic-flow
|
|
458
|
-
npx agentic-flow
|
|
459
|
-
npx agentic-flow
|
|
460
|
-
npx agentic-flow config set COMPLETION_MODEL meta-llama/llama-3.1-8b-instruct
|
|
595
|
+
# Start specific MCP server
|
|
596
|
+
npx agentic-flow mcp start claude-flow # 101 tools
|
|
597
|
+
npx agentic-flow mcp start flow-nexus # 96 cloud tools
|
|
598
|
+
npx agentic-flow mcp start agentic-payments # Payment tools
|
|
461
599
|
|
|
462
|
-
#
|
|
463
|
-
npx agentic-flow
|
|
464
|
-
npx agentic-flow config get PROVIDER
|
|
600
|
+
# List all available MCP tools (213 total)
|
|
601
|
+
npx agentic-flow mcp list
|
|
465
602
|
|
|
466
|
-
#
|
|
467
|
-
npx agentic-flow
|
|
468
|
-
npx agentic-flow config reset
|
|
603
|
+
# Check MCP server status
|
|
604
|
+
npx agentic-flow mcp status
|
|
469
605
|
|
|
470
|
-
#
|
|
471
|
-
npx agentic-flow
|
|
606
|
+
# Stop MCP servers
|
|
607
|
+
npx agentic-flow mcp stop [server]
|
|
472
608
|
```
|
|
473
609
|
|
|
474
|
-
**
|
|
475
|
-
-
|
|
476
|
-
-
|
|
477
|
-
-
|
|
478
|
-
-
|
|
479
|
-
- `AGENTS_DIR` - Custom agents directory path
|
|
480
|
-
- `PROXY_PORT` - Proxy server port (default: 3000)
|
|
481
|
-
- `USE_OPENROUTER` - Force OpenRouter usage (true/false)
|
|
482
|
-
- `USE_ONNX` - Use ONNX local inference (true/false)
|
|
610
|
+
**MCP Servers Available:**
|
|
611
|
+
- **claude-flow** (101 tools): Neural networks, GitHub integration, workflows, DAA, performance
|
|
612
|
+
- **flow-nexus** (96 tools): E2B sandboxes, distributed swarms, templates, cloud storage
|
|
613
|
+
- **agentic-payments** (10 tools): Payment authorization, Ed25519 signatures, consensus
|
|
614
|
+
- **claude-flow-sdk** (6 tools): In-process memory and swarm coordination
|
|
483
615
|
|
|
484
616
|
### Basic Operations (Works Locally, Docker, Cloud)
|
|
485
617
|
|
|
486
618
|
```bash
|
|
487
|
-
# List all available agents (
|
|
619
|
+
# List all available agents (150+ total)
|
|
488
620
|
npx agentic-flow --list
|
|
489
621
|
|
|
490
622
|
# Run specific agent (local execution)
|
|
@@ -497,15 +629,12 @@ npx agentic-flow --agent coder --task "Build API" --stream
|
|
|
497
629
|
npx agentic-flow # Requires TOPIC, DIFF, DATASET env vars
|
|
498
630
|
```
|
|
499
631
|
|
|
500
|
-
### Environment Configuration
|
|
632
|
+
### Environment Configuration
|
|
501
633
|
|
|
502
634
|
```bash
|
|
503
|
-
# Required
|
|
635
|
+
# Required
|
|
504
636
|
export ANTHROPIC_API_KEY=sk-ant-...
|
|
505
637
|
|
|
506
|
-
# Or use OpenRouter
|
|
507
|
-
export OPENROUTER_API_KEY=sk-or-v1-...
|
|
508
|
-
|
|
509
638
|
# Agent mode (optional)
|
|
510
639
|
export AGENT=researcher
|
|
511
640
|
export TASK="Your task description"
|
|
@@ -775,9 +904,34 @@ npx agentic-flow \
|
|
|
775
904
|
|
|
776
905
|
---
|
|
777
906
|
|
|
778
|
-
## π§ MCP Tools (
|
|
907
|
+
## π§ MCP Tools (213 Total)
|
|
779
908
|
|
|
780
|
-
Agentic Flow integrates with **four MCP servers** providing
|
|
909
|
+
Agentic Flow integrates with **four MCP servers** providing 213 tools total:
|
|
910
|
+
|
|
911
|
+
### Direct MCP Access
|
|
912
|
+
|
|
913
|
+
You can now directly manage MCP servers via the CLI:
|
|
914
|
+
|
|
915
|
+
```bash
|
|
916
|
+
# Start all MCP servers
|
|
917
|
+
npx agentic-flow mcp start
|
|
918
|
+
|
|
919
|
+
# List all 213 available tools
|
|
920
|
+
npx agentic-flow mcp list
|
|
921
|
+
|
|
922
|
+
# Check server status
|
|
923
|
+
npx agentic-flow mcp status
|
|
924
|
+
|
|
925
|
+
# Start specific server
|
|
926
|
+
npx agentic-flow mcp start claude-flow
|
|
927
|
+
```
|
|
928
|
+
|
|
929
|
+
**How It Works:**
|
|
930
|
+
1. **Automatic** (Recommended): Agents automatically access all 213 tools when you run tasks
|
|
931
|
+
2. **Manual**: Use `npx agentic-flow mcp <command>` for direct server management
|
|
932
|
+
3. **Integrated**: All tools work seamlessly whether accessed automatically or manually
|
|
933
|
+
|
|
934
|
+
### Tool Breakdown
|
|
781
935
|
|
|
782
936
|
### Core Orchestration (claude-flow - 101 tools)
|
|
783
937
|
|
|
@@ -894,15 +1048,16 @@ Add to your MCP config (`~/.config/claude/mcp.json`):
|
|
|
894
1048
|
|
|
895
1049
|
## π Deployment Comparison
|
|
896
1050
|
|
|
897
|
-
| Feature | Local | Docker | Flow Nexus Sandboxes |
|
|
1051
|
+
| Feature | Local | Docker | Flow Nexus Sandboxes | ONNX Local |
|
|
898
1052
|
|---------|-------|--------|----------------------|------------|
|
|
899
1053
|
| **MCP Tools Available** | 203 (100%) | 203 (100%) | 203 (100%) | 6 (3%) |
|
|
900
|
-
| **Setup Complexity** | Low | Medium | Medium |
|
|
901
|
-
| **Cold Start Time** | <500ms | <2s | <2s |
|
|
902
|
-
| **Cost (Development)** | Free* | Free* | $1/hour | $0
|
|
903
|
-
| **Cost (Production)** | Free* | Infra costs | $1/hour |
|
|
904
|
-
| **
|
|
905
|
-
| **
|
|
1054
|
+
| **Setup Complexity** | Low | Medium | Medium | Low |
|
|
1055
|
+
| **Cold Start Time** | <500ms | <2s | <2s | ~2s (first load) |
|
|
1056
|
+
| **Cost (Development)** | Free* | Free* | $1/hour | $0 (100% free) |
|
|
1057
|
+
| **Cost (Production)** | Free* | Infra costs | $1/hour | $0 (100% free) |
|
|
1058
|
+
| **Privacy** | Local | Local | Cloud | 100% Offline |
|
|
1059
|
+
| **Scaling** | Manual | Orchestrator | Automatic | Manual |
|
|
1060
|
+
| **Best For** | Dev/Testing | CI/CD/Prod | Cloud-Scale | Privacy/Offline |
|
|
906
1061
|
|
|
907
1062
|
*Free infrastructure, Claude API costs only
|
|
908
1063
|
|
|
@@ -1033,63 +1188,55 @@ spec:
|
|
|
1033
1188
|
- Implement PodDisruptionBudgets
|
|
1034
1189
|
- All 203 MCP tools available
|
|
1035
1190
|
|
|
1036
|
-
###
|
|
1191
|
+
### π‘ ONNX Local Inference - Extended Configuration
|
|
1037
1192
|
|
|
1038
|
-
|
|
1193
|
+
**Advanced ONNX setup with router integration:**
|
|
1039
1194
|
|
|
1040
1195
|
```javascript
|
|
1041
|
-
//
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
mcpServers: {
|
|
1053
|
-
// β
Works: In-SDK server (6 tools)
|
|
1054
|
-
'claude-flow-sdk': claudeFlowSdkServer,
|
|
1055
|
-
|
|
1056
|
-
// β Blocked: Cannot spawn subprocess
|
|
1057
|
-
// 'claude-flow': { command: 'npx', args: [...] },
|
|
1058
|
-
|
|
1059
|
-
// β Blocked: Cannot spawn subprocess
|
|
1060
|
-
// 'flow-nexus': { command: 'npx', args: [...] }
|
|
1196
|
+
// router.config.json - Auto-route privacy tasks to ONNX
|
|
1197
|
+
{
|
|
1198
|
+
"routing": {
|
|
1199
|
+
"rules": [
|
|
1200
|
+
{
|
|
1201
|
+
"condition": { "privacy": "high", "localOnly": true },
|
|
1202
|
+
"action": { "provider": "onnx" }
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
"condition": { "cost": "free" },
|
|
1206
|
+
"action": { "provider": "onnx" }
|
|
1061
1207
|
}
|
|
1208
|
+
]
|
|
1209
|
+
},
|
|
1210
|
+
"providers": {
|
|
1211
|
+
"onnx": {
|
|
1212
|
+
"modelPath": "./models/phi-4/model.onnx",
|
|
1213
|
+
"maxTokens": 2048,
|
|
1214
|
+
"temperature": 0.7
|
|
1062
1215
|
}
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
return { statusCode: 200, body: JSON.stringify(result) };
|
|
1066
|
-
};
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1067
1218
|
```
|
|
1068
1219
|
|
|
1069
|
-
**
|
|
1070
|
-
|
|
|
1071
|
-
|
|
1072
|
-
|
|
|
1073
|
-
|
|
|
1074
|
-
|
|
|
1075
|
-
|
|
|
1076
|
-
|
|
|
1077
|
-
| Total Tools | 6/203 | Only 3% of tools work |
|
|
1220
|
+
**Performance Benchmarks:**
|
|
1221
|
+
| Metric | CPU (Intel i7) | GPU (NVIDIA RTX 3060) |
|
|
1222
|
+
|--------|---------------|----------------------|
|
|
1223
|
+
| Tokens/sec | ~6 | 60-300 |
|
|
1224
|
+
| First Token | ~2s | ~500ms |
|
|
1225
|
+
| Model Load | ~3s | ~2s |
|
|
1226
|
+
| Memory Usage | ~2GB | ~3GB |
|
|
1227
|
+
| Cost | $0 | $0 |
|
|
1078
1228
|
|
|
1079
|
-
**
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
**Solution: Use Flow Nexus sandboxes instead** - Full 203 tool support with Lambda-triggered sandbox execution:
|
|
1086
|
-
|
|
1087
|
-
```javascript
|
|
1088
|
-
// β
RECOMMENDED: Lambda triggers Flow Nexus sandbox
|
|
1089
|
-
import { flowNexus } from 'flow-nexus';
|
|
1229
|
+
**Use Cases:**
|
|
1230
|
+
- β
Privacy-sensitive data processing
|
|
1231
|
+
- β
Offline/air-gapped environments
|
|
1232
|
+
- β
Cost-conscious development
|
|
1233
|
+
- β
Compliance requirements (HIPAA, GDPR)
|
|
1234
|
+
- β
Prototype/testing without API costs
|
|
1090
1235
|
|
|
1091
|
-
|
|
1092
|
-
|
|
1236
|
+
**Documentation:**
|
|
1237
|
+
- [ONNX Integration Guide](docs/ONNX_INTEGRATION.md)
|
|
1238
|
+
- [ONNX CLI Usage](docs/ONNX_CLI_USAGE.md)
|
|
1239
|
+
- [ONNX vs Claude Quality Analysis](docs/ONNX_VS_CLAUDE_QUALITY.md)
|
|
1093
1240
|
const sandbox = await flowNexus.sandboxCreate({
|
|
1094
1241
|
template: 'node',
|
|
1095
1242
|
env_vars: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY }
|
|
@@ -1225,16 +1372,16 @@ npx agentic-flow --agent flow-nexus-sandbox \
|
|
|
1225
1372
|
| **Concurrent Agents** | 10+ on t3.small, 100+ on c6a.xlarge |
|
|
1226
1373
|
| **Token Efficiency** | 32% reduction via swarm coordination |
|
|
1227
1374
|
|
|
1228
|
-
### Cost Analysis
|
|
1375
|
+
### Cost Analysis - ONNX vs Cloud APIs
|
|
1229
1376
|
|
|
1230
|
-
|
|
|
1231
|
-
|
|
1232
|
-
|
|
|
1233
|
-
|
|
|
1234
|
-
|
|
|
1235
|
-
|
|
|
1377
|
+
| Provider | Model | Tokens/sec | Cost per 1M tokens | Monthly (100K tasks) |
|
|
1378
|
+
|----------|-------|------------|-------------------|---------------------|
|
|
1379
|
+
| ONNX Local | Phi-4 | 6-300 | $0 | $0 |
|
|
1380
|
+
| OpenRouter | Llama 3.1 8B | API | $0.06 | $6 |
|
|
1381
|
+
| OpenRouter | DeepSeek | API | $0.14 | $14 |
|
|
1382
|
+
| Claude | Sonnet 3.5 | API | $3.00 | $300 |
|
|
1236
1383
|
|
|
1237
|
-
|
|
1384
|
+
**ONNX Savings:** Up to $3,600/year for typical development workloads
|
|
1238
1385
|
|
|
1239
1386
|
---
|
|
1240
1387
|
|