> For the complete documentation index, see [llms.txt](https://docs.amigo.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amigo.ai/developer-guide/classic-api/core-api/conversations.md).

# Conversations

The Conversations API is the core interface for managing AI-powered interactions on 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 the AI.

## API Endpoints

### Conversation Management

* [**Create**](/developer-guide/classic-api/core-api/conversations/conversations-create.md): initialize new conversations with agents; the endpoint contract is embedded on the reference page
* [**Starters**](/developer-guide/classic-api/core-api/conversations/conversations-starters.md): generate contextual conversation starters
* [**Interact**](/developer-guide/classic-api/core-api/conversations/conversations-interact.md): send messages and receive AI responses through the embedded endpoint contract
* [**Events**](/developer-guide/classic-api/core-api/conversations/conversations-events.md): events are delivered as the NDJSON stream returned by the Create and Interact endpoints
* [**Lifecycle & Finish**](/developer-guide/classic-api/core-api/conversations/conversations-lifecycle.md): manage conversation states and completion
* [**Voice**](/developer-guide/classic-api/core-api/conversations/conversations-voice.md): text-channel voice uses the Interact endpoint with `request_format=voice` rather than a separate `/voice` path
* [**Real-time Voice (WebSocket)**](/developer-guide/classic-api/core-api/conversations/conversations-realtime.md): bidirectional voice transport documented separately because WebSocket routes are not represented in the HTTP OpenAPI schema
* [**External Events & Multi-Stream (WebSocket)**](/developer-guide/classic-api/core-api/conversations/conversations-realtime-external-events.md): interleave external events with user text and audio on a single WebSocket connection
* [**Conversation History**](/developer-guide/classic-api/core-api/conversations/conversation-history.md): retrieve conversations, messages, tags, and interaction insights

## Key Features

* **Contextual Memory**: conversations keep context across multiple interactions.
* **Multi-modal Support**: text, voice, and structured data inputs.
* **Real-time Streaming**: NDJSON event streams 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**: voice-to-text and text-to-voice.
* **Automatic Audio Fillers**: handles perceived latency during voice interactions.

## 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

```javascript
// Create a new conversation (the acting user is identified via the JWT)
const events = await amigo.conversations.createConversation(
  { service_id: "<SERVICE-ID>", service_version_set_name: "release" },
  { response_format: "text" }
);

// Events are delivered as the NDJSON stream returned by create/interact.
// Iterate the stream rather than subscribing to a separate events endpoint.
let conversationId;
for await (const event of events) {
  if (event.type === "conversation-created") {
    conversationId = event.conversation_id;
  }
  if (event.type === "new-message") {
    console.log("New message:", event.message);
  }
}

// Send a message and iterate the returned event stream until interaction-complete
const interactEvents = await amigo.conversations.interactWithConversation(
  conversationId,
  "Hello, I need help with my order",
  { request_format: "text", response_format: "text" }
);

for await (const event of interactEvents) {
  if (event.type === "new-message") {
    console.log("New message:", event.message);
  }
}
```

## Related Documentation

* [Authentication](/developer-guide/getting-started/authentication.md)
* [SDK Reference](/developer-guide/classic-api/sdks.md)
* [Conversation History](/developer-guide/classic-api/core-api/conversations/conversation-history.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.amigo.ai/developer-guide/classic-api/core-api/conversations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
