Thanks to visit codestin.com
Credit goes to github.com

Skip to content

h9-tec/agentforge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”₯ AgentForge

Forge intelligent AI agents with CrewAI - Transform ideas into powerful multi-agent systems

AgentForge is the first multi-agent framework to use reinforcement learning for automatic agent creation and optimization. Unlike traditional frameworks that require manual agent design, AgentForge intelligently creates, adapts, and optimizes agents based on performance feedback.

🎯 What Makes AgentForge Special?

  • πŸ”§ Intelligent Tool Management: Automatic mapping of custom tool names to CrewAI implementations
  • πŸ€– Adaptive Agents: Automatically creates specialized agents when needed
  • πŸ“Š AI-Powered Analytics: Intelligent performance tracking and optimization
  • 🎨 Creative CLI: Beautiful, intuitive command-line interface
  • πŸ”Œ Multi-Provider: Support for all major LLM providers including local models
  • πŸ“š Template Library: Pre-built patterns for common use cases
  • πŸ› οΈ Robust Tool Registry: Comprehensive tool management with fallback mechanisms

πŸ“¦ Installation

# Install from PyPI (when available)
pip install agentforge

# Or install from source
git clone https://github.com/h9-tec/agentforge
cd agentforge
python -m venv venv
source venv/bin/activate
pip install -e .

⚑ Quick Start

1. Configure Your LLM Provider

# Configure OpenAI (most common)
agentforge providers --configure openai --api-key "your-key" --model "gpt-4"

# Or configure local models
agentforge providers --configure ollama --model "llama3.1"

2. Create Your First Crew

# Basic crew creation
agentforge forge "Create a blog writer who writes engaging content" --name blog_writer

# Using templates for faster setup
agentforge forge "Analyze sales data" --template data_analysis --name sales_analyst

3. Execute Your Crew

# Run the crew
agentforge ignite blog_writer --input "Write a blog post about AI trends"

# With additional context
agentforge ignite sales_analyst --input "Focus on Q4 performance"

4. Monitor Performance

# View analytics
agentforge analytics --summary

# Check specific crew performance
agentforge analytics --crew blog_writer --days 7

πŸ”§ Tool Management System

AgentForge features an intelligent tool management system that automatically handles tool mapping and instantiation:

Automatic Tool Mapping

The system automatically maps custom tool names to actual CrewAI tool implementations:

# In your agent configuration
tools:
  - api_calls          # Maps to SerperDevTool
  - file_operations    # Maps to FileReadTool
  - code_execution     # Maps to CodeInterpreterTool
  - document_search    # Maps to PDFSearchTool
  - github_search      # Maps to GithubSearchTool
  - web_scraping       # Maps to ScrapeWebsiteTool
  - database_search    # Maps to PGSearchTool
  - browser_automation # Maps to BrowserbaseLoadTool
  - vision            # Maps to VisionTool

Supported Tools

  • Web Search: api_calls, web_search β†’ SerperDevTool
  • File Operations: file_operations β†’ FileReadTool
  • Code Execution: code_execution β†’ CodeInterpreterTool
  • Document Search: document_search β†’ PDFSearchTool, DOCXSearchTool, etc.
  • GitHub Integration: github_search β†’ GithubSearchTool
  • Web Scraping: web_scraping β†’ ScrapeWebsiteTool
  • Database: database_search β†’ PGSearchTool
  • Browser Automation: browser_automation β†’ BrowserbaseLoadTool
  • Vision: vision β†’ VisionTool

Fallback Mechanisms

  • Automatic fallback to SerperDevTool for unknown tools
  • Graceful handling of missing dependencies
  • Comprehensive error logging and reporting

Usage Example

# In your crew configuration (agents.yaml)
tools:
  - api_calls          # Automatically maps to SerperDevTool
  - file_operations    # Automatically maps to FileReadTool
  - code_execution     # Automatically maps to CodeInterpreterTool

# The system automatically handles:
# 1. Tool name mapping
# 2. Tool instantiation
# 3. Error handling
# 4. Fallback mechanisms

πŸ—οΈ Project Structure

