Agent class follow the same structure as the OpenAI Agents SDK Agent. However, there are a few advanced parameters that require more explanation.
Parallel Tool Calls
Controls whether tools execute in parallel or sequentially for a given agent.one_call_at_a_time = True in the tool’s ToolConfig. See Advanced Tool Configuration.
File Search
If yourfiles_folder ends with _vs_<vector_store_id>, Agency Swarm automatically associates files with that Vector Store and adds FileSearchTool to the Agent. The include_search_results behavior can be toggled via the Agent’s include_search_results flag.
Web Search Sources
include_web_search_sources=True (default), WebSearchTool calls include source URLs.
Set include_web_search_sources=False to skip this.
System Reminders
Usesystem_reminders when you want the agent to see a short reminder at a supported trigger, without writing hooks.
EveryNToolCalls counts local function tools and hosted tools (such as WebSearchTool and FileSearchTool) separately for each agent within one logical run. A logical run starts with a user request to an agency or a direct call to Runner imported from agency_swarm. Handoffs and resumed interruptions stay in that run. The count resets when the run completes, fails, or is cancelled.
For each configured EveryNToolCalls, if parallel tool calls cross several of its thresholds before the next model call, Agency Swarm produces exactly one reminder for that model call. It keeps the modulo remainder—the calls left after dividing by n—toward the next threshold.
If the reminder needs agency context, pass a callable:
Use
system_reminders for normal reminders. Use hooks only when you need custom lifecycle behavior beyond these built-in triggers.The reminder boundary lives on
agency_swarm.Runner — import Runner from agency_swarm, not agents, when you run an agent directly. It keeps reminders out of saved history just like an Agency does. Calling agents.Runner directly gives you stock SDK behavior with no reminder handling.run_state_to_json and restore it with run_state_from_json:
RunState.to_json() / RunState.from_json(). The plain SDK methods drop the reminder state, so reminder counts restart on resume.
Conversation starters cache
Conversation starters are the suggested prompts you see in the chat UI. When enabled, cache can instantly replay the first reply without calling the LLM.- The UI shows the starter prompt “Support: I need help with billing”.
- The FastAPI
/get_metadataresponse exposes starters asconversationStarters. - With
cache_conversation_starters=True, the first plain-text user message can replay a saved reply when it exactly matches a configured starter.
Streaming the cached reply includes events for text, tool calls, reasoning, and handoffs.
additional_instructions, context_override, or hooks_override skip replay and call the LLM.
Cache files live under
AGENCY_SWARM_CHATS_DIR (defaults to .agency_swarm) in starter_cache/.
In production, point AGENCY_SWARM_CHATS_DIR at persistent storage to keep instant replies across restarts.Output Validation
Useoutput_guardrails on the Agent to validate outputs. See the detailed guide: Guardrails.
Few‑Shot Examples
You can include few‑shot examples ininstructions as plain text or pass message history to get_response / get_response_stream.