Channels
Channels are adapters that connect an agent to an external messaging platform. When a message arrives on a channel, the adapter normalizes it into the standard inference request format and dispatches it through the same execution pipeline as a direct API call. When the agent responds, the adapter routes the answer back to the originating platform.
Supported channels
Section titled “Supported channels”Alquimia Platform ships adapters for:
| Channel | Best for |
|---|---|
| Customer support, field service, mobile-first users | |
| Kapso WhatsApp | WhatsApp access managed through the Kapso platform |
| Slack | Internal helpdesks, slash commands, team collaboration |
| Ticket-style workflows, formal approvals, document intake | |
| Twilio Media Stream | Real-time phone calls and WebRTC voice streams |
| LiveKit Media Stream | In-process LiveKit WebRTC audio rooms |
| LiveKit Agent Worker | Runtime-bridged LiveKit rooms for auditability |
| Browser Media Stream | Browser-native live audio over WebSocket (no Twilio required) |
A single agent can have multiple channels. For example, a support agent might accept WhatsApp messages from customers and Slack messages from employees, using the same configuration and memory.
How channels work
Section titled “How channels work”flowchart LR ext_in["External platform"] hook["Webhook / poll endpoint"] adapter_in["Channel adapter"] pipe["Execution pipeline"] adapter_out["Channel adapter"] ext_out["External platform"] ext_in --> hook --> adapter_in -->|"normalized inference request"| pipe pipe -->|"final response"| adapter_out --> ext_out
The adapter handles three concerns:
- Ingestion — parse the provider-specific payload and extract the message, sender, attachments, and metadata.
- Authentication — verify the request using the provider’s mechanism, such as a verify token or HMAC signature.
- Response — format and deliver the agent’s answer back to the sender.
Normalization
Section titled “Normalization”Every channel produces the same internal request shape. This means:
- An agent does not need to know whether a message came from WhatsApp or Email.
- Tools and memory behave the same regardless of channel.
- Adding a new channel does not require changing the agent’s core logic.
Sender identifiers are mapped to stable user and session identifiers so conversation history persists across messages from the same source.
Channel-bound approvals
Section titled “Channel-bound approvals”For tools that require human approval, the runtime can route the approval request back through the same channel the original message arrived on. This keeps the approval experience in the user’s native messaging app instead of forcing them to visit a separate web interface.
The flow works like this:
- A user sends a message on WhatsApp.
- The agent calls a tool that requires approval.
- The runtime asks the tool provider for the approval message text.
- The approval message is sent back to the user on WhatsApp.
- The user replies with approval or rejection.
- The runtime resumes the agent execution and sends the final answer.
Voice and audio messages
Section titled “Voice and audio messages”Agents can accept and produce audio on supported channels. TTS connectors support output_format control (wav or mp3), MP3 is decoded via miniaudio, and OpenAI TTS defaults to the gpt-4o-mini-tts model and alloy voice. WhatsApp and Kapso voice notes are ingested as audio blobs, transcribed by a speech-to-text (STT) connector, and fed into the same inference pipeline as text messages. When the agent’s output modality includes audio, a text-to-speech (TTS) connector synthesizes the reply and the channel delivers it back as a voice message.
Audio behavior is declared with the top-level audio field on the agent spec:
{ "audio": { "stt": { "provider_id": "deepgram", "api_key": { "$secretRef": "STT_PROVIDER_API_KEY" } }, "tts": { "provider_id": "openai/tts", "model": "gpt-4o-mini-tts", "voice": "alloy", "output_format": "mp3", "api_key": { "$secretRef": "TTS_PROVIDER_API_KEY" } }, "input_modalities": ["text", "audio"], "output_modalities": ["text", "audio"] }}If audio is omitted, the agent is text-only and existing channel behavior is unchanged.
Audio blob hydration
Section titled “Audio blob hydration”Audio inputs received by request/response channels — such as WhatsApp or Kapso voice notes — can be passed by blob_id reference. Before transcription, the runtime loads the blob bytes from the configured file-storage provider. Missing or empty blobs now produce explicit errors instead of silent failures or empty transcripts.
Streaming audio channels
Section titled “Streaming audio channels”Request/response channels such as WhatsApp and Email handle discrete messages. Streaming channels keep a bidirectional audio session open for the lifetime of a phone or WebRTC call. The concrete transport (for example, twilio-media-stream) decodes its wire format into PCM AudioFrame instances and delegates VAD-based turn segmentation and per-utterance inference to the shared helpers in alquimia.core.streaming_channel.
Streaming channels are configured separately from request/response channels in streaming_channels:
{ "streaming_channels": [ { "provider_id": "twilio-media-stream", "channel_id": "twilio-phone", "account_sid": { "$secretRef": "TWILIO_ACCOUNT_SID" }, "auth_token": { "$secretRef": "TWILIO_AUTH_TOKEN" }, "greeting": { "mode": "static", "text": "Hello, this is the support line. How can I help you today?" }, "call_policy": { "max_turns": 10, "max_duration_s": 600, "idle_timeout_s": 30 }, "vad": { "barge_in": true } }, { "provider_id": "livekit-media-stream", "channel_id": "livekit-room", "api_key": { "$secretRef": "LIVEKIT_API_KEY" }, "api_secret": { "$secretRef": "LIVEKIT_API_SECRET" }, "livekit_url": "wss://myproject.livekit.cloud", "room_name": "support-room", "input_sample_rate": 48000, "output_sample_rate": 24000 } ]}All streaming channels share optional greeting, call_policy, and vad settings. The greeting plays an opening message before the first caller utterance; call_policy enforces deterministic limits such as maximum duration, turn count, and idle timeout; and vad.barge_in controls whether the caller can interrupt a playing reply. The assistant can also end the call by returning end_session: true (for example, via the builtin_end_call tool). See the Agent specification reference for the full schema.
The livekit-media-stream provider runs the LiveKit room connection in-process inside the runtime. The adapter opens the room, provides encode/decode helpers, and exchanges PCM audio through the same streaming session pipeline as Twilio and browser streams.
The runtime also ships a separate LiveKit agent worker that connects to LiveKit as a generic agent and bridges room audio through the runtime streaming path over WS /live/livekit/{assistant_id}/{channel_id}. Unlike the in-process adapter, the worker runs as its own process and is scaled independently; when LIVEKIT_WORKER_RUNTIME_BRIDGE_ENABLED is true, every turn is persisted to the runtime worklog and published to the Redis event stream.
Browser-native live audio
Section titled “Browser-native live audio”The browser-media-stream provider lets a browser or custom client open a held-call audio session directly with the runtime. Audio is exchanged as JSON messages carrying base64-encoded PCM s16le 16 kHz mono frames, so the browser does not need to implement G.711 μ-law. The runtime applies the same VAD-based turn segmentation, inference, worklog persistence, and Redis event-stream bridging as the Twilio path. See the Agent specification reference and Runtime API overview for configuration and message format details.
Response templates
Section titled “Response templates”Each channel can define a template for formatting the agent’s response before delivery. For example, an email channel might render the answer as HTML, while a WhatsApp channel sends plain text. Templates use Jinja2 and can access platform-specific metadata such as sender name or message ID.
Choosing channels
Section titled “Choosing channels”| Need | Recommended channel |
|---|---|
| Mobile users, rich media | |
| Voice notes on WhatsApp | WhatsApp or Kapso WhatsApp |
| Internal team workflows | Slack |
| Formal requests, attachments, long-form content | |
| WhatsApp without direct Meta integration | Kapso WhatsApp |
| Real-time phone or WebRTC voice | Twilio Media Stream |
| LiveKit WebRTC audio rooms (in-process) | LiveKit Media Stream |
| LiveKit WebRTC audio rooms with runtime auditability | LiveKit Agent Worker |
| Browser-native or custom live audio | Browser Media Stream |