agentforge/
β”œβ”€β”€ agentforge/           # Core framework
β”‚   β”œβ”€β”€ agents/          # Agent implementations
β”‚   β”œβ”€β”€ core/            # Core functionality
β”‚   β”œβ”€β”€ tools/           # Tool registry and management
β”‚   β”œβ”€β”€ analytics/       # Performance analytics
β”‚   β”œβ”€β”€ logging/         # Logging system
β”‚   └── templates/       # Crew templates
β”œβ”€β”€ crews/               # Production crews
β”‚   β”œβ”€β”€ simple_writer/   # Simple blog writing crew
β”‚   └── tech_blog_writer_final/  # Advanced tech blog writing crew
└── docs/                # Documentation

🎭 Production Crews

AgentForge comes with pre-built production crews ready to use:

Simple Writer Crew

A streamlined crew for basic content creation:

  • Agents: Social Media Content Language Model Specialist, Text Generator Specialist
  • Tools: FileReadTool, CodeInterpreterTool
  • Use Case: Quick content generation and social media posts

Tech Blog Writer Final Crew

A comprehensive crew for technical content creation:

  • Agents: Research Specialist, Content Creator, Editor Specialist, Database Specialist
  • Tools: api_calls, file_operations, document_search, github_search, database_search
  • Use Case: Technical blog posts, research articles, and comprehensive content

πŸš€ Enhanced Features

🧠 Adaptive Agent Creation with Reinforcement Learning

The system can automatically create new agents based on performance feedback using sophisticated RL algorithms:

# Analyze crew performance and get recommendations
agentforge adaptive analyze --crew my_crew

# Let the system decide to create specialized agents
agentforge adaptive create --crew my_crew --context "complex data analysis"

# Train the RL system to make better decisions
agentforge rl train --crew my_crew --episodes 50

# Get insights into the learning system
agentforge rl insights

Key Benefits:

  • πŸ€– Self-Evolving: Automatically creates agents when performance drops
  • 🎯 Context-Aware: Considers task complexity and requirements
  • πŸ“ˆ Learning: Improves decisions through reinforcement learning
  • ⚑ Specialized: Creates domain-specific agents (research, creative, technical, etc.)

πŸ”Œ Multi-Provider LLM Support

Support for all major LLM providers including local models:

# OpenAI
agentforge providers --configure openai --api-key "your-key" --model "gpt-4"

# Anthropic Claude
agentforge providers --configure anthropic --api-key "your-key" --model "claude-3-sonnet"

# Google Gemini
agentforge providers --configure google --api-key "your-key" --model "gemini-pro"

# Local Models
agentforge providers --configure ollama --model "llama3.1" --ollama-host "http://localhost:11434"
agentforge providers --configure llamacpp --model "llama-3.1-8b" --model-path "/path/to/model.gguf"

# Custom Providers
agentforge providers --configure custom --api-key "your-key" --base-url "https://api.example.com/v1" --model "gpt-4o-mini"

πŸ“š Crew Templates & Pattern Library

Pre-built templates for common use cases:

# List available templates
agentforge templates --list

# Search for specific templates
agentforge templates --search "data analysis"

# Use a template when creating a crew
agentforge forge "Analyze sales data" --template data_analysis

# Get template recommendations
agentforge templates --recommend "content creation"

Available Templates:

  • πŸ“Š Data Analysis: Statistical analysis, data processing, visualization
  • ✍️ Content Creation: Blog writing, social media, marketing content
  • πŸ” Research: Market research, competitive analysis, academic research
  • πŸ’» Development: Code generation, debugging, system design
  • πŸ“ˆ Business: Strategy planning, financial analysis, reporting

πŸ“Š Performance Analytics & Cost Optimization

Comprehensive tracking and optimization:

# View performance summary
agentforge analytics --summary

# Analyze specific crew performance
agentforge analytics --crew my_crew --days 30

# Get cost analysis
agentforge analytics --costs --crew my_crew

# Get optimization recommendations
agentforge analytics --optimize --crew my_crew

# Export analytics data
agentforge analytics --export analytics_report.json

Analytics Features:

  • πŸ“ˆ Performance Tracking: Success rates, execution times, quality scores
  • πŸ’° Cost Analysis: LLM usage costs, efficiency metrics
  • 🎯 Optimization: AI-powered recommendations for improvement
  • πŸ“Š Visualization: Charts and graphs for better insights

πŸ› οΈ Enhanced Error Handling & Logging

Robust error management and debugging:

# View log summary
agentforge logs --summary

