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 agents

  • Interact - POST /conversations/{id}/messages - Send messages and receive AI responses

  • Events - GET /conversations/{id}/events - Stream real-time conversation events

  • Lifecycle - PATCH /conversations/{id} - Manage conversation states and completion

  • Voice - POST /conversations/{id}/voice - Enable voice interactions

  • Real-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

  1. Customer Support - Automated support conversations with context awareness

  2. Virtual Assistants - Personal AI assistants with memory and learning

  3. Interactive Workflows - Guide users through complex processes

  4. 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);
});

Last updated

Was this helpful?