https://retellai.com/?utm_source=discord&utm_medium=seo logo
I want to connect to a 3rd party database, how do ...
# ❓・ai-evy-support
t
@AI Evy I want to connect to a 3rd party database, how do i do this?
a
Thanks for tagging me @tin_developer. I'll look through relevant sources and get back to you shortly.
Copy code
python
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse
from retell import Retell
retell = Retell(api_key=os.environ["RETELL_API_KEY"])
@app.post("/check-weather")

async def check-weather(request: Request) :
 try:
 post_data = await request.json()
 valid_signature = retell.verify(
 json.dumps(post_data, separators=(",", ":") , ensure_ascii=False) ,
 api_key=str(os.environ["RETELL_API_KEY"]) ,
 signature=str(request.headers.get("X-Retell-Signature") ) ,
 )
 if not valid_signature:
 print(
 "Received Unauthorized",
Your custom function endpoint would handle the database connection logic and return the results to the Retell AI agent . The function result is capped at 15000 characters to prevent overloading the LLM context window .
### Answer To connect to a 3rd party database in Retell AI, you can use custom functions that integrate external APIs and systems [(1) ]() . Here's how to set it up: ## Steps to Create a Custom Function 1. Add custom function in dashboard - Click "+ Add" in the tools section and select "Custom Function" from the dropdown menu 2. Configure function details - Add a name and description for the custom function . The name should be unique and separated with underscore 3. Select HTTP Method - Choose from GET, POST, PATCH, PUT, or DELETE 4. Add endpoint URL - Add the URL where Retell will send the request to execute your custom function 5. Set request headers and query parameters (optional) - You can define custom headers and query parameters to include with the request 6. Define parameters - Define the parameters using JSON schema format ## Example Implementation Here's how to verify requests and handle the database connection:
Copy code
javascript
import { Retell } from "retell-sdk";
this.app.post("/check-weather", async (req: Request, res: Response) => {
 if (
 !Retell.verify(
 JSON.stringify(req.body) ,
 process.env.RETELL_API_KEY,
 req.headers["x-retell-signature"] as string,
 )
 ) {
 console.error("Invalid signature") ;
 return;
 }
 const content = req.body;
 if (content.args.city === "New York") {
 return res.json("25f and sunny") ;
 } else {
 return res.json("20f and cloudy") ;
 }
}) ;
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
t
i want to use the database from abacus.ai, do you recommend this?
@AI Evy i want to use abacus.ai for ML and some database storage, please advise is this is a good way to do this, or if you have enough tools to do this without another system. I want to store a huge amount of information
a
Thanks for the follow-up, @tin_developer. I'll get back to you soon.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer [(1) ]() Retell AI doesn't provide built-in database storage or ML capabilities - it's designed as a voice agent platform that integrates with external systems through custom functions [(2) ]() [(1) ]() . Using abacus.ai for ML and database storage would be a valid approach. ## Integration with External Systems Retell AI enables integration with any external system through custom functions [(1) ]() . You can connect to abacus.ai by: 1. Creating a custom function that connects to abacus.ai's API endpoints 2. Configuring HTTP methods (GET, POST, PATCH, PUT, DELETE) to interact with your abacus.ai database 3. Setting up request headers and query parameters to authenticate with abacus.ai ## Data Handling Considerations The function result from your external system is capped at 15,000 characters to prevent overloading the LLM context window . For large amounts of information, you'd need to: - Structure your responses to return only relevant data subsets - Implement pagination or filtering in your abacus.ai integration - Process large datasets on the abacus.ai side before returning results ## Recommendation Using abacus.ai for ML and database storage is a reasonable approach since Retell AI is focused on voice agent capabilities rather than data storage or machine learning processing [(2) ]() . The custom function integration allows you to leverage abacus.ai's specialized capabilities while using Retell AI for voice interactions [(1) ]() .
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[2] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) ​
Thanks for the follow-up, @tin_developer. I'll get back to you soon.
t
@AI Evy does retell do chat?
a
## Important Note Retell does not provide native integration with SMS or chat applications at this moment [(1) ]() . You can only interact with the chat agent via API . The platform also supports SMS and chat automation as part of its omnichannel capabilities [(4) ]() , allowing agents to follow up, reschedule, or continue conversations across channels .
### Answer Yes, Retell AI does support chat functionality [(1) ]() . You can create chat agents that handle text-based conversations through the API [(2) ]() [(3) ]() . ## Creating Chat Agents You have two options for creating chat agents [(1) ]() : 1. Create a New Chat Agent - Navigate to the Agents section, click "Create New Agent", and select "Chat Agent" as the agent type 2. Convert an Existing Voice Agent - Open an existing voice agent and click "Convert to Chat Agent" Note that chat agents don't support voice-specific functions like call transfers, DTMF, or telephony features . ## Chat API Usage You can create chat sessions using the JavaScript SDK [(2) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponse = await client.chat.create({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' }) ;
console.log(chatResponse.agent_id) ;
You can also list all chats [(3) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponses = await client.chat.list() ;
console.log(chatResponses) ;
​ To learn more, see the sources I considered: [[1] Create chat agent](https://docs.retellai.com/build/create-chat-agent) [[2] Create Chat](https://docs.retellai.com/api-references/create-chat) [[3] List Chat](https://docs.retellai.com/api-references/list-chat) [[4] Inside Retell AI | The Conversational AI Platform Behind Scalable AI Phone Systems | Retell AI](https://www.retellai.com/blog/inside-retell-ai-conversational-ai-phone-system) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.