# Check for errors
agentforge logs --errors

# Enable debug tracing
agentforge logs --debug

# Set log level
agentforge logs --set-level DEBUG

# Export logs
agentforge logs --export debug_logs.txt

Logging Features:

  • πŸ” Structured Logging: Context-aware logging with metadata
  • 🚨 Error Classification: Categorized error handling and recovery
  • πŸ“Š Performance Tracing: Function-level performance monitoring
  • πŸ”„ Recovery Strategies: Automatic error recovery mechanisms

🎨 Creative CLI Design

Beautiful, intuitive command-line interface:

# Fancy ASCII art banner
agentforge

# Creative command names
agentforge forge "Create a blog writer"    # Instead of "create"
agentforge ignite my_crew                  # Instead of "run"

# Rich output with colors and formatting
agentforge providers --list
agentforge analytics --summary

CLI Features:

  • 🎨 Rich Formatting: Colors, emojis, and beautiful output
  • ⚑ Intuitive Commands: Creative naming (forge, ignite, etc.)
  • πŸ“± Interactive Prompts: Guided setup and configuration
  • πŸ” Help System: Comprehensive help and examples

πŸ“‹ Complete Command Reference

πŸ”₯ Core Commands

Command Description Example
agentforge forge Create a new agent crew agentforge forge "Create a blog writer" --name blog_crew
agentforge ignite Execute an existing crew agentforge ignite blog_crew --input "Write about AI"
agentforge providers Manage LLM providers agentforge providers --configure openai --api-key "key"
agentforge version Show version information agentforge version

🧠 Adaptive & RL Commands

Command Description Example
agentforge adaptive analyze Analyze crew performance agentforge adaptive analyze --crew my_crew
agentforge adaptive create Create adaptive agents agentforge adaptive create --crew my_crew --context "complex task"
agentforge adaptive insights View adaptive system insights agentforge adaptive insights
agentforge adaptive learn Update learning parameters agentforge adaptive learn
agentforge rl step Execute RL step agentforge rl step --crew my_crew --context "task"
agentforge rl train Train RL system agentforge rl train --crew my_crew --episodes 50
agentforge rl insights View RL system insights agentforge rl insights
agentforge rl reset Reset RL model agentforge rl reset

πŸ“š Template Commands

Command Description Example
agentforge templates --list List available templates agentforge templates --list
agentforge templates --search Search templates agentforge templates --search "data analysis"
agentforge templates --show Show template details agentforge templates --show data_analysis
agentforge templates --recommend Get recommendations agentforge templates --recommend "content creation"
agentforge templates --filter Filter by category agentforge templates --filter business

πŸ“Š Analytics Commands

Command Description Example
agentforge analytics --summary View performance summary agentforge analytics --summary
agentforge analytics --crew Analyze specific crew agentforge analytics --crew my_crew --days 30
agentforge analytics --costs View cost analysis agentforge analytics --costs --crew my_crew
agentforge analytics --optimize Get optimizations agentforge analytics --optimize --crew my_crew
agentforge analytics --export Export analytics agentforge analytics --export report.json

πŸ› οΈ Logging Commands

Command Description Example
agentforge logs --summary View log summary agentforge logs --summary
agentforge logs --errors View error logs agentforge logs --errors
agentforge logs --debug View debug traces agentforge logs --debug
agentforge logs --set-level Set log level agentforge logs --set-level DEBUG
agentforge logs --export Export logs agentforge logs --export logs.txt
agentforge logs --clear Clear log history agentforge logs --clear

πŸ†š Feature Comparison

Feature AgentForge Basic CrewAI Other Frameworks
Multi-Agent Creation βœ… AI-Powered βœ… Manual ❌ Limited
Tool Management βœ… Intelligent Mapping ⚠️ Manual ❌ Basic
Adaptive Agents βœ… RL-Based ❌ Static ❌ Not Available
Template Library βœ… 10+ Templates ❌ None ⚠️ Basic
Performance Analytics βœ… Advanced ❌ None ⚠️ Basic
Cost Optimization βœ… AI-Powered ❌ None ❌ Not Available
Error Handling βœ… Comprehensive ⚠️ Basic ⚠️ Basic
Local LLM Support βœ… Ollama + LlamaCpp ⚠️ Limited ⚠️ Limited
CLI Experience βœ… Rich & Creative ⚠️ Basic ⚠️ Basic
Learning System βœ… Reinforcement Learning ❌ None ❌ Not Available
Specialization βœ… Domain-Specific ❌ Generic ⚠️ Limited
Production Crews βœ… Ready-to-Use ❌ None ❌ Not Available

