๐Ÿ” Answer questions about documentation with BigQuery RAG and OpenAI

โšก 428 views ยท ๐Ÿ” AI RAG & Knowledge Retrieval

Description

BigQuery RAG with OpenAI Embeddings

This workflow demonstrates how to use Retrieval-Augmented Generation (RAG) with BigQuery and OpenAI.
By default, you cannot directly use OpenAI Cloud Models within BigQuery.

Try it

This template comes with access to a public BigQuery table that stores part of the n8n documentation (about nodes and triggers), allowing you to try the workflow right away:
n8n-docs-rag.n8n_docs.n8n_docs_embeddings

โš ๏ธ Important: BigQuery uses the requester pays model. The table is small (~40 MB), and BigQuery provides 1 TB of free processing per month. Running 3โ€“4 queries for testing should remain within the free tier, unless your project has already consumed its quota.
More info here: BigQuery Pricing

Why this workflow?

Many organizations already use BigQuery to store enterprise data, and OpenAI for LLM use cases.
When it comes to RAG, the common approach is to rely on dedicated vector databases such as Qdrant, Pinecone, Weaviate, or PostgreSQL with pgvector.
Those are good choices, but in cases where an organization already uses and is familiar with BigQuery, it can be more efficient to leverage its built-in vector capabilities for RAG.

Then comes the question of the LLM. If OpenAI is the chosen provider, teams are often frustrated that it is not directly compatible with BigQuery.
This workflow solves that limitation.

Prerequisites

To use this workflow, you will need:

This template comes with a public table that stores part of the n8n documentation (about nodes and triggers), so you can try it out:
n8n-docs-rag.n8n_docs.n8n_docs_embeddings

How it works

The system consists of two workflows:

๐Ÿ”— Nodes Used

HTTP Request, Execute Workflow Trigger, AI Agent, OpenAI Chat Model, Simple Memory, Call n8n Workflow Tool

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup