Skip to content

Chapter 2: Building the Knowledge Base (RAG)

In this chapter, we will build the “brain” of our Level 1 Agent, which will answer general questions. This process converts a document into a database that the AI can consult. Arquitectura completa del sistema de atención al cliente de tres niveles en NappAI.

Required Components

  • Google Drive File Manager
  • Parse Data
  • Split Text
  • Google Generative AI Embeddings
  • Chroma DB

Step-by-Step Construction and Configuration

Add the following components to the canvas and connect them as indicated:

  1. Google Drive File Manager

    • Purpose: To load the document with your company’s policies.
    • Configuration:
      • Credential: Select My Drive Credential.
      • Operation: Get.
      • Mode of Input: By Selection.
      • Select file: Choose the PDF or document containing your information.
  2. Parse Data

    • Purpose: To extract the text from the document.
    • Connection: Connect the Data output of the Google Drive to the data input of this component.
  3. Split Text

    • Purpose: To divide the text into manageable fragments (chunks).
    • Connection: Connect the processed_data output of the Parse Data to the data input.
    • Configuration:
      • Chunk Size: 1000.
      • Chunk Overlap: 200.
  4. Google Generative AI Embeddings

    • Purpose: To prepare the model to convert text into vectors (embeddings).
    • Configuration:
      • Credential: Select Mi Credencial de Gemini.
  5. Chroma DB

    • Purpose: To store the text fragments as vectors in the Vector Store.
    • Connections:
      • Connect the chunks output of the Split Text to the ingest_data input.
      • Connect the embeddings output of the Google Generative AI Embeddings to the embedding input.
    • Configuration:
      • Operation: Add.
      • Collection Name: ecommerce_policies (save this name, you will need it).

By running this flow, you will have created your knowledge base.