πŸ†• Recent Updates

Tool Management System Overhaul

  • βœ… Intelligent Tool Mapping: Automatic mapping of custom tool names to CrewAI implementations
  • βœ… Comprehensive Tool Registry: Support for 15+ different tool types
  • βœ… Fallback Mechanisms: Graceful handling of missing tools and dependencies
  • βœ… Error Recovery: Robust error handling with detailed logging

Codebase Cleanup

  • βœ… Test Agent Removal: Cleaned up all test and development agents
  • βœ… Production-Ready: Only production crews remain (simple_writer, tech_blog_writer_final)
  • βœ… Updated .gitignore: Comprehensive patterns for excluding test files and cache directories
  • βœ… Optimized Structure: Streamlined project structure for better maintainability

Enhanced Documentation

  • βœ… Updated README: Comprehensive documentation with current features
  • βœ… Tool Reference: Complete tool mapping and usage examples
  • βœ… Project Structure: Clear overview of the codebase organization

🎯 Why Choose AgentForge?

πŸš€ Advanced AI Capabilities

  • Self-Evolving: Agents automatically improve and specialize
  • Context-Aware: Understands task complexity and requirements
  • Learning System: Gets smarter with every interaction
  • Intelligent Optimization: AI-powered performance improvements

πŸ› οΈ Developer Experience

  • Rich CLI: Beautiful, intuitive command-line interface
  • Comprehensive Logging: Detailed debugging and monitoring
  • Template System: Pre-built patterns for common use cases
  • Multi-Provider: Support for all major LLM providers

πŸ“Š Enterprise Features

  • Performance Analytics: Detailed metrics and insights
  • Cost Management: Budget-aware execution and optimization
  • Error Recovery: Robust error handling and recovery
  • Scalability: Handles complex, multi-step workflows

πŸ”¬ Research & Innovation

  • Reinforcement Learning: Cutting-edge RL algorithms
  • Adaptive Systems: Self-modifying agent architectures
  • Specialization Patterns: Domain-specific agent creation
  • Performance Optimization: Continuous improvement algorithms

🌟 Key Innovations

🧠 Reinforcement Learning for Agent Creation

AgentForge is the first framework to use RL algorithms for automatic agent creation:

  • Q-Learning: Learns optimal decisions through experience
  • State Management: Tracks 6 different environmental states
  • Action Selection: 7 different actions for agent management
  • Continuous Learning: Improves with every interaction

πŸ€– Adaptive Agent Specialization

Agents automatically specialize based on performance and requirements:

  • Domain-Specific: Research, creative, technical, analytical, communication
  • Performance-Driven: Creates agents when performance drops
  • Context-Aware: Considers task complexity and requirements
  • Self-Evolving: Agents improve and adapt over time

πŸ“Š AI-Powered Analytics & Optimization

Comprehensive performance tracking with intelligent optimization:

  • Real-Time Metrics: Success rates, execution times, quality scores
  • Cost Analysis: LLM usage costs and efficiency metrics
  • Predictive Optimization: AI-powered recommendations
  • Performance Trends: Historical analysis and forecasting

🎨 Creative Developer Experience

Beautiful, intuitive interface designed for productivity:

  • Rich CLI: Colors, emojis, and beautiful formatting
  • Creative Commands: forge, ignite, adaptive, rl
  • Interactive Prompts: Guided setup and configuration
  • Comprehensive Help: Detailed examples and documentation

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Add tests if applicable
  5. Commit your changes: git commit -m 'Add amazing feature'
  6. Push to the branch: git push origin feature/amazing-feature
  7. Open a Pull Request

Development Setup

# Clone and setup development environment
git clone https://github.com/AgentForge/agentforge
cd agentforge

# Install development dependencies
pip install -e .

πŸ“„ License

AgentForge is released under the MIT License. See LICENSE for details.

πŸ™ Acknowledgments


Built with ❀️ for the AI community

AgentForge represents the future of multi-agent systems - intelligent, adaptive, and self-evolving.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published