{"id":50819418,"url":"https://github.com/fcn06/swarm_factory","last_synced_at":"2026-06-13T12:32:02.896Z","repository":{"id":324857153,"uuid":"1098548783","full_name":"fcn06/swarm_factory","owner":"fcn06","description":"SDK to programmatically launches a complete multi-agent system (Planner, Executor, Specialist) in Rust, showcasing dynamic orchestration. It's the blueprint for building scalable, self-correcting AI workflows.","archived":false,"fork":false,"pushed_at":"2026-02-06T13:52:18.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-06T21:29:57.050Z","etag":null,"topics":["agent-factory","ai","ai-agents-sdk","discovery-service","evaluation-service","llm","memory-service","multi-agent-system","orchestration","rust","swarm-framework"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fcn06.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-17T20:50:02.000Z","updated_at":"2026-02-06T13:52:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/fcn06/swarm_factory","commit_stats":null,"previous_names":["fcn06/swarm_factory"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fcn06/swarm_factory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcn06%2Fswarm_factory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcn06%2Fswarm_factory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcn06%2Fswarm_factory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcn06%2Fswarm_factory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fcn06","download_url":"https://codeload.github.com/fcn06/swarm_factory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcn06%2Fswarm_factory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34285190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-factory","ai","ai-agents-sdk","discovery-service","evaluation-service","llm","memory-service","multi-agent-system","orchestration","rust","swarm-framework"],"created_at":"2026-06-13T12:32:02.218Z","updated_at":"2026-06-13T12:32:02.891Z","avatar_url":"https://github.com/fcn06.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Swarm Factory DEMO: End-to-End Multi-Agent System Bootstrapper 🚀\n\n\u003e This repository serves as an **end-to-end demonstration and quickstart guide** for launching a complete, functional multi-agent ecosystem using the Swarm framework. It showcases how to leverage the `AgentFactory` to programmatically instantiate, configure, and connect various Swarm components and agents, providing a robust reference for building dynamic and adaptive AI solutions.\n\n## ✨ Quickstart: Launch Your Complete Swarm Ecosystem in Minutes!\n\nThis demo provides a streamlined way to experience the full power of Swarm. You'll launch the foundational services, register capabilities, and then dynamically instantiate the core agents (Specialist, Planner, Executor) that form a collaborative multi-agent system.\n\n### Prerequisites\n\n1.  **Install Rust**: If you don't have it already, download and install it from [rust-lang.org](https://www.rust-lang.org/tools/install).\n2.  **Get an LLM API Key**: Swarm agents require an LLM to function. We recommend obtaining a free API key from [Groq](https://console.groq.com/keys) or [Google AI Studio (for Gemini)](https://aistudio.google.com/app/apikey). It can also connect to a local `llama.cpp` OpenAI-compatible server instance.\n\n### Step 1: Launch the MCP Server\n\nBefore running `swarm_factory`, you need to kickstart an MCP (Model Context Protocol) server. You can use the example server provided in the main `swarm` repository:\n\n```bash\ngit clone https://github.com/fcn06/swarm.git\ncd swarm\ncargo build --release --example main-server\n./target/release/examples/main-server --port 8000 --log-level \"warn\" all \u0026\ncd ..\n```\n\n### Step 2: Set Your LLM API Keys\n\nThe `swarm_factory` demo utilizes LLMs for various agent roles. For simplicity, you can use the *same* API key for all roles.\n\n```bash\n# Replace \u003cYOUR-LLM-API-KEY\u003e with your actual API key.\nexport LLM_A2A_API_KEY=\u003cYOUR-LLM-API-KEY\u003e       # For general Agent-to-Agent communication\nexport LLM_PLANNER_API_KEY=\u003cYOUR-LLM-API-KEY\u003e     # For the Planner Agent\nexport LLM_JUDGE_API_KEY=\u003cYOUR-LLM-API-KEY\u003e     # For the LLM-as-a-Judge evaluation service\n```\n\n### Step 3: Clone and Build `swarm_factory`\n\n```bash\ngit clone https://github.com/fcn06/swarm_factory.git\ncd swarm_factory\ncargo build --release\n```\n\n### Step 4: Run the `swarm_factory` Demo!\n\nExecute the compiled binary. This will start the core Swarm Services (Discovery, Memory, Evaluation) and then dynamically launch the Specialist, Executor, and Planner agents via the `AgentFactory`.\n\n```bash\n./target/release/swarm_factory --log-level \"warn\"\n```\n\nYou will see output logs indicating the successful setup of services, registration of tasks/tools, and the launch of `Basic_Agent`, `Executor_Agent`, and `Planner_Agent`.\n\n### Step 5: Interact with Your Swarm!\n\nOnce the agents are launched, you can interact with them using a simple A2A client. There is one available in the main `swarm` repository. Here's a sample call using this client to query your newly launched Swarm:\n\n```bash\n# Make sure you are in the 'swarm' directory, not 'swarm_factory'\ncd ../swarm \n./target/release/simple_workflow_agent_client --port 9590 --log-level \"warn\" --generation-type \"dynamic_generation\" --user-query \"Who is Vivaldi ?\"\n```\n\n## 🛠️ How This Demo Works: An Architectural Deep Dive\n\nThis `swarm_factory` project serves as a comprehensive blueprint for dynamic multi-agent system creation, showcasing the seamless integration of all critical Swarm components. It demonstrates the capabilities provided by both `swarm_commons` and `swarm_services` as part of a complete system.\n\n### What Does This Demo Do?\n\nThis reference implementation demonstrates how to use the `swarm` crate to build an agentic ecosystem by:\n\n*   **Launching Core Swarm Services:** Setting up the essential `Discovery Service`, `Memory Service`, and `Evaluation Service` (provided by `swarm_services`).\n*   **Creating and Launching an `AgentFactory`:** The central component for programmatic agent instantiation.\n*   **Dynamically Launching Agents:** Using the `AgentFactory` to create a `Domain Specialist` (`Basic_Agent`), `Planner Agent`, and `Executor Agent`.\n\nThis project bootstraps a minimal, self-contained multi-agent system where the `Planner Agent` can leverage the `Specialist Agent` (via the `Executor Agent`) to handle user requests, all facilitated by the underlying Swarm services.\n\n### Key Architectural Demonstrations\n\nThe `main.rs` in `swarm_factory` provides a clear example of the integration points:\n\n1.  **Central Services Initialization (`swarm_services`)**\n    The code first instantiates and configures the essential Swarm Services that enable collaboration and feedback, which are provided by the `swarm_services` project:\n\n    *   **Discovery Service:** Allows agents to find and register themselves, their capabilities (Domain Agents), and the available external services (Tasks, Tools).\n    *   **Memory Service:** (Set up but configurable for active use) Essential for maintaining conversational and contextual history.\n    *   **Evaluation Service (LLM as a Judge):** (Set up) Provides a feedback loop for performance assessment and dynamic workflow refinement.\n\n2.  **Capability Registration (via `swarm_commons` and `swarm_services`)**\n    Before launching the `Planner Agent`, the demo registers Tasks and Tools with the `Discovery Service`. This step is crucial, as it provides the `Planner Agent` with the knowledge base needed to generate an intelligent workflow plan. The models and configurations for these capabilities often reside in `swarm_commons`.\n\n    ```rust\n    register_tasks(discovery_service.clone()).await?; // Register the 'greeting' task\n    register_tools(args.mcp_config_path.clone(),discovery_service.clone()).await?; // Register external tools\n    ```\n\n3.  **Dynamic Agent Instantiation via `AgentFactory` (from `swarm`)**\n    The heart of the demo is the programmatic launch of specialized agents using configurations defined at runtime. This process uses core agent logic and models defined in `swarm_commons` and orchestrated by `swarm` itself:\n\n    *   **Specialist with MCP:** The `Basic_Agent` is launched with an associated `FactoryMcpRuntimeConfig`, connecting it to the external world through the Model Context Protocol (MCP).\n\n    *   **Orchestrators:** The `Executor_Agent` and `Planner_Agent` are launched and specifically configured to be aware of each other (e.g., the Planner knows the Executor's URL), forming the core orchestration layer.\n\n    ```rust\n    // Launch Basic Agent (Specialist with MCP)\n    agent_factory.launch_agent(\u0026factory_agent_config, Some(\u0026factory_mcp_runtime_config), AgentType::Specialist).await\n    // ...\n    // Launch Executor and Planner\n    agent_factory.launch_agent(\u0026factory_agent_config_executor, None, AgentType::Executor).await\n    agent_factory.launch_agent(\u0026factory_agent_config_planner, None, AgentType::Planner).await\n    ```\n\n## 📚 Learn More\n\nThis factory implementation is built upon the robust multi-agent primitives provided by the main Swarm repositories:\n\n*   **Swarm Framework:** [https://github.com/fcn06/swarm](https://github.com/fcn06/swarm) - Dive into the core components, protocols (MCP, A2A), and agent architecture.\n*   **Swarm Commons:** [./codebase/swarm_commons/README.md](./codebase/swarm_commons/README.md) - Understand the foundational traits, models, configurations, and LLM integrations shared across Swarm.\n*   **Swarm Services:** [./codebase/swarm_services/README.md](./codebase/swarm_services/README.md) - Explore the core infrastructure services for agent discovery, memory, and evaluation.\n\nIf you have any questions or ideas for extending this demo, please open an issue on the main Swarm repository!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcn06%2Fswarm_factory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffcn06%2Fswarm_factory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcn06%2Fswarm_factory/lists"}