Product Docs
  • What is Dataworkz?
  • Getting Started
    • What You Will Need (Prerequisites)
    • Create with Default Settings: RAG Quickstart
    • Custom Settings: RAG Quickstart
    • Data Transformation Quickstart
    • Create an Agent: Quickstart
  • Concepts
    • RAG Applications
      • Overview
      • Ingestion
      • Embedding Models
      • Vectorization
      • Retrieve
    • AI Agents
      • Introduction
      • Overview
      • Tools
        • Implementation
      • Type
      • Tools Repository
      • Tool Execution Framework
      • Agents
      • Scenarios
      • Agent Builder
    • Data Studio
      • No-code Transformations
      • Datasets
      • Dataflows
        • Single Dataflows:
        • Composite dataflows:
        • Benefits of Dataflows:
      • Discovery
        • How to: Discovery
      • Lineage
        • Features of Lineage:
        • Viewing a dataset's lineage:
      • Catalog
      • Monitoring
      • Statistics
  • Guides
    • RAG Applications
      • Configure LLM's
        • AWS Bedrock
      • Embedding Models
        • Privately Hosted Embedding Models
        • Amazon Bedrock Hosted Embedding Model
        • OpenAI Embedding Model
      • Connecting Your Data
        • Finding Your Data Storage: Collections
      • Unstructured Data Ingestion
        • Ingesting Unstructured Data
        • Unstructured File Ingestion
        • Html/Sharepoint Ingestion
      • Create Vector Embeddings
        • How to Build the Vector embeddings from Scratch
        • How do Modify Existing Chunking/Embedding Dataflows
      • Response History
      • Creating RAG Experiments with Dataworkz
      • Advanced RAG - Access Control for your data corpus
    • AI Agents
      • Concepts
      • Tools
        • Dataset
        • AI App
        • Rest API
        • LLM Tool
        • Relational DB
        • MongoDB
        • Snowflake
      • Agent Builder
      • Agents
      • Guidelines
    • Data Studio
      • Transformation Functions
        • Column Transformations
          • String Operations
            • Format Operations
            • String Calculation Operations
            • Remove Stop Words Operation
            • Fuzzy Match Operation
            • Masking Operations
            • 1-way Hash Operation
            • Copy Operation
            • Unnest Operation
            • Convert Operation
            • Vlookup Operation
          • Numeric Operations
            • Tiles Operation
            • Numeric Calculation Operations
            • Custom Calculation Operation
            • Numeric Encode Operation
            • Mask Operation
            • 1-way Hash Operation
            • Copy Operation
            • Convert Operation
            • VLookup Operation
          • Boolean Operations
            • Mask Operation
            • 1-way Hash Operation
            • Copy Operation
          • Date Operations
            • Date Format Operations
            • Date Calculation Operations
            • Mask Operation
            • 1-way Hash Operation
            • Copy Operation
            • Encode Operation
            • Convert Operation
          • Datetime/Timestamp Operations
            • Datetime Format Operations
            • Datetime Calculation Operations
            • Mask Operation
            • 1-way Hash Operation
            • Copy Operation
            • Encode Operation
            • Page 1
        • Dataset Transformations
          • Utility Functions
            • Area Under the Curve
            • Page Rank Utility Function
            • Transpose Utility Function
            • Semantic Search Template Utility Function
            • New Header Utility Function
            • Transform to JSON Utility Function
            • Text Utility Function
            • UI Utility Function
          • Window Functions
          • Case Statement
            • Editor Query
            • UI Query
          • Filter
            • Editor Query
            • UI Query
      • Data Prep
        • Joins
          • Configuring a Join
        • Union
          • Configuring a Union
      • Working with CSV files
      • Job Monitoring
    • Utility Features
      • IP safelist
      • Connect to data source(s)
        • Cloud Data Platforms
          • AWS S3
          • BigQuery
          • Google Cloud Storage
          • Azure
          • Snowflake
          • Redshift
          • Databricks
        • Databases
          • MySQL
          • Microsoft SQL Server
          • Oracle
          • MariaDB
          • Postgres
          • DB2
          • MongoDB
          • Couchbase
          • Aerospike
          • Pinecone
        • SaaS Applications
          • Google Ads
          • Google Analytics
          • Marketo
          • Zoom
          • JIRA
          • Salesforce
          • Zendesk
          • Hubspot
          • Outreach
          • Fullstory
          • Pendo
          • Box
          • Google Sheets
          • Slack
          • OneDrive / Sharepoint
          • ServiceNow
          • Stripe
      • Authentication
      • User Management
    • How To
      • Data Lake to Salesforce
      • Embed RAG into your App
  • API
    • Generate API Key in Dataworkz
    • RAG Apps API
    • Agents API
  • Open Source License Types
