#I am developing a chat app that has conversational ai capabilities. I want each chat to have a sep

1 messages · Page 1 of 1 (latest)

rapid crownBOT
#
AI-generated Answer for developerprince7

Creating a new agent for each chat is a feasible solution, especially if you want each chat to have its own distinct knowledge base or context. This approach ensures that the data for each chat remains isolated and tailored to the specific user or conversation. However, there are a few considerations to keep in mind:

  1. Performance and Scalability: ElevenLabs does not impose a strict limit on the number of agents you can create, but performance may vary depending on the complexity and volume of conversations. If you plan to create a large number of agents, it’s a good idea to evaluate your subscription plan and ensure it can handle the workload effectively.

  2. Knowledge Base Size Limits: Non-enterprise users are limited to 5 files/links per agent, with a combined size of 20MB or 300,000 characters. If your chats require larger or more complex knowledge bases, you may need to consider breaking down the data into smaller segments or upgrading to an Enterprise plan for higher limits.

  3. Alternative Solutions: Instead of creating a new agent for each chat, you could use the "Agent Conversation Overrides" feature to temporarily customize the agent's knowledge base for a specific conversation. This allows you to adjust the context dynamically without permanently altering the base knowledge.

  4. Enterprise Plan: If your use case involves a high number of agents or large knowledge bases, reaching out to the sales team to discuss the Enterprise plan might be beneficial. It offers expanded capabilities and higher limits that could better suit your needs.

Creating separate agents for each chat is a clean and reliable solution, but it may require careful management of resources and limits. If you have further questions or need more guidance, feel free to ask!

restive yarrow
#

does conversation ai count silence in pricing and credits ?

rapid crownBOT
#
AI-generated Answer for developerprince7

Yes, the pricing for Conversational AI is on the entire duration of the call, from the start to the end, regardless of whether speech is generated or there is silence. This means that pauses, silence, or periods when the agent is on hold are still counted towards credit usage at the rate of 1,000 credits per minute.

If you want to manage costs, you can set custom duration limits, such as a "Turn timeout" or maximum conversation duration, to prevent unexpected charges.

restive yarrow
#

How do I use nstead of creating a new agent for each chat, you could use the "Agent Conversation Overrides" feature to temporarily customize the agent's knowledge base for a specific conversation. This allows you to adjust the context dynamically without permanently altering the base knowledge.

rapid crownBOT
#
AI-generated Answer for developerprince7

You can use the "Agent Conversation Overrides" feature to temporarily customize agent's knowledge base for a specific conversation. This feature allows you to dynamically adjust the context for a session without permanently modifying the agent's base knowledge.

To implement this, you can pass the desired overrides dynamically when starting a session. For example, you can include custom prompts, first messages, or other context-specific details directly in the API call. Here's an example:

const conversation = await Conversation.startSession({
  overrides: {
    agent: {
      prompt: {
        prompt: `The customer's bank account balance is ${customer_balance}. They are based in ${customer_location}.`
      },
      first_message: `Hi ${customer_name}, how can I help you today?`,
    },
    tts: {
      voiceId: "" // override the voice ID dynamically
    }
  },
  // other session parameters
});

This approach allows you to use a single agent and customize the experience for each conversation dynamically, bypassing the need to create separate agents or manually configure settings in the UI. Let me know if you need further clarification!

restive yarrow
#

How do we handle concurrent users problem ?

rapid crownBOT
#
AI-generated Answer for developerprince7

To handle the issue of concurrent users exceeding the request limit, ElevenLabs recommends implementing a queuing system on your end. This would allow you to manage requests effectively and avoid errors when the number of concurrent requests surpasses the allowed threshold.

If your application requires higher concurrency limits, you can explore the Enterprise Plan, which offers tailored solutions to meet specific usage needs. Unlimited concurrency is not provided, as limits are in place to maintain service quality for all users.

restive yarrow
#

How do we keep the context different for each user and each chat.

rapid crownBOT
#
AI-generated Answer for developerprince7

