> ## Documentation Index
> Fetch the complete documentation index at: https://gaia-docs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge & RAG

> Add knowledge to your agents with Retrieval-Augmented Generation

Add documents, websites, or databases to your agents using RAG (Retrieval-Augmented Generation).

<video autoPlay muted loop playsInline className="w-full aspect-video rounded-2xl border h-[370px] border-[#e7e5e4] dark:hidden" src="https://a62edz1qni.ufs.sh/f/zshoAVKVBR3iEDDg2F1AUC60PVzJWx8qGr5ygcjX4BKDHnN3" />

<video autoPlay muted loop playsInline className="w-full aspect-video rounded-xl h-[370px] hidden dark:block" src="https://a62edz1qni.ufs.sh/f/zshoAVKVBR3iUvQ5GZyda3fjcvP2yYEpFtToSei9hsxOLzKG" />

***

## Setup Your RAG Pipeline

<Steps>
  <Step title="Choose Vector Store Provider">
    Select where to store your document embeddings:

    <img className="dark:hidden mx-auto" src="https://mintcdn.com/tuhh-d1de0e06/NLF4OVAebw6tUaJP/images/vectorstore-view-light.png?fit=max&auto=format&n=NLF4OVAebw6tUaJP&q=85&s=dd761add4e705e4a71b02d7c451d493b" alt="Vector store options" style={{ width:"99%", borderRadius: "8px", border: "1px solid #e7e5e4", margin: "10px" }} width="1282" height="797" data-path="images/vectorstore-view-light.png" />

    <img className="hidden dark:block" src="https://mintcdn.com/tuhh-d1de0e06/NLF4OVAebw6tUaJP/images/vectorstore-view-dark.png?fit=max&auto=format&n=NLF4OVAebw6tUaJP&q=85&s=983e2177db80cbd321df1b4bbb9ab902" alt="Vector store options" style={{ width:"99%", borderRadius: "8px", border: "1px solid #e7e5e4", margin: "10px" }} width="1282" height="797" data-path="images/vectorstore-view-dark.png" />

    ### Local Options

    * **FAISS** - Fast, in-memory (default for local development)
    * **LanceDB** - Persistent, serverless storage

    ### Cloud Options

    * **Pinecone** - Managed, scalable vector database
    * **Qdrant** - Self-hosted or cloud deployment
    * **Weaviate** - GraphQL-based vector search

    Go to **Settings → Vector Stores** to configure your provider.
  </Step>

  <Step title="Select Embedding Model">
    Choose the embedding model that will convert your documents into vectors:

    <img className="dark:hidden mx-auto" src="https://mintcdn.com/tuhh-d1de0e06/NLF4OVAebw6tUaJP/images/embedding-view-light.png?fit=max&auto=format&n=NLF4OVAebw6tUaJP&q=85&s=2f162a4aa9e80c3733e12b3a8fa7b876" alt="Embedding models" style={{ width:"99%", borderRadius: "8px", border: "1px solid #e7e5e4", margin: "10px" }} width="1282" height="797" data-path="images/embedding-view-light.png" />

    <img className="hidden dark:block" src="https://mintcdn.com/tuhh-d1de0e06/NLF4OVAebw6tUaJP/images/embedding-view-dark.png?fit=max&auto=format&n=NLF4OVAebw6tUaJP&q=85&s=7bde9b2e93a5e8d131c03135942f3157" alt="Embedding models" style={{ width:"99%", borderRadius: "8px", border: "1px solid #e7e5e4", margin: "10px" }} width="1282" height="797" data-path="images/embedding-view-dark.png" />

    **Local Options:**

    * Ollama embeddings (nomic-embed-text, mxbai-embed-large)

    **Cloud Options:**

    * OpenAI (text-embedding-3-small, text-embedding-3-large)
    * Cohere (embed-english-v3.0, embed-multilingual-v3.0)
    * Google (text-embedding-004)

    Configure in **Settings → Embedding Models**
  </Step>

  <Step title="Configure RAG Settings">
    Customize your knowledge retrieval settings:

    <img className="dark:hidden mx-auto" src="https://mintcdn.com/tuhh-d1de0e06/NLF4OVAebw6tUaJP/images/rag-light1.png?fit=max&auto=format&n=NLF4OVAebw6tUaJP&q=85&s=3e83fba4321975d0fe6c92baf2b3e95b" alt="RAG settings" style={{ width:"99%", borderRadius: "8px", border: "1px solid #e7e5e4" }} width="1272" height="693" data-path="images/rag-light1.png" />

    <img className="hidden dark:block" src="https://mintcdn.com/tuhh-d1de0e06/NLF4OVAebw6tUaJP/images/rag-dark1.png?fit=max&auto=format&n=NLF4OVAebw6tUaJP&q=85&s=0c39645cca852b866d1f7552d920cce0" alt="RAG settings" style={{ width:"99%", borderRadius: "8px", border: "1px solid #e7e5e4" }} width="1272" height="693" data-path="images/rag-dark1.png" />

    **Key Parameters:**

    * **Chunk Size** - How to split documents (default: 1000 characters)
    * **Chunk Overlap** - Overlap between chunks (default: 200 characters)
    * **Top K** - Number of relevant chunks to retrieve (default: 5)
    * **Similarity Threshold** - Minimum relevance score (0-1)

    Access via **Project Settings → RAG Configuration**
  </Step>

  <Step title="Enable Full-Text Search (Optional)">
    Add keyword-based search alongside vector search:

    <img className="dark:hidden mx-auto" src="https://mintcdn.com/tuhh-d1de0e06/NLF4OVAebw6tUaJP/images/rag-light2.png?fit=max&auto=format&n=NLF4OVAebw6tUaJP&q=85&s=ef13ff5a03b2a0d914fcfbedddc23a00" alt="Full-text search settings" style={{ width:"99%", borderRadius: "8px", border: "1px solid #e7e5e4" }} width="1272" height="693" data-path="images/rag-light2.png" />

    <img className="hidden dark:block" src="https://mintcdn.com/tuhh-d1de0e06/NLF4OVAebw6tUaJP/images/rag-dark2.png?fit=max&auto=format&n=NLF4OVAebw6tUaJP&q=85&s=b58efa991f755f1e2fa747333e809066" alt="Full-text search settings" style={{ width:"99%", borderRadius: "8px", border: "1px solid #e7e5e4" }} width="1272" height="693" data-path="images/rag-dark2.png" />

    **Available Options:**

    * **FlexSearch** - Fast, flexible search
    * **MiniSearch** - Lightweight, full-featured
    * **Orama** - Typo-tolerant, fast indexing
  </Step>
</Steps>

***

## Adding Knowledge to Your Agent

### Via UI

<Steps>
  <Step title="Navigate to Knowledge Tab">
    Go to your project and click the **Knowledge** tab
  </Step>

  <Step title="Upload Content">
    **Supported formats:**

    * Documents: PDF, TXT, MD, DOCX, CSV
    * Text: Enter Your Text

    GAIA automatically chunks and embeds your content
  </Step>

  <Step title="Start Using">
    Your agent can now reference this knowledge in conversations!
  </Step>
</Steps>

### Via API

You can check api reference here [Knowledge API Reference](/api-reference/knowledge/create-index)

***

**Next Steps:**

* [Create Custom Tools](/features/tools) to enhance your agent's capabilities
* [API Reference](/api-reference/knowledge/create-index) for detailed API documentation
