Build a RAG app in under 5 minutes
Quickly create a retrieval-augmented generation app with Scout
Scout makes building AI apps simple. With intuitive drag-and-drop functionality, you can easily build apps that leverage LLMs, APIs, your data, and your custom logic.
In this guide, we’ll show you how to build a RAG app in Scout in under 5 minutes. Scout provisions all the underlying infrastructure, and our free tier doesn’t require a credit card. Let’s get started!
Integrate your data
Scout stores your data in collections, which are groups of documents. Each document can contain metadata and text content. The text content is chunked and used for vector search. The metadata can be used to filter and sort the documents. Scout abstracts all of this complexity and provides a simple process to upload documents as outlined below:
Create a collection
- Sign up for free or sign in to Scout
- Once logged in, click “Collections” in the nav
- Click ”+ Create Collection”
- Name and create your collection
- Once your collection is provisioned, click it to open it
Configure the table
- Once inside the newly created collection, you will be in the default
Untitled
table. Click the ”+” button to add columns.
- We’ll add two columns:
- One named
URL
with a column type ofURL
- And one named
Page Title
with a column type ofSingle Line Text
- Once completed, our table should look as follows, with 3 columns:
Upload documents
There are 4 primary ways you can add documents to a collection in Scout:
- Give Scout a URL or website to scrape
- Use integration sources
- Create a document directly in Scout
- Use Scout’s API, TypeScript or Python SDKs.
In this guide, we’ll build a collection by scraping Scout’s docs (Scoutception?) but feel free to choose your own adventure for this section.
First, in your collection, click “Sources” in the nav at the top, then click “Add Source” to start adding documents. Then, select the “Website Crawl” option.
- Settings: Enter
https://scoutos.com
as the URL - Mapping: Map the crawl values to the colums we created in our table.
- Frequency: For this example, we can skip the Frequency section. It’s used to schedule crawl refreshes; for example if you want to crawl your docs every week to keep the documents in your table up to date.
- Click the “Create” button, then the “Run” button to start scraping the Scout website. You’ll see the progress and status of the process. Once it’s complete, move on to the next step to configure your workflow.
Configure your workflow
Workflows consist of inputs, composable blocks which represent different actions, and outputs. They can be created from scratch, cloned from an existing workflow, or started with a template. Each block is designed with its own set of configurations. In this guide, we’ll create a workflow that uses an input, a collection search, an LLM, and then output:
Create a workflow
- Click “Workflows” in the nav
- Click ”+ New” to create a new workflow
- Name your workflow and click the “Create” button. You’ll see your empty workflow canvas:
Add a collection block
- At the bottom of the workflow canvas click the ”+” button and drag a new Scout Collection > Query Collection Table block onto the workflow canvas
- Then, click the newly created collection block, and modify its configurations as follows:
Collection
: Use the dropdown to select your collectionTable
: Use the dropdown to select your tableQuery
: This should be{{inputs.user_message}}
in order to supply the RAG app’s input to the collection query
- Everything else can be left as default. Click the “Save” button in the upper right-hand corner. Your settings should look as follows, except for the
Collection ID
should be your unique value as mentioned above:
Add an LLM block
At the bottom of the workflow canvas click the ”+” button and drag a new AI > LLM block onto the workflow canvas
Then, click the newly created LLM block, and modify its configuration sections as follows:
- First is the Configuration section, where we’ll use the following settings:
Model
: We’ll usegpt-4o
for thisTemperature
: We’ll use0.7
to keep it more factualMaximum Tokens
: We’ll use2000
as we’ll be supplying our queried documents in the requestResponse Type
:text
- Then we’ll configure the Chat Messages section as follows:
- First, we’ll add a System Message
- Click ”+ Add an item”
- Then change
Chat Messages-1
:Single Message
- Set
Role
:system
- And paste the following prompt into
Content
- The final configuration for the System Message should look as follows:
- Click ”+ Add an item”
- Then, we’ll add the User Message
- Scroll to the bottom of the Chat Messages section and click ”+ Add an item” to add another Chat Message
- Then change the newly created
Chat Messages-2
:Single Message
- Set
Role
:user
- And paste the following prompt into
Content
:Important: You will need to replace theYOUR_COLLECTION_BLOCK.output
variable in the snippet above with your actual collection block ID. You can easily copy your collection block ID by hovering over it and clicking copy. For example, mine would becollection_rmdz0c.output
Lastly, click the “Save” button in the upper right-hand corner. Your RAG app (workflow) is ready!
- First, we’ll add a System Message
Run your workflow
There are a variety of ways to run workflows; Slackbots, Scout’s embeddable Copilot, SDKs, API, directly from the Console in the Scout workflow UI, and many more.
In this guide, we’ll keep it simple and test the output directly from the Console in the Scout workflow UI:
Run workflow from Scout Console
On the upper left-hand side of the workflow canvas, click the play icon to open the Console.
In the User’s Message text area, paste the following query then click “Run”:
The output will be automatically formatted and rendered below the input, and should look something like this:
Voila! And there you have it; we built a RAG app in under 5 minutes that can guide you in building more powerful and complex AI apps on Scout!
Want to keep building? Check out our free Workflow Templates which can help jumpstart your use case!