While retrieval-augmented generation (RAG) can help fetch relevant context (#1), sometimes we want to retrieve data in a more constrained and regular fashion than embedding vector search. We can instead create Actions out of database/index queries, where a user might add SQL template code, and allow the Agent to dynamically fill in certain values based on the user request.
This allows us much greater control vis-a-vis RAG over the way that we retrieve data. Moreover, this concept can be extended to data sources beyond SQL just as easily, such as ElasticSearch or AirTable, while maintaining much of the same UI elements as the REST API Integration.
Tasks
[ ] Create menu for users to select if they want to create a REST API Action or a DB query Action
[ ] Create menu for users to select a DB source
[ ] Create an interface for users to input credentials to connect to the DB source
[ ] Have the backend to spin up a client given the credentials
[ ] Design the UI for the DB query Action Menu page
[ ] Design the best way to display data snippet with "Test Query"
[ ] Convert the configured DB query into an Action to send to function-calling LLMs
[ ] Add guardrails around the query (i.e. check for any creative/destructive operations)
[ ] Notify the user (with red lighting around query box) when guardrails are violated on the UI and disallow testing
Description
While retrieval-augmented generation (RAG) can help fetch relevant context (#1), sometimes we want to retrieve data in a more constrained and regular fashion than embedding vector search. We can instead create Actions out of database/index queries, where a user might add SQL template code, and allow the Agent to dynamically fill in certain values based on the user request.
This allows us much greater control vis-a-vis RAG over the way that we retrieve data. Moreover, this concept can be extended to data sources beyond SQL just as easily, such as ElasticSearch or AirTable, while maintaining much of the same UI elements as the REST API Integration.
Tasks