Currently, ElevenLabs Conversational AI does not support adding custom context per conversation directly through the web dashboard or API. However, you can enhance responses by including relevant information in the knowledge base and structuring the system prompt to cover common scenarios.

If you are using a custom interface with the SDK and need to pass user-specific context, one workaround is to convert that context into audio chunks and send them via the websocket protocol. While direct text passing before a conversation is not available, the team hopes to introduce more comprehensive options for pre-conversation context in the future.

restive yarrow
#

if we create a new agenct for each chat , using the same prompt can we keep the context seperated ?

rapid crownBOT
#
AI-generated Answer for developerprince7

Yes, you can keep the context separated for each user and chat by dynamically providing context during the session rather than creating a new agent for each chat. Using the API, you can pass specific overrides for the system prompt and first message dynamically at runtime. This allows you to maintain unique contexts for each conversation without manually configuring agents in the UI.

Here’s an example of how this can be achieved:

const conversation = await Conversation.startSession({
  overrides: {
    agent: {
      prompt: {
        prompt: `The customer's bank account balance is ${customer_balance}. They are based in ${customer_location}.`
      },
      first_message: `Hi ${customer_name}, how can I help you today?`,
    },
    tts: {
      voiceId: "" // override the voice ID dynamically
    }
  },
  ...
});

This approach ensures that the context is dynamically set for each user and chat, keeping them separate without needing to create a new agent for every session. Let me know if you need further clarification!

restive yarrow
#

the problem with this approach is concurrent users

rapid crownBOT
#
AI-generated Answer for developerprince7

The issue of handling concurrent users and maintaining separate for each user or chat can be challenging. Based on the information provided:

  1. Concurrent Users Problem: The Pro plan supports up to 10 concurrent users, but issues like cut-outs, dropped connections, or slow latency have been reported. These problems may stem from temporary issues or bugs related to speech-to-text functionality and turn-taking. Fixes have been implemented to improve the experience, so testing again is recommended. If issues persist, sharing specific details (e.g., time, agent ID) can help the team investigate further.

  2. Separate Contexts for Each User/Chat: If you create a new agent for each chat using the same prompt, it should theoretically keep the context separated for each interaction. However, this approach might lead to scalability issues when handling multiple concurrent users, as seen in your tests.

  3. Interruptions and Turn-Taking: Interruptions are supported, but speaking before the agent finishes responding can disrupt the reply and start a new one. This behavior might contribute to the concurrency issues you're experiencing.

To address these challenges:

  • Ensure that the fixes implemented by the team have resolved the concurrency and turn-taking issues by conducting additional tests.
  • If the problem persists, report the exact details (e.g., time, agent ID) to the support team for further investigation.
  • Consider optimizing your application's architecture to manage concurrent connections more effectively, possibly by queuing interactions or limiting simultaneous requests to the agent.

Let the support team know if further assistance is needed.

restive yarrow
#

is there a way to persist context between conversations ?

rapid crownBOT
#
AI-generated Answer for developerprince7

Currently, ElevenLabs Conversational AI does not support adding custom context per conversation directly through the web dashboard or API. However, you can enhance responses by including relevant information in the knowledge base and structuring the system prompt to cover common scenarios.

If you are using a custom interface with the SDK, one workaround is to convert user-specific context into audio chunks and send them via the websocket protocol. This allows you to pass context indirectly before the conversation begins. Direct text-based context passing is not available at this time, but the team hopes to introduce more comprehensive options for pre-conversation context in the future.

Let me know if you need further clarification!

restive yarrow
#

Contact support email for eleven labs

rapid crownBOT
#
AI-generated Answer for developerprince7

For assistance, you can contact ElevenLabs support submitting a request through the ticket form. Make sure to use the email associated with your ElevenLabs account for a quicker resolution.

restive yarrow
#

How to find voice id of agents

rapid crownBOT
#
AI-generated Answer for developerprince7

To find the Voice ID of a voice, you can follow these steps:

