RAG and Content Retrieval
RAG vs Content Retrieval
-
Retrieval Augmented Generation (RAG) is a technique where a user's query can be used to retrieve semantically similar text chunks previously stored in an external service. This is useful for retrieving additional information to help the LLM form a coherent and accurate response to the user's query.
-
Content Retrieval is a technique where bulk textual information can be retrieved by calling external services, whether that service uses vector similarity or merely looks up data in a database. In a sense, RAG Retrieval is a form of Content Retrieval - and vice-versa - with RAG Retrieval merely being aided by the use of vector similarity lookup.
-
The Custom Content Retrieval/RAG Integration can therefore be used to integrate with any RAG repo as it integrates with the rest of the iostack platform in an identical manner to RAG integrations.
-
RAG and Content Retrieval Integrations are triggered at each turn prior to calling the LLM for the Stages that have been configured to use them.
-
Information gathered by RAG or Content Retrieval is injected directly into the LLM Prompt, differing from other 'input' integrations which retrieve information from external services and instead populate variables.
-
You can observe retrieved information in the LLM Prompt section of the Sandbox as you build and test your Agent.
Supported RAG and Content Retrieval Methods
Canned RAG Methods
-
We currently support specific Pinecone and Weaviate RAG methods that make some assumptions about the nature of your RAG repo and thus come with caveats.
-
If your RAG repo is not supported by the canned methods, you can create your own RAG Retriever by implementing a specific Custom JS Content Retriever Integration. If you have a spcific RAG repo or RAG configuration that you would like supported as a canned RAG Integration, please contact us.
-
For more information, view the documentation for each RAG Integration type and the information on authoring Custom JS Content Retrieval Integrations.
Custom Content Retrieval/RAG
-
The Custom Content Retrieval/RAG Function Integration enables authoring of almost any retrieval method you can think of (RAG or Content Retrieval).
-
Custom Content Retrieval/RAG Scripts can make use of fetch functionality (for REST calls) and/or GraphQL functionality.
Defining Custom Content Retrieval/RAG Integrations
-
In much the same way that Variables need to be defined before they can be used, you will need to define a specific Custom Content Retrieval/RAG Integration before it can be used in your Agent.
-
This is to support configuring a single Custom Content Retrieval/RAG Integration with keys and other boilerplate parameters and then specifying the use of them throughout your Agent, customizing each use according to its location and context.
-
To define a Custom Content Retrieval/RAG Integration:
-
Navigate to the Integrations section of the Agent and click on the ’+’ icon at top right.
-
Select an Custom Content Retrieval or RAG Integration type and fill in the details.
-
Using a Defined CustomContent Retrieval/RAG Integration
-
Once defined, an integration will be available for selection in the Agent's list of integrations.
-
You can use the Integration definition and configure it for each Stage and Transition where you require it as well as in the Common Stage Settings of your Agent.