guides/channels
Channels
Channels are the I/O layer that connects users to agents. Each agent runs exactly one channel, configured via spec.channel in the Agent CRD (or CORAIL_CHANNEL env var).
Available channels
| Channel | Value | Protocol | Use case |
|---|---|---|---|
| REST | rest | HTTP + SSE | Dashboard chat, API integrations |
| Discord | discord | Discord Gateway | Team chat, community support |
REST (default)
The REST channel starts a FastAPI server on port 8000 with SSE streaming. This is what the Récif dashboard connects to.
No additional configuration is needed — it works out of the box with helm install.
Discord
The Discord channel connects your agent to a Discord server as a bot. Users interact via slash commands, and the agent streams responses by editing its message in real-time.
Step 1: Create a Discord Bot
- Go to the Discord Developer Portal
- Click New Application, give it a name (e.g. "Récif Agent") → Create
- In the left sidebar, click Bot:
- Click Reset Token → confirm → copy the token (you'll need it in Step 2)
- Scroll down to Privileged Gateway Intents → enable Message Content Intent
- Click Save Changes
- In the left sidebar, click OAuth2, then click URL Generator (sub-item below OAuth2):
- Under Scopes, check
botandapplications.commands - Under Bot Permissions, check
Send Messages,Read Message History,View Channels,Embed Links - At the bottom of the page, copy the Generated URL
- Open that URL in your browser → select your server → click Authorize
- Under Scopes, check
Can't find URL Generator? It's a sub-item in the left sidebar under OAuth2 — look for "OAuth2 > URL Generator". If you only see "OAuth2 > General", scroll down in the sidebar.
Step 2: Store the token as a Kubernetes Secret
kubectl create secret generic discord-bot -n team-default \
--from-literal=DISCORD_BOT_TOKEN=<your-bot-token>Step 3: Create the Agent
apiVersion: agents.recif.dev/v1
kind: Agent
metadata:
name: my-discord-agent
namespace: team-default
spec:
name: "My Discord Agent"
framework: corail
channel: discord
strategy: agent-react
modelType: ollama
modelId: "qwen3.5:35b"
systemPrompt: |
You are a helpful assistant on Discord.
Keep responses concise (under 1500 chars when possible).
envSecrets:
- agent-env
- discord-bot
image: "ghcr.io/recif-platform/corail:v0.2.0"
replicas: 1kubectl apply -f my-discord-agent.yamlStep 4: Use it
In any channel on your Discord server, type:
/chat message:Hello, what can you do?The bot acknowledges immediately, then streams the response by editing its message as tokens arrive.
Available slash commands
| Command | Description |
|---|---|
/chat message:<text> | Send a message to the agent |
/clear | Clear your conversation history |
/status | Show agent model, strategy, and storage info |
Guild-specific command sync
By default, slash commands sync globally (up to 1 hour). For instant registration on a specific server, add DISCORD_GUILD_ID to your secret:
kubectl patch secret discord-bot -n team-default --type=merge \
-p '{"stringData":{"DISCORD_GUILD_ID":"123456789012345678"}}'Replace the value with your Discord server (guild) ID. Restart the agent pod to apply.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Bot appears offline | Pod is crashing | kubectl logs -n team-default deploy/my-discord-agent |
/chat doesn't appear | Commands still syncing | Wait up to 1 hour, or set DISCORD_GUILD_ID for instant sync |
| Bot says "Something went wrong" | Pipeline error | Check pod logs for the full traceback |
| "DISCORD_BOT_TOKEN env var not set" | Secret not mounted | Verify envSecrets includes discord-bot in the Agent CRD |
| Response truncated | Discord 2000 char limit | Keep responses concise; long answers are clipped at 2000 chars |