# RAG-based Document Search

Large Language Models are trained on a huge amount of data, yet when you search for your organization or brand, you might find that it usually can’t respond accurately. This means that LLMs might hallucinate (or “make up”) irrelevant or inaccurate information for your business needs.

This is why Retrieval Augmented Generation (RAG) is an excellent solution! RAG will:

1. Index all of your knowledge base in a vectorDB - pdfs, csvs, texts, web pages, images, and more
2. Retrieve all the most relevant information from the vectorDB
3. Use LLM to provide summaries that work for your use case and generate accurate answers

<figure><img src="https://662560811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5BFP5RUm6rTLXk8wUSTf%2Fuploads%2FWJNBleyzWYkuQAsjpVkq%2FHow%20does%20RAG-based%20document%20search%20work_.jpg?alt=media&#x26;token=3cf86bd0-0ba3-4ffd-b90d-06c2337d0c4e" alt=""><figcaption></figcaption></figure>

### Where is RAG useful? <a href="#pk2fnertmmfp" id="pk2fnertmmfp"></a>

RAG is useful for:

1. For site-wide searches
2. AI copilots
3. Research and analyses of large datasets
4. Workplace searches
5. Search powered applications
6. Search and summaries for the legal industry

### How to use RAG on Gooey.AI? <a href="#t71waoaanjb8" id="t71waoaanjb8"></a>

#### Step 1: Prepare your knowledge base <a href="#id-7ycp7arvb983" id="id-7ycp7arvb983"></a>

You can upload all your documents and data in the “Documents” section. You can add PDFs, docs, spreadsheets, charts, and texts.

**These can be uploaded from your local drive or online hosted links. We even accept Google Drive links.**

![](https://662560811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5BFP5RUm6rTLXk8wUSTf%2Fuploads%2Ft8polA7kI2v5aTIjUP5m%2F1.png?alt=media)

#### Step 2: Choose your preferred Large Language Model <a href="#jw7i6tz1b2xd" id="jw7i6tz1b2xd"></a>

Head to the “settings” option and choose your preferred LLM!

![](https://662560811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5BFP5RUm6rTLXk8wUSTf%2Fuploads%2FZhkdgbAIVJnlETVJT8cH%2F2.png?alt=media)

#### Step 3: Add your query <a href="#cve6n4liro9f" id="cve6n4liro9f"></a>

Scroll to the top of the page, and add your query/question for the RAG.

![](https://662560811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5BFP5RUm6rTLXk8wUSTf%2Fuploads%2FIhFlbF9609ZNLx7pGYvY%2F3.png?alt=media)

#### Step 4: Hit Submit <a href="#ftzxwu9v5kmm" id="ftzxwu9v5kmm"></a>

Hit the Submit button!

### Output <a href="#kd4xn1r795m" id="kd4xn1r795m"></a>

Your output will be on the right side and look like this:

![](https://662560811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5BFP5RUm6rTLXk8wUSTf%2Fuploads%2FXmnytpkB2rNTZvzipIIw%2F4.png?alt=media)

You might notice, there is a citation legend in the output. All referenced and cited text snippets from the search query will be shared in the “Sources” section below the output.

![](https://662560811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5BFP5RUm6rTLXk8wUSTf%2Fuploads%2FnI6xvZnC42b2CRmvcsvG%2F5.png?alt=media)
