Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Agent Fabric

Generate custom AI agents from natural language descriptions

Agent Fabric is a powerful tool that allows you to create specialized AI agents simply by describing what you want them to do in plain language. The system analyzes your requirements and generates fully functional, standalone Python agents using PydanticAI with MCP and A2A compatibility.

Features

  • πŸ€– Natural Language Agent Creation - Describe your agent in plain English/German
  • 🎯 Intelligent Specialization - Automatically generates optimized system prompts for different use cases
  • πŸ“¦ Standalone Agents - Each generated agent is a complete, runnable Python file
  • πŸ”§ MCP Integration - Optional support for external tools and capabilities
  • 🌐 A2A Compatible - Agents can be run as servers for integration with other applications
  • πŸ“± User-Friendly Interface - Clean Gradio web interface with tabs and examples
  • πŸ“₯ Easy Download - Direct download of generated agents and requirements

What Can You Create?

Agent Fabric uses intelligent analysis to create specialized agents for virtually any task. Simply describe what you need and the system will generate an optimized agent. Examples include:

  • Prompt Engineers - Create multiple prompt variations using different techniques (Zero-Shot, Few-Shot, Chain-of-Thought, Role-Based, Instruction-Following)
  • Content Writers - Speech writers, blog post creators, marketing copy generators
  • Language Experts - Translators, grammar checkers, style improvers, text summarizers
  • Code Specialists - Programming assistants, code converters between languages, debugging helpers
  • Research Assistants - Information gatherers, web searchers, data analysts
  • Communication Tools - Email composers, presentation creators, documentation writers
  • Analysis Experts - Sentiment analyzers, data interpreters, review evaluators

The system intelligently creates the optimal system prompt and configuration for whatever you describe, no predefined templates needed.

Supported Agent Types

  • Code Conversion - Convert code between programming languages
  • Text Processing - Grammar correction, style optimization, proofreading
  • Sentiment Analysis - Analyze emotions and sentiment in text
  • Translation - Multi-language translation with cultural nuances
  • Summarization - Extract key points and create summaries
  • Information Research - Web search and information gathering
  • Programming - Code generation and software development assistance

Installation

Prerequisites

  • Python 3.11 or higher
  • uv (recommended) or pip

Using uv (Recommended)

# Clone or download the project
cd agent_fabric

# Install dependencies
uv sync

# Start Agent Fabric
uv run python main.py

Using pip

# Clone or download the project
cd agent_fabric

# Install dependencies
pip install -r requirements.txt

# Start Agent Fabric
python main.py

Quick Start

  1. Start Agent Fabric

    uv run python main.py
  2. Open your browser to http://localhost:7860

  3. Describe your agent in the text field:

    "Create an agent that corrects German grammar and improves text style"
    
  4. Configure settings (optional):

    • Enable external tools for web search, time, etc.
    • Adjust LLM server settings if using custom endpoints
  5. Generate and download your agent:

    • Click "Generate Agent"
    • Save and download the generated .py file and requirements.txt

LLM Server Configuration

Agent Fabric supports various LLM providers:

Ollama (Default)

Server: http://localhost:11434/v1
Model: qwen2.5:latest
API Key: sk-dummy

LM Studio

Server: http://localhost:1234/v1
Model: your-model-name
API Key: sk-dummy

OpenAI Compatible APIs

Server: https://api.openai.com/v1
Model: gpt-3.5-turbo
API Key: your-actual-api-key

Using Generated Agents

Each generated agent is a standalone Python file with multiple usage modes:

Interactive Mode

python your_agent.py

Server Mode (A2A Compatible)

python your_agent.py server

Access at http://localhost:8000

Installing Agent Dependencies

# In the same directory as your agent
pip install -r requirements.txt

# Or with uv
uv add pydantic-ai pydantic-ai-slim[a2a] fasta2a fastapi uvicorn

Project Structure

agent_fabric/
β”œβ”€β”€ main.py              # Gradio web interface
β”œβ”€β”€ generator.py         # Agent code generator
β”œβ”€β”€ requirements.txt     # Project dependencies
β”œβ”€β”€ pyproject.toml      # Project configuration
└── README.md           # This file

Example Usage

Creating a Code Converter Agent

Description: "I need a code converter from Python to Go"
Result: Specialized agent that converts Python code to idiomatic Go code

Creating a Text Analysis Agent

Description: "Analyze sentiment in customer reviews and social media posts"
Result: Expert sentiment analysis agent with structured output

Creating a Research Agent

Description: "Search for current news and information on any topic"
External Tools: βœ“ Enabled
Result: Research agent with web search capabilities

Advanced Features

MCP Integration

Enable "External Tools" to give your agent access to:

  • Web search via DuckDuckGo
  • Current time and date
  • Weather information
  • PDF conversion
  • Text anonymization

A2A Compatibility

All generated agents are compatible with the Agent-to-Agent (A2A) protocol:

  • Can be deployed as microservices
  • Easy integration with other AI systems
  • RESTful API endpoints
  • Health check endpoints

Troubleshooting

Common Issues

"Received empty model response"

  • Check if your LLM server is running
  • Verify the model name is correct
  • Test server connectivity

Syntax errors in generated code

  • Usually caused by special characters in descriptions
  • The system automatically escapes most issues

Import errors when running agents

  • Install required dependencies: pip install -r requirements.txt
  • Or use: uv add pydantic-ai pydantic-ai-slim[a2a] fasta2a fastapi uvicorn

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

This project is open source. See LICENSE file for details.

Support

For issues and questions:

  • Check the "Help" tab in the web interface
  • Review this README
  • Submit GitHub issues for bugs

Agent Fabric - Making AI agent creation accessible to everyone through natural language descriptions.

About

Agent Fabric generates custom AI agents from colloquial descriptions, offering a Gradio web interface and FastAPI backend for agent creation and management.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages