asmith1516
10/19/2025, 12:58 PMAI Evy
10/19/2025, 12:58 PMAI Evy
10/19/2025, 12:58 PMcreate-chat-completion API endpoint [(1) ]() . Here's the exact code:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const response = await client.chat.createChatCompletion({
chat_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
content: 'hi how are you doing?',
}) ;
console.log(response.messages) ;
## For Knowledge Base Integration
To inject context from external sources like Supabase, you can use Retell's Knowledge Base feature [(2) ]() . Knowledge bases allow you to provide additional context that your agent can access during conversations . You can create knowledge bases using URLs, documents, and custom text snippets .
The system will automatically retrieve relevant information from the knowledge base during conversations and feed it to the LLM as context .
## For Custom Function Integration
For dynamic integration with external systems like Supabase, you can use custom functions [(3) ]() . The integration process involves creating webhook endpoints that can process incoming requests, verify authenticity, extract parameters, perform database queries, and return results in JSON format .
To connect with Supabase specifically, you would need to set up custom functions that can query your Supabase database and return the relevant context to your Retell AI agent.AI Evy
10/19/2025, 12:58 PMAI Evy
10/19/2025, 12:58 PM