Skip to main content
Interface primitives enable agents to communicate through various channels - from chat interfaces to voice calls to custom UI components - providing flexible ways for users to interact with agent capabilities.

Overview

The Interface primitive provides the building blocks for creating rich, interactive user experiences with agents. Whether you’re building a chat application, voice assistant, embedded widget, or custom dashboard, interfaces make agent capabilities accessible through the channels your users prefer. Interfaces are essential for:
  • Multi-Channel Communication: Deploy agents across chat, voice, email, and more
  • Custom UI Components: Build branded agent experiences
  • Real-Time Interaction: Stream responses and provide instant feedback
  • Rich Media: Support images, files, buttons, and interactive elements
  • Accessibility: Ensure agents work across devices and abilities
  • White-Label Solutions: Customize interface to match your brand

Chat Interface

Rich chat experiences with streaming, typing indicators, and media

Voice Interface

Voice-based interactions with speech-to-text and text-to-speech

Widget Embed

Embeddable components for websites and applications

Custom UI

Full control over design and user experience

How Interfaces Work

When you implement an interface:
  1. Channel Selection: Choose communication channel (chat, voice, email, etc.)
  2. UI Components: Configure interactive elements and styling
  3. Message Handling: Process user inputs and route to agents
  4. Response Rendering: Display agent responses with appropriate formatting
  5. State Management: Maintain conversation state and context
  6. Event Handling: React to user actions and system events
Streaming Support: All interfaces support real-time response streaming for immediate user feedback.

Interface Types

Chat Interface

Voice Interface

Email Interface

Custom Widget

Code Examples

Basic Chat Interface

Streaming Chat Responses

Embeddable Chat Widget

Voice Interface

Email Interface

Rich Interactive Messages

Custom React Component

Multi-Channel Interface

Use Cases

1. Customer Support Chat

Build comprehensive support chat:

2. Sales Assistant

Interactive sales chat:

3. Voice Assistant

Phone support with voice:

4. Email Automation

Automated email responses:

5. In-App Assistant

Contextual help within application:

6. WhatsApp Business

WhatsApp integration:

Best Practices

User Experience

Performance

Optimize Loading: Lazy load interface components and cache static assets for faster performance.

Security

Sanitize User Input: Always sanitize and validate user inputs to prevent XSS and injection attacks.

Integration with Other Primitives

With Memory

Maintain conversation context:
Learn more: Memory Primitive

With Skills

Apply specialized skills:
Learn more: Skills Primitive

With Authentication

Secure interfaces:
Learn more: Authentication Primitive

Performance Considerations

Response Times

  • Text Chat: < 100ms to first token
  • Voice: < 200ms to speech start
  • Email: < 1s for simple responses
  • Streaming: 20-50 tokens/second

Scalability

  • Concurrent Users: Thousands per interface
  • Message Throughput: Millions per day
  • Global Distribution: CDN-cached widgets

Troubleshooting

Problem: Chat widget doesn’t appearSolutions:
  • Check widget script is loaded
  • Verify interfaceId is correct
  • Check for JavaScript console errors
  • Ensure no CSP blocking
  • Verify domain is whitelisted
Problem: User messages fail to sendSolutions:
  • Check network connectivity
  • Verify session is active
  • Check rate limits
  • Review authentication
  • Inspect browser console
Problem: Responses not streaming smoothlySolutions:
  • Check network connection quality
  • Verify streaming is enabled
  • Reduce chunk size
  • Check for proxy/firewall issues
  • Use WebSocket instead of SSE

Voice

Advanced voice capabilities

Memory

Conversation context and history

Authentication

Secure user access

Email

Email-based interactions

Additional Resources

API Reference

Complete interface API docs

UI Components

Pre-built UI component library

Design Guide

Interface design best practices
Pro Tip: Start with the pre-built chat widget for quick deployment, then customize the UI as your needs evolve. The widget provides a production-ready experience out of the box.