An AI-powered agent factory where multiple AI agents collaborate to generate and refine ideas. Watch as these agents work in parallel, discuss concepts, and produce unique insights — all accessible through an intuitive Gradio interface.
This project is powered by Microsoft Autogen (AgentChat + Core + gRPC runtime). It spins up a Creator agent that generates new agent classes on the fly, registers them with a lightweight gRPC runtime, messages them with your prompt, and packages outputs to Google Cloud Storage (GCS) with signed download links.
- Multi-agent generation (Autogen)
- Uses
autogen_agentchatandautogen_corewith the gRPC worker runtime to create and interact with multiple agents concurrently.
- Uses
- One-click pipeline
- Enter a prompt → create agents → collect ideas → package ideas and generated agent code → upload to GCS → return signed URLs.
- Polished Gradio UI
- Clean header, example loader, progress updates, and result boxes with copy buttons.
- Artifact delivery via GCS
- Zips are uploaded to GCS and returned as time-limited signed URLs. Local source files are cleaned up automatically.
- Model-flexible
- Uses OpenRouter-hosted models via an OpenAI-compatible client. Model and base URL are set in
main/constants.py.
- Uses OpenRouter-hosted models via an OpenAI-compatible client. Model and base URL are set in
- UI:
main/gradio_app.py(entry launched bymain/app.py) - Pipeline:
main/pipeline.py- Starts the Autogen gRPC runtime, generates agents, collects outputs, and triggers upload
- Agents:
- Template agent:
main/agent.py - Creator agent (generates agents on the fly):
main/creator.py
- Template agent:
- Cloud upload:
main/upload_to_gcp.py(bundles and uploads artifacts to GCS, returns signed URLs) - Configuration:
main/constants.py(OpenRouter base URL, model, number of agents)
- Python 3.10+
- A modern browser
- Accounts/keys:
- OpenRouter API key (for model access)
- Google Cloud Platform project, bucket, and service account with storage permissions
git clone https://github.com/Kaushik-Paul/Auto-AI-Agents-Creator.git
cd Auto-AI-Agents-Creatorpython3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate- Install uv
- Linux/macOS:
curl -LsSf https://astral.sh/uv/install.sh | sh
# ensure ~/.local/bin is on your PATH
export PATH="$HOME/.local/bin:$PATH"- Windows (PowerShell):
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"- Sync dependencies
uv syncpip install -r requirements.txtCreate a .env file in the project root:
# ——— OpenRouter (LLM provider via OpenAI-compatible client) ———
OPENROUTER_API_KEY=your_openrouter_key
# ——— Google Cloud Storage (used by upload_to_gcp.py) ———
GCP_PROJECT_ID=your_gcp_project_id
GCP_BUCKET_NAME=your_bucket_name
# Base64-encoded service account JSON (e.g. cat service_account.json | base64 -w 0)
GCP_SERVICE_KEY=base64_encoded_service_account_jsonNotes:
- The base URL and model for OpenRouter are configured in
main/constants.py. creator.pyloads.envautomatically viapython-dotenv.
python -m main.app
# or
python main/app.pyGradio will print a local URL (e.g., http://127.0.0.1:7860). Open it in your browser.
This project leverages Microsoft Autogen (specifically, the AgentChat and Core components with gRPC runtime) for its powerful multi-agent orchestration capabilities. Here's why Autogen was chosen:
-
Flexible Agent Architecture
- Autogen's
RoutedAgentbase class and message passing system enable clean separation of concerns while allowing agents to communicate seamlessly. - The gRPC runtime provides a lightweight, language-agnostic way to manage agent lifecycles.
- Autogen's
-
Dynamic Agent Generation
- The
Creatoragent can generate and register new agent classes on the fly, enabling dynamic scaling of the agent workforce based on demand. - Each generated agent inherits from
RoutedAgent, ensuring consistent behavior while allowing for unique system prompts and personalities.
- The
-
Efficient Resource Management
- The gRPC worker pool efficiently manages agent instances, allowing for concurrent execution of multiple agents without the overhead of separate processes.
- Resources are automatically cleaned up when agents complete their tasks.
-
Extensibility
- The architecture makes it easy to add new agent types or modify existing ones by simply creating new Python classes that inherit from
RoutedAgent. - The system can be extended with custom tools and capabilities by implementing new message handlers.
- The architecture makes it easy to add new agent types or modify existing ones by simply creating new Python classes that inherit from
-
Production-Ready
- Built-in support for cancellation tokens and timeouts ensures robust operation in production environments.
- The gRPC foundation provides a solid base for distributed deployments if needed.
This implementation demonstrates how Autogen can be used to create sophisticated multi-agent systems that go beyond simple chat interfaces, enabling complex workflows and dynamic agent generation.
- Open the app in your browser.
- Paste or write a prompt describing the agents/ideas you want.
- Optionally click the example to autofill.
- Click “Run Pipeline”.
- After processing, you’ll get two signed URLs (ideas zip and agents zip) and a preview of the last generated idea.
- File:
main/constants.pyOPENROUTER_BASE_URL(default:https://openrouter.ai/api/v1)OPENROUTER_MODEL(e.g.,x-ai/grok-4-fast:free)
- File:
main/creator.py- Uses
OpenAIChatCompletionClientwith the base URL and API key from above.
- Uses
- File:
main/constants.pyTOTAL_AGENTS_CREATED_SIMULTANEOUSLYat line 3 controls how many agents are created in parallel.
- File:
main/pipeline.py- Reads the value from constants:
HOW_MANY_AGENTS = constants.TOTAL_AGENTS_CREATED_SIMULTANEOUSLY
- Reads the value from constants:
Important warnings when increasing the agent count:
- Cost & rate limits: More agents = more model calls → higher cost and potential throttling/rate limits.
- Autonomy: Agents are given a degree of freedom to act and generate content on their own. If you prefer tighter control, consider reducing the agent count and/or adjusting the system prompts (see below).
- You can adjust the system prompts to better fit your preferences:
main/creator.pylines 39–47 — Creator agent’s system messagemain/agent.pylines 30–36 — Template agent’s system message
- The app generates two downloadable archives:
- A zip file containing all generated ideas (Markdown format)
- A zip file containing the Python code for all generated agents
- Both files are uploaded to Google Cloud Storage and accessible via time-limited signed URLs
- Local temporary files are automatically cleaned up after upload
- The project is deployed here: Live Website
To deploy your own Space:
- Create a new Space (SDK: Gradio)
- Point the Space to run
python -m main.app(or equivalent) as the entry - Configure Secrets in the Space settings:
OPENROUTER_API_KEYGCP_PROJECT_ID,GCP_BUCKET_NAME,GCP_SERVICE_KEY
- Ensure the Python version is compatible with the versions in
requirements.txt.
- Missing or invalid GCP variables
- Ensure
GCP_PROJECT_ID,GCP_BUCKET_NAME, and a valid base64GCP_SERVICE_KEY(service account JSON) are set.
- Ensure
- OpenRouter authentication
- Confirm
OPENROUTER_API_KEYis present and the selectedOPENROUTER_MODELinmain/constants.pyis accessible to your account.
- Confirm
- No URLs returned
- If there were no generated files or the upload failed, signed URLs may be empty. Check logs and GCP permissions.
- Port conflicts
- The Autogen gRPC runtime uses
localhost:50051. If another service is using this port, stop it or change the address inmain/pipeline.py.
- The Autogen gRPC runtime uses
- Python: 3.10+
- Frameworks/Libraries: Microsoft Autogen (AgentChat/Core/Ext), Gradio 5, Google Cloud Storage, python-dotenv, requests, httpx
- Runtime: Autogen gRPC worker runtime (local ephemeral host)
- UI: Gradio Blocks with progress and results
- Do not commit
.envor credentials. - Use least-privilege service accounts on GCP. Signed URLs are short-lived by default (10 minutes).
- Be mindful that increasing agent count increases API usage and cost.
This project is licensed under the MIT License — see the LICENSE file for details.
- Microsoft Autogen team and contributors
- Hugging Face Spaces for hosting