Powered by GitBook
On this page
  1. Concepts
  2. RAG Applications

Retrieve

In Retrieval-Augmented Generation (RAG) apps, retrieval refers to the process of fetching the most relevant data from a large dataset based on a user query. This process happens after the data has been ingested, chunked, and vectorized (turned into embeddings). Retrieval is a crucial component of the RAG architecture because it ensures that the language model has access to the most relevant information to generate accurate and contextually aware responses.

Key Concepts in Retrieval:

  1. Query Embedding:

    • The retrieval process starts when a user query is entered into the system. This query is typically in the form of natural language, such as "What are the benefits of vectorization in RAG apps?"

    • The system converts the query into a vector representation using the same embedding model that was used for the ingested data. This vectorization step turns the query into a numerical format that captures its semantic meaning.

  2. Similarity Search:

    • Once the query is embedded as a vector, the system needs to compare this vector with the vectors of the ingested data (stored in the vector database).

    • The system uses similarity search algorithms to find the most similar embeddings to the query embedding. These algorithms measure the distance between vectors in high-dimensional space. Common similarity measures include cosine similarity, Euclidean distance, or inner product.

    • The goal of similarity search is to identify the vectors (chunks of data) that are closest to the query’s vector, meaning the data that is most semantically relevant.

  3. Retrieving Relevant Data:

    • After performing the similarity search, the system retrieves the top N most relevant chunks (or data points) that are closest to the query’s vector. These chunks are typically the ones that contain the most relevant information needed to answer the user’s question.

  4. Contextualization:

    • These retrieved chunks are passed to the language model (e.g., GPT-4, LLaMA, or a custom model), which uses the context to generate a response. The language model may generate an answer by directly referencing or synthesizing information from these retrieved chunks.

    • The ability to retrieve highly relevant data ensures that the response generated by the model is both accurate and contextually rich.

Example: How Retrieval Works in Practice

  1. User Query: A user submits the query, "What are the benefits of using embeddings in AI applications?"

  2. Query Embedding: The system converts this query into a vector representation using an embedding model.

  3. Similarity Search: The query vector is compared to the vectors of previously ingested data (e.g., articles, documents, FAQs). The system uses cosine similarity to find the closest matching vectors in the database.

  4. Retrieving Data: The system retrieves the most relevant chunks of data that match the query’s vector. For instance, it might retrieve a document chunk that discusses "the role of embeddings in natural language processing" and another chunk that explains "the benefits of embeddings in AI applications."

  5. Response Generation: The retrieved data is sent to the language model, which uses the context to generate an accurate response, such as, "Embeddings in AI applications allow for more efficient data representation, improving the ability of models to understand complex relationships between data points."

Key Benefits of the Retrieval Process:

  • Improved Relevance: By retrieving only the most relevant chunks of data, the model can generate highly targeted responses, increasing the quality and accuracy of the answers.

  • Scalability: The retrieval process allows the system to handle large datasets, ensuring that even vast amounts of unstructured data can be searched and processed quickly.

  • Context-Aware Generation: Retrieval ensures that the language model has access to the right context when generating responses, making the output more informed and contextually appropriate.

Retrieval Workflow in RAG Apps:

  1. User Input: The user submits a query.

  2. Query Embedding: The query is converted into a vector.

  3. Similarity Search: The query vector is compared to the data vectors using a similarity measure.

  4. Retrieve Relevant Chunks: The closest N data chunks are retrieved.

  5. Generate Response: The language model uses the retrieved data to generate a response.

PreviousVectorizationNextAI Agents

Last updated 1 month ago