Conversations
The Conversations API is the core interface for managing AI-powered interactions in the Amigo platform.
Overview
Conversations are the primary way users interact with Amigo agents. Each conversation maintains context, manages state, and handles the flow of messages between users and AI.
API Endpoints
Conversation Management
Create -
POST /conversations
- Initialize new conversations with agentsInteract -
POST /conversations/{id}/messages
- Send messages and receive AI responsesEvents -
GET /conversations/{id}/events
- Stream real-time conversation eventsLifecycle -
PATCH /conversations/{id}
- Manage conversation states and completionVoice -
POST /conversations/{id}/voice
- Enable voice interactionsReal-time Voice -
WSS /conversation/converse_realtime
- WebSocket endpoint for real-time voice conversations
Key Features
Contextual Memory - Conversations maintain context across multiple interactions
Multi-modal Support - Text, voice, and structured data inputs
Real-time Streaming - Server-sent events for live updates
WebSocket Support - Low-latency bidirectional communication for real-time voice
Voice Activity Detection - Automatic speech detection in real-time mode
State Management - Track and control conversation flow
Voice Integration - Seamless voice-to-text and text-to-voice
Common Use Cases
Customer Support - Automated support conversations with context awareness
Virtual Assistants - Personal AI assistants with memory and learning
Interactive Workflows - Guide users through complex processes
Voice Interfaces - Natural language voice interactions
Quick Start
// Create a new conversation
const conversation = await amigo.conversations.create({
agent_id: "agent_123",
user_id: "user_456"
});
// Send a message
const response = await amigo.conversations.interact(conversation.id, {
message: "Hello, I need help with my order"
});
// Listen for events
const events = amigo.conversations.events(conversation.id);
events.on('message', (data) => {
console.log('New message:', data);
});
Related Documentation
Last updated
Was this helpful?