Tutorial to Build a RAG with Google Bigquery
Step by step guide to setup a conversational chat app to RAG a Google Big Query datasource (or any other data source)
This is the full explainer, supplementing the Bigquery Demo Video below. This guide will show how to setup models, credentials, tasks, agents and apps to get the RAG chat app working.
1. Setup Models and Credentials
Go to the /models
screen and add two models:
2. Setup Datasource
If running locally via Docker, during this process we reccommend running docker compose logs -f
in your terminal to follow along and catch any errors if they occur.
For Advanced debugging you can also open up apps like Qdrant or Airbyte to see progress as data passes through each system.
Click Advanced Debugging for instructions on how to access these UIs.
Go to the /datasources
screen, select New Connection and add a Bigquery data source:
3. Setup A Tool
Go to the /tools
screen and create a new tool
4. Setup an Agent
Go to the /agents
screen and create a new Agent
5. Setup a Task
Go to the /tasks
screen and create a new task with the following task description:
Have a back and forth conversation with the user.
Be clear in your answers always.
If you don't know the answer say "I do not know."
Set the Preferred Agent as the Conversational Agent you just created.
6. Create an App
Go to the /apps
screen and create a new App
7. Have a chat!
If you want to make sure the agent always uses the tool, you can update the agent prompt and tell it, ALWAYS use the … tool. Otherwise if you want to build an agent with a bit more autonomy to decide on multiple tools, you can keep the config light and let it infer which tool is required. For example in the video we prompted the tool by writing According to Elon… which helped guide the LLM to the correct tool.