create-forge-agent
v1.1.0
Published
π₯ FORGE - Framework for Orchestrating Robust Generative Engineers. Build production-ready AI agents with Kestra orchestration.
Maintainers
Readme
π₯ FORGE
ββββββββ βββββββ βββββββ βββββββ ββββββββ
βββββββββββββββββββββββββββββββββ ββββββββ
ββββββ βββ ββββββββββββββ ββββββββββ
ββββββ βββ ββββββββββββββ βββββββββ
βββ ββββββββββββ ββββββββββββββββββββ
βββ βββββββ βββ βββ βββββββ ββββββββπ₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯
Framework for Orchestrating Robust Generative Engineers
Build production-ready AI agents with Kestra orchestration in minutes, not weeks.
π Quick Start
# Install globally
npm install -g create-forge-agent
# Initialize a new FORGE project
forge init
# Configure your credentials in .env
# Then list workflows
forge workflow list
# Run a workflow
forge workflow run my-workflow --wait
# View execution logs
forge logs <execution-id>π― What is FORGE?
FORGE is a comprehensive framework for building production-grade AI agents with Kestra orchestration. It combines:
- π€ AI Agents - Pydantic-first Python agents with type safety
- πΌ Orchestration - Kestra workflows for reliable execution
- π₯ Best Practices - Production patterns from day one
- β‘ Performance - 60x faster with Docker custom images
- π Observability - OpenTelemetry built-in
- π‘οΈ Guardrails - PII detection, rate limiting, cost control
ποΈ Architecture
FORGE uses a meta-agent architecture powered by Claude Code:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FORGE Symphony β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Researcher (4-Tier) β Architect (Dual-Mode) β
β β β β
β Knowledge Base Python Agent Spec β
β β β
β Smith-Code Generator β
β β β
β Production-Ready Agent β
β β
β βββββββββββββββββββββββββββββββββββββββββββββ β
β β
β Researcher (4-Tier) β Architect (Dual-Mode) β
β β β β
β Knowledge Base Kestra Workflow Spec β
β β β
β Smith-Orchestrator Generator β
β β β
β Kestra YAML + Docker + Tests β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββπΌ Meta-Agents
FORGE includes 4 production-ready meta-agents (Claude Code slash commands):
1. π Researcher (4-Tier Web Search Specialist)
/researcher *deep "customer support agent patterns"- Tier 1: Basic web, GitHub, docs search
- Tier 2: Multi-source, cross-validation, temporal filtering
- Tier 3: arXiv, Stack Overflow, GitHub Issues, Reddit/HN
- Tier 4: Knowledge graph, concept mapping, best practices
2. π Architect (Dual-Mode Designer)
# Design Python AI agent
/architect *design python-agent customer-support
# Design Kestra workflow
/architect *design kestra-workflow ml-training- 5-question interview for complete requirements
- Generates comprehensive YAML specs
- Supports both Python agents and Kestra workflows
3. βοΈ Smith-Code (Python Agent Generator)
/smith-code *generate customer-support- Generates Pydantic-first Python agents
- Includes tools, guardrails, tests
- Type-safe I/O with JSON Schema export
- OpenTelemetry observability built-in
4. πΌ Smith-Orchestrator (Kestra Workflow Generator)
/smith-orchestrator *generate ml-training- Generates Kestra YAML workflows
- Includes Docker custom images (60x faster!)
- Git integration patterns
- Test workflows and CI/CD automation
π Documentation
FORGE includes 7 comprehensive documentation files (163KB):
Orchestration Docs
- kestra-patterns.md (21KB) - 12 production Kestra patterns
- kestra-git-integration.md (10KB) - 10 Git integration patterns
- kestra-requirements.md (8KB) - Docker optimization (60x speedup)
Code Docs
- agent-pattern.md (15KB) - ForgeAgent base class
- pydantic-schemas.md (10KB) - Type-safe I/O patterns
- tool-pattern.md (8KB) - @forge.tool decorator
- testing-strategy.md (7KB) - Comprehensive testing guide
π₯ Key Features
β‘ 60x Performance Boost
Docker custom images instead of beforeCommands:
- Before: ~10 minutes (pip install every execution)
- After: ~10 seconds (dependencies pre-installed)
- Impact: Production-grade by default
π‘οΈ Production-Ready Guardrails
- PII Detection: Prevent sensitive data leakage
- Prompt Injection: Detect jailbreak attempts
- Rate Limiting: Control request volume
- Cost Control: Cap inference costs
- Toxicity Detection: Filter harmful content
π Built-in Observability
- OpenTelemetry: Distributed tracing
- Structured Logs: JSON logging
- Metrics: Request duration, token usage, error rate
- Dashboards: Track agent performance
π Transformation Protocol
Agents can transform into each other seamlessly:
User: /smith-code *generate customer-support
[Spec missing - transforms to Architect]
Architect: π Let's design the architecture...
[Completes 5-question interview]
[Generates spec YAML]
[Transforms back to Smith-Code]
Smith-Code: β
Agent generated!π¦ Installation
Global Installation (Recommended)
npm install -g create-forge-agent
forge --versionLocal Installation
npm install create-forge-agent
npx forge initFrom Source
git clone https://github.com/forge-ai/create-forge-agent
cd create-forge-agent
npm install
npm run build
npm linkπ― CLI Commands
Initialize Project
forge initCreates:
forge.config.yaml- FORGE configuration.env- Environment variables (add to .gitignore!).forge-specs/- Agent and workflow specs.forge-docs/- Documentationsrc/agents/- Generated agentstests/- Test files
Workflow Management
# List workflows
forge workflow list
forge workflow list --namespace forge.workflows
# Run workflow
forge workflow run my-workflow
forge workflow run my-workflow --inputs '{"param": "value"}'
forge workflow run my-workflow --wait # Wait for completion
# Check workflow
forge workflow check my-workflow
# Delete workflow
forge workflow delete my-workflow
forge workflow delete my-workflow --forceExecution Logs
# Show execution logs
forge logs <execution-id>
forge logs <execution-id> --follow # Follow real-time
# List recent executions
forge logs:list my-workflow
forge logs:list my-workflow --limit 20Quick Commands
# List workflows (alias)
forge list
forge ls
# Workflow run (alias)
forge w run my-workflowβοΈ Configuration
forge.config.yaml
kestra:
url: ${KESTRA_URL:-http://localhost:8080}
apiToken: ${KESTRA_API_TOKEN}
# Or use basic auth:
# basicAuth:
# username: ${KESTRA_USERNAME}
# password: ${KESTRA_PASSWORD}
openrouter:
apiKey: ${OPENROUTER_API_KEY}
defaults:
namespace: forge.workflows
docker_registry: registry.example.com # Optional.env
# Kestra Configuration
KESTRA_URL=http://localhost:8080
KESTRA_API_TOKEN=your-api-token-here
# Or use basic auth:
# KESTRA_USERNAME=admin
# KESTRA_PASSWORD=admin
# OpenRouter Configuration
OPENROUTER_API_KEY=your-openrouter-api-key-here
# Docker Registry (optional)
DOCKER_REGISTRY=registry.example.comπ Complete Workflow
1. Research Best Practices
# In Claude Code
/researcher *deep "customer support agent patterns 2024"Output: Research stored in knowledge base
2. Design Agent Architecture
# In Claude Code
/architect *design python-agent customer-support5-Question Interview:
- Agent type? β Support Agent
- Input/Output? β question (str), customer_id (int) β answer (str), confidence (float)
- Tools? β kb_search, web_search, create_ticket
- Routing? β claude-3.5-sonnet β llama-3.2-3b-instruct
- Guardrails? β PII detection, toxicity, rate limiting
Output: .forge-specs/agents/customer-support.yaml
3. Generate Agent Code
# In Claude Code
/smith-code *generate customer-supportOutput:
src/agents/customer_support.py- Agent classsrc/tools/kb_search.py- Toolstests/test_customer_support.py- Tests
4. Design Kestra Workflow
# In Claude Code
/architect *design kestra-workflow support-pipeline5-Question Interview:
- Workflow type? β Event-driven
- Git integration? β Clone & execute
- Scripts? β Python + Docker custom image
- Orchestration? β Sequential
- Triggers? β Webhook
Output: .forge-specs/workflows/support-pipeline.yaml
5. Generate Workflow
# In Claude Code
/smith-orchestrator *generate support-pipelineOutput:
workflows/support-pipeline.yaml- Kestra YAMLDockerfile- Custom imagerequirements.txt- Dependenciesworkflows/support-pipeline-test.yaml- Test workflow
6. Deploy & Monitor
# Deploy workflow to Kestra (manual or via Kestra UI)
# Run workflow
forge workflow run support-pipeline --wait
# Monitor logs
forge logs <execution-id> --follow
# Check statistics
forge workflow check support-pipelineπ¨ Examples
Customer Support Agent
# Generated by Smith-Code
from forge import forge, ForgeAgent
from pydantic import BaseModel, Field
class CustomerSupportInput(BaseModel):
customer_question: str = Field(..., description="Customer's question")
customer_id: int = Field(..., description="Customer ID")
class CustomerSupportOutput(BaseModel):
answer: str = Field(..., description="Answer to question")
confidence: float = Field(..., ge=0.0, le=1.0)
sources: list[str] = Field(default=[])
@forge.agent(
name="customer_support",
model="anthropic/claude-3.5-sonnet",
fallback="meta-llama/llama-3.2-3b-instruct",
tools=[kb_search_tool, web_search_tool],
guardrails={
"input": ["pii_detection", "toxicity"],
"output": ["pii_leakage", "factual_consistency"]
},
memory_type="hybrid"
)
class CustomerSupportAgent(ForgeAgent[CustomerSupportInput, CustomerSupportOutput]):
system_prompt = """
You are a customer support agent...
"""
async def before_execute(self, input: CustomerSupportInput):
# Load customer profile
self.customer_profile = await self.db.get_customer(input.customer_id)
async def after_execute(self, output: CustomerSupportOutput):
# Store interaction
await self.db.store_interaction(...)ML Training Workflow
# Generated by Smith-Orchestrator
id: ml-training
namespace: forge.workflows
tasks:
- id: clone_repo
type: io.kestra.plugin.git.Clone
url: https://github.com/org/ml-training
branch: main
username: "{{ secret('GITHUB_USER') }}"
password: "{{ secret('GITHUB_TOKEN') }}"
- id: train_model
type: io.kestra.plugin.scripts.python.Script
docker:
image: myorg/ml-base:1.0 # 60x faster!
script: |
import sys
sys.path.insert(0, '{{ outputs.clone_repo.directory }}')
from training import train_model
result = train_model()
print(f"::{{outputs.accuracy}}::{result['accuracy']}")
- id: deploy_if_good
type: io.kestra.plugin.core.flow.Switch
value: "{{ outputs.train_model.vars.accuracy }}"
cases:
HIGH:
- id: deploy_model
type: io.kestra.plugin.scripts.python.Script
script: |
from deployment import deploy
deploy(model_uri="{{ outputs.train_model.vars.model_uri }}")
LOW:
- id: notify_team
type: io.kestra.plugin.notifications.slack.SlackExecution
url: "{{ secret('SLACK_WEBHOOK') }}"
customMessage: "Model accuracy too low: {{ outputs.train_model.vars.accuracy }}"
triggers:
- id: daily_training
type: io.kestra.plugin.core.trigger.Schedule
cron: "0 2 * * *"
- id: on_push
type: io.kestra.plugin.core.trigger.Webhook
key: github-pushπ§ͺ Testing
FORGE includes comprehensive testing patterns:
Test Pyramid
- 60% Unit Tests: Individual components
- 30% Integration Tests: Agent + dependencies
- 10% E2E Tests: Full workflows
Run Tests
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Watch mode
npm run test:watchExample Test
// tests/kestra-client.test.ts
import { KestraClient } from '../src/clients/kestra';
describe('KestraClient', () => {
it('should list flows', async () => {
const client = new KestraClient(testConfig.kestra, 'forge.workflows');
const flows = await client.listFlows();
expect(flows).toBeInstanceOf(Array);
});
it('should execute workflow', async () => {
const client = new KestraClient(testConfig.kestra, 'forge.workflows');
const execution = await client.executeFlow('test-workflow');
expect(execution.id).toBeDefined();
expect(execution.state.current).toBe('RUNNING');
});
});π Performance
Benchmark: ML Training Pipeline (10 tasks)
| Metric | Before (beforeCommands) | After (Docker Custom) | Improvement | |--------|-------------------------|----------------------|-------------| | Dependency Install | 10 min Γ 10 = 100 min | 0 min (cached) | β | | Execution | 20 min | 20 min | - | | Total | 120 minutes | 20 minutes | 6x faster |
Per-Task Performance
| Metric | Before | After | Improvement | |--------|--------|-------|-------------| | First Run | 10 minutes | 30 seconds | 20x | | Subsequent Runs | 10 minutes | 10 seconds | 60x | | Reliability | Network-dependent | Cached | 100% |
π€ Contributing
Contributions welcome! Please read CONTRIBUTING.md first.
Development Setup
git clone https://github.com/forge-ai/create-forge-agent
cd create-forge-agent
npm install
npm run dev # Watch modeProject Structure
create-forge-agent/
βββ src/
β βββ commands/ # CLI commands
β βββ clients/ # Kestra API client
β βββ utils/ # Utilities (config, logo)
β βββ types/ # TypeScript types
βββ tests/ # Test files
βββ bin/ # Executable
βββ dist/ # Compiled outputπ License
MIT Β© FORGE Contributors
π Links
- GitHub: https://github.com/forge-ai/create-forge-agent
- Documentation: https://forge-ai.github.io/docs
- Issues: https://github.com/forge-ai/create-forge-agent/issues
- NPM: https://www.npmjs.com/package/create-forge-agent
π Show Your Support
Give a βοΈ if this project helped you!
Built with β€οΈ by the FORGE community
π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯
