v0.2.0· Apache 2.0

Search docs...

guides/channels

4 min read

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

ChannelValueProtocolUse case
RESTrestHTTP + SSEDashboard chat, API integrations
DiscorddiscordDiscord GatewayTeam 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

  1. Go to the Discord Developer Portal
  2. Click New Application, give it a name (e.g. "Récif Agent") → Create
  3. 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
  4. In the left sidebar, click OAuth2, then click URL Generator (sub-item below OAuth2):
    • Under Scopes, check bot and applications.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

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: 1
kubectl apply -f my-discord-agent.yaml

Step 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

CommandDescription
/chat message:<text>Send a message to the agent
/clearClear your conversation history
/statusShow 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

SymptomCauseFix
Bot appears offlinePod is crashingkubectl logs -n team-default deploy/my-discord-agent
/chat doesn't appearCommands still syncingWait up to 1 hour, or set DISCORD_GUILD_ID for instant sync
Bot says "Something went wrong"Pipeline errorCheck pod logs for the full traceback
"DISCORD_BOT_TOKEN env var not set"Secret not mountedVerify envSecrets includes discord-bot in the Agent CRD
Response truncatedDiscord 2000 char limitKeep responses concise; long answers are clipped at 2000 chars