Skip to main content

What are Channels?

Channels are the communication surfaces through which agents receive work and send responses. They abstract away the specifics of different messaging systems, allowing the same agent to work across CLI, Slack, Discord, and more. In Kubernetes terms, channels are like Services—they define how work reaches your agents.

Channel Architecture

Supported Channels

Terminal

Interactive command-line interface with styled output

TUI

Beautiful terminal UI with Bubble Tea

Slack

Full Slack integration with thread support

API

REST API for programmatic access

Channel Interface

All channels implement a common interface:

Message Structure

Messages flow bidirectionally through channels:

Metadata Examples

Different channels attach different metadata:

Terminal Channel

The default interactive experience:
Features:
  • Styled output with colors and formatting
  • Real-time streaming of responses
  • Tool execution visualization with box drawing
  • Command history
  • Multi-line input support

Simple Mode

For basic terminals without advanced features:

TUI Channel

Rich terminal UI built with Bubble Tea:
Features:
  • Syntax highlighting for code
  • Scrollable message history
  • Progress indicators
  • Keyboard shortcuts
  • Split-pane view

Slack Channel

Full-featured Slack bot integration:

Setup Requirements

  1. Create a Slack app at api.slack.com
  2. Enable Socket Mode
  3. Add bot scopes: chat:write, app_mentions:read, channels:history
  4. Install to workspace
  5. Set environment variables:

Thread Support

klaw automatically handles Slack threads:
  • Messages in threads get their own conversation context
  • Main channel messages start new conversations
  • @mention the bot to engage it

Example Interaction

API Channel

REST API for programmatic access:

Endpoints

Example Request

Streaming Response

Response (SSE):

Channel Bindings

Connect channels to namespaces in distributed mode:
Apply with:

Streaming

All channels support real-time streaming:

Custom Channels

Implement the Channel interface to add custom channels:

Best Practices

In Slack and similar platforms, leverage threading to maintain separate conversation contexts.
Streaming responses show progress and reduce perceived latency.
Always use authentication for API channels in production.
In Slack, limit bot access to specific channels to prevent noise.

Next Steps

Orchestrator

Learn how messages are routed to agents

Slack Integration

Complete Slack setup guide