Skip to main content
Version: 2.0

Chat APIs Overview

This topic is in-progress

Vectara's Chat APIs provide a streamlined solution for integrating chatbot functionalities into domain-specific applications and websites using Retrieval Augmented Generation (RAG). Designed with efficiency in mind, these Chat APIs enable developers to create interactive user experiences and manage data conversations for users. Each chat session is assigned a unique chat_id, allowing developers to track and manage conversations over time.

These Chat APIs enable operations and pagination through the history of a chat, specifically the conversations and their subsequent exchanges, also known as turns. Administrators can gain valuable insights into user behavior by analyzing trends among users, which creates opportunities to identify knowledge gaps for information about products, technical documentation, and FAQs.

Vectara Chat provides the following Chat APIs:

  • Create Chat contains the initial user message, search parameters, and generation settings.
  • Get Chat retrieves the chat metadata, such as the initial query and answer.
  • List Chats includes a paginated list of chats with their metadata
  • Delete Chat by their specific Chat IDs for data management and other purposes.
  • Create Chat Turn adds a new turn to an existing chat.
  • List Chat Turns returns a list of turns within a chat.
  • Delete Chat Turns from a conversation starting from a specific Turn ID to manage the content of conversations.
  • Update Chat Turn modifies a specific turn within a chat.

Chat Object

The chat object represents a chat session. A unique id is generated at the initiation of the chat session, which serves as the identifier for all subsequent turns within this conversation. Vectara stores conversations in a single chat history corpus in the customer account.

Each chat contains the following properties:

{
"id": "cht_.+$",
"first_query": "string",
"first_answer": "string",
"enabled": true,
"created_at": "string"
}

Turn Object

Each conversation has a series of turn objects, which are the sequence of message and response pairs that make up the dialog. Each turn represents a question/answer pair between the user and the chatbot and has a unique id that specifies its chat_id.

"turn": [
{
"id": "ID of the turn",
"chat_id": "ID of the conversation",
"query": "First query of the turn",
"answer": "First answer of the turn",
"enabled": true,
"created_at": "string"
},
{
"id": "ID of the second turn",
"chat_id": "ID of the conversation",
"query": "Second query of the turn",
"answer": "Second answer of the turn",
"enabled": true,
"created_at": "string"
},
// Additional turn IDs are created for each query and answer pair in the conversation
]