Skip to content

Extending the framework

AgentSquad is protocol-first: nearly every moving part is an interface with a built-in conformance you can swap out. If a built-in doesn’t fit, implement the protocol and pass your type in — nothing else changes.

Each area has an Overview (the protocol), one or more Built-in pages, and a Custom page with a worked, compile-ready implementation.

You want to customizeProtocolBuilt-in(s)Custom example
An agent (own model loop, rules, API)AgentProtocolAgent, GroundedAgentCustom agent
Routing between agentsClassifierLLMClassifierCustom classifier
Tools from any sourceToolProviderMCP, native SwiftCustom tool provider
A different MCP SDKMCPClientSDKMCPClientCustom client
An LLM connector (non-OpenAI API)LLMClientChatCompletionsClientCustom connector
The HTTP layer under the OpenAI clientChatCompletionsTransportURLSession defaultCustom connector
Chat persistenceChatStorageIn-memory, File, DeviceCustom store
Where traces goTracerOSLogTracer, ProcessingTracerCustom tracing
Span exportTraceExporterOTLPExporterCustom tracing
Span batching/processingSpanProcessorBatchSpanProcessorCustom tracing
Redacting trace dataRedactordefaultCustom tracing
Shaping tool output for the presenterToolOutputCuratorDataBlock/PerTool curatorsCustom curator
The realtime voice socketRealtimeTransportWebSocket transportCustom transport
Audio capture / playbackAudioInput / AudioOutputMicCapture, AudioPlaybackCustom audio

All three runtimes follow the same contract: implement the protocol, hand the instance to the type that consumes it (the Orchestrator, an agent, or a voice assistant), and the framework treats your type exactly like a built-in. Protocols are Sendable (often Actor-bound) so your conformance must honor the declared concurrency — match the async/throws/isolation annotations in the source.