OpenSwarm is designed to be forked and reshaped into any kind of specialist swarm you need. Every agent is a self-contained folder of plain files — a Python definition, a Markdown system prompt, and aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/UnkleFunk/HouseMusicSwarm-/llms.txt
Use this file to discover all available pages before exploring further.
tools/ directory. There is no framework magic to fight: renaming an agent means renaming a folder and updating two imports. This page walks through the full process of adding a new agent from scratch.
Agent folder structure
Every agent in the swarm follows the same layout:__init__.pyis a one-liner that re-exports the factory function soswarm.pycan dofrom my_agent import create_my_agent.my_agent.pyinstantiates theAgentclass with its name, description, model, and tool list.instructions.mdis the agent’s full system prompt. Editing this file is the primary lever for changing an agent’s behavior — no code changes required.tools/holds Python classes that extendBaseTool. The agent loads them at startup.
Step-by-step: creating a new agent
Create the agent folder and files
Write my_agent.py
Model your file on the pattern used throughout the codebase. Here is the actual pattern from Key field notes:
deep_research/deep_research.py:instructions="./instructions.md"— always a relative path; Agency Swarm resolves it relative to the agent filemodel=get_default_model()— readsDEFAULT_MODELfrom.env, never hardcodedmodel_settings— sets reasoning effort for OpenAI models;is_openai_provider()returnsFalsefor LiteLLM-routed models (Anthropic, Gemini), soreasoningis set toNonefor thosetools— list of tool classes (not instances, except for built-ins likeWebSearchTool())files_folder— optional directory of files the agent can reference at runtime
__init__.py:Write instructions.md
The
instructions.md file is the agent’s complete system prompt. Define:- Role — what the agent is and what it owns
- Goals — what outcomes it is optimizing for
- Process — step-by-step workflow it follows for each task type
- Output format — expected response structure
- Handoff rules — when to transfer to another specialist
Example: simple SEO agent
Here is a complete, minimal agent definition following the real Agency Swarm pattern:WebSearchTool() for live SERP lookups, or replace it with a custom AuditPage tool that wraps a crawl API. The agent’s behavior is entirely determined by instructions.md.
Popular swarm configurations
Because every agent is a folder of plain files, OpenSwarm can be reshaped into a focused specialist swarm by renaming folders, rewritinginstructions.md files, and updating swarm.py. Common patterns from AGENTS.md:
SEO Swarm
Keyword Planner + Blog Post Writer + SEO Analytics Agent + Technical SEO Agent. The Orchestrator routes by task type: research → writing → analysis → technical audit.
Sales Swarm
Lead Researcher + Outreach Writer + CRM Agent (HubSpot via Composio) + Follow-up Scheduler. Composio handles Gmail and calendar automatically.
Marketing Swarm
Campaign Strategist + Content Creator + Social Media Publisher + Analytics Reporter. Each agent owns one phase of the campaign lifecycle.
Product Swarm
PRD Writer + User Researcher + Data Analyst + Roadmap Prioritizer. Deep Research feeds evidence into the PRD; the Data Analyst validates assumptions against usage data.