I’ve done something very similar to this! I have a postgreSQL database I wanted to get data from using my agent, so I used an ORM (in my case SQLAlchemy) to connect to it in Python. I created a role in my database that only gave me read access so I wouldn’t mess anything up, and then made a function that takes in a plain text SQL query, executes it, and returns a string with the outputted values. Then all that was left was adding the function to my agent’s toolbelt.
hayden2
3
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Assistants in the Playground - then use in the API | 7 | 3948 | March 19, 2024 | |
| How to create a database in my Assistant? | 6 | 512 | July 3, 2024 | |
| Retrievals from files are cool , but I want to use retrieval from databases any ideas? | 3 | 1445 | March 13, 2024 | |
| Connecting Assistant API to CRM | 6 | 865 | March 25, 2026 | |
| API use external API as query database for chat | 1 | 1686 | April 17, 2024 |