. Using the Voice Lab:

  • Navigate to the Voice Lab.
  • Select the desired voice and click the "View" button.
  • The Voice ID will be displayed at the bottom of the detail panel.
  1. Using the Voice Library:

    • Go to the Voice Library.
    • Click "View" for the voice you want to check.
    • Copy the Voice ID from the bottom of the panel on the right.
  2. Using the API:

    • Use the Get Voices endpoint to query the Voice Library and retrieve the Voice ID programmatically. You can find more details in the API References.

Let me know if you need further clarification!

restive yarrow
#

how to add chat history as context for the conversation ai agent

rapid crownBOT
#
AI-generated Answer for developerprince7

Currently, ElevenLabs Conversational AI does not support adding custom context per conversation directly through the web dashboard or API. However, you can enhance responses by including relevant information in the knowledge base and structuring your system prompt to cover common scenarios. If you have created a custom interface using the SDK, one workaround is to convert the context into audio chunks and send them via the WebSocket protocol. More comprehensive options for pre-conversation context may be introduced in the future.

restive yarrow
#

can agent continue a conversation based on knowledge base

rapid crownBOT
#
AI-generated Answer for developerprince7

Yes, an agent can continue a conversation based on its knowledge base. The knowledge base provides the context and information the agent uses to respond to queries. You can enhance the agent's responses by structuring the system prompt to guide conversations and adding relevant documents or links to the knowledge base.

If you need to customize the context for specific conversations, you can use features like "Agent Conversation Overrides" to temporarily adjust the knowledge base or system prompt for that session. However, this customization does not permanently alter the knowledge base.

restive yarrow
#

can we somehow give chat history to the agent with each new session

rapid crownBOT
#
AI-generated Answer for developerprince7

Currently, ElevenLabs Conversational AI does not support adding custom context, such as chat history, directly per conversation through the web dashboard or API. However, one workaround is to convert the chat history into audio chunks and send them via the websocket protocol. This allows you to provide context indirectly for each session.

The team is working on introducing more comprehensive options for pre-conversation context in the future.

restive yarrow
#

How to convert chat history to audio chunks

rapid crownBOT
#
AI-generated Answer for developerprince7

The provided content does not include information on how to convert chat history into audio chunks. However, you can consider the following general approach:

  1. Text-to-Speech Conversion: Use a text-to-speech API, such as ElevenLabs' Text-to-Speech API, to convert each line of chat history into audio. Specify the voice ID for each speaker to maintain consistency.

  2. Audio Chunking: Divide the generated audio into smaller segments. Ensure the audio format matches the requirements for conversational AI, such as PCM 16-bit mono, Base64 encoded, and a sample rate of 16,000 Hz. You can use tools like pydub to split audio files into chunks.

  3. Sequential Sending: Send the audio chunks in sequence to the conversational AI agent. The platform will handle pauses and silence automatically, so you don't need to add timing adjustments manually.

If you need further assistance or specific implementation details, feel free to ask!

restive yarrow
#

Can we pass chat history to knowledge base and then agent can carry on the conversation from where it was left

rapid crownBOT
#
AI-generated Answer for developerprince7

Currently, ElevenLabs Conversational AI does not support directly passing chat history as context for conversations through the web dashboard or API. However, one workaround is to convert the chat history into audio chunks and send them via the websocket protocol. This allows the agent to process the context indirectly.

Direct text-based passing of chat history before a conversation is not available at this time, but enhancing the knowledge base with relevant information or structuring the system prompt to guide conversations can help improve continuity. The team is working on introducing more comprehensive options for pre-conversation context in the future.

restive yarrow
#

What does contextual update do ?

rapid crownBOT
#
AI-generated Answer for developerprince7

Contextual updates allow you to override the agent's configuration at the start of each conversation. These updates apply only to the current session and do not persist globally. This feature enables customization for individual conversations, tailoring the agent's behavior or responses based on specific needs for that session.

restive yarrow
#

How to pass previous messages to contextual update along with prompt

rapid crownBOT
#
AI-generated Answer for developerprince7

Currently, ElevenLabs Conversational AI does not support adding custom context per conversation directly through the web dashboard or API. However, you can enhance responses by including relevant information in the knowledge base and structuring your system prompt to cover common scenarios. If you have created a custom interface using the SDK and cannot pass user-specific context directly, one workaround is to convert that context into audio chunks and send them via the WebSocket protocol.

The dynamic conversation feature allows you to override the agent's configuration at the start of each conversation, customizing the experience for each session. However, these settings apply only to the current session and won’t persist globally. If you need to update the agent settings during a session, you'll need to make a separate API call to apply the changes.

restive yarrow
#

how to add knowledgebase to agent from dashboard

rapid crownBOT
#
AI-generated Answer for developerprince7

Currently, you can add or remove items from the knowledge base using the SDK, but there is no direct option to add a knowledge base to the agent through the web dashboard. You can enhance the agent's responses by structuring the system prompt to include relevant information or uploading files to the knowledge base. For more advanced configurations, you may need to use the SDK or API.

restive yarrow
#

Does knowledge base url document automatically update if url contents are altered

rapid crownBOT
#
AI-generated Answer for developerprince7

No, Knowledge Base URL documents do not automatically update when the URL contents are altered. To refresh the information, you need to manually re-upload the updated document to the agent. This can be done by detaching the existing document and re-adding the updated one using the API. For more details, you can refer to the API documentation.

restive yarrow
#

can each agent get 5 knowledge base accounts or we have 5 knowledgebase docs in total

rapid crownBOT
#
AI-generated Answer for developerprince7

Each agent can have up to 5 knowledge base files or links, with a combined size limit of 20MB or 300,000 characters for non-enterprise users. This limit applies per agent, not across all agents in your account. If you need more flexibility, consider exploring the Enterprise plan.

restive yarrow
#

how do i update a knowledge base document from api

rapid crownBOT
#
AI-generated Answer for developerprince7

Each agent can have up to 5 knowledge base documents added to it, with a combined size limit of 20MB or 300,000 characters for non-enterprise users. This limit applies to the total number of documents per agent, not across all agents.

To update a knowledge base document via the API, follow these steps:

  1. Detach the Existing Document: Use the PATCH method to clear the agent's knowledge base by sending an empty array for the knowledge_base field. Example:

    {
      "conversation_config": {
        "agent": {
          "prompt": {
            "knowledge_base": []
          }
        }
      }
    }
    
  2. Re-upload the Updated Document: Use the POST /v1/convai/agents/{agent_id}/add-to-knowledge-base endpoint to upload the new document or URL. Ensure the file format and MIME type are correct.

  3. Re-attach the Updated Document: Use the PATCH method again to update the agent's knowledge base with the new document ID. Example:

    import requests
    
    # Set up the variables with your agent details and document info
    agent_id = '[REDACTED]'
    api_key = '[REDACTED]'
    document_id = '[REDACTED]'
    document_name = '[REDACTED]'
    
    # Define the PATCH request URL
    url = f'https://api.elevenlabs.io/v1/convai/agents/{agent_id}'
    
    # Prepare the data to update the agent's knowledge base
    data = {
        "conversation_config": {
            "agent": {
                "prompt": {
                    "knowledge_base": [{
                        "type": "file",
                        "name": document_name                       "id": document_id
                    }]
                }
            }
        }
    }
    
    # Set up the headers
    headers = {
        'Content-Type': 'application/json',
        'xi-api-key': api_key
    }
    
    # Send the PATCH request to update the agent
    response = requests.patch(url, headers=headers, json=data)
    
    # Print the response
    print(response.json())
    

This process ensures the knowledge base is updated correctly. Let me know if you need further clarification!

restive yarrow
#

i want to use text as knowledge base

rapid crownBOT
#
AI-generated Answer for developerprince7

The current limit for the knowledge base is set at 21MB or 300,000 characters, applicable to both TXT files and PDFs. You can upload text files directly as part of your knowledge base within this limit. If you need more flexibility or larger limits, you may want to explore the Enterprise plan, which could offer expanded options.

restive yarrow
#

Yeah give me the code to use it via react