Essential cookies

Cookies that are required to enable basic website functionality.

Marketing cookies

Cookies used to deliver advertising that is more relevant to you.

Personalization cookies

Cookies that allow the website to remember choice you make (e.g. user name, location) and provide more enhanced, personalized features.

Analytics cookies

Cookies to help us understand how the website performs, how visitors interact with the site, and any technical issues.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Sep 13
#
Education

TheorIQ: An Introduction to Retrieval Augmented Generation (RAG) for AI Agents

In 2020, Patrick Lewis introduced the term Retrieval Augmented Generation (RAG) in a groundbreaking paper, positioning it as a key method for improving the accuracy and reliability of generative AI models. The method has gained widespread acceptance, and more recently, he has apologized for the unappealing acronym.

As AI Agents continue to evolve and integrate multiple generative models, understanding concepts like RAG is crucial for AI enthusiasts and our community. This knowledge will serve as the foundation for creating dynamic AI Agents and Agent Collectives on the Theoriq protocol.

What is RAG?

RAG, or Retrieval Augmented Generation, is a technique that enhances AI’s ability to provide accurate, up-to-date responses. Imagine if every time you asked AI a question, it could quickly access the latest information from the Internet or a large database. That’s what RAG does. It helps Large Language Models (LLMs) to use up-to-date facts instead of solely relying on their pre-training data.

What is Pre-Training Data?

Before we dive deeper into RAG, it’s important to understand pre-training data and how LLMs work. LLMs are trained on vast amounts of text data to perform basic language tasks and follow instructions, building an understanding of language and general knowledge up to a certain point in time. This pre-training allows LLMs to generate human-like text.

However, pre-trained, out of the box LLMs have limitations:

  • Static Information: Their information is frozen, only knowing data at the time of the LLMs training.
  • Biased and Inaccurate: The model may reproduce biases or errors present in their training, which doesn’t reflect real world use cases or historical facts.
  • No Real-Time Information: They can’t access current events or newly published data.

This is why current AI chatbots, like ChatGPT, are not search engines. While they can generate creative responses, under the hood they essentially predict the next word and may struggle with real-time facts and real-world scenarios.

How RAG Enhances AI Agents

Imagine asking an AI Agent, "What should I wear today?" Without RAG, it might give a generic answer like, “how about something comfortable, like jeans and a t-shirt?”. But with RAG, the same AI interaction can be programmed to have the persona of a ‘Stylist’ that can check the latest weather report, consider the occasion you’re dressing for, and analyze the latest styling trends – it would then suggest something that is tailored to your needs.

Once we add programming to our interactions with AI, like adding a Stylist persona, we call these tools ‘Agents’. At Theoriq, we define AI Agents as follows:

AI agents are autonomous software systems that leverage modern generative AI models to plan, access data, use tools, make decisions, and interact with the real world to perform specific functions.” Theoriq Team. (2024). Theoriq: The AI Agent Base Layer.

The typical workflow for RAG involves chunking documents into smaller pieces, computing embeddings for each chunk, and storing them in a vector database. When a question is asked,  the system retrieves the most relevant chunks using a similarity metric, which helps the LLM generate a more accurate and contextually relevant response (that's where Retrieval Augmented Generation comes from - you retrieverelevant info and generate a response with the augmented context). This process might also include intermediate steps like re-ranking or filtering the retrieved information.

New Words Alert 🚨

  • Chunking: Breaking down large documents into smaller, manageable pieces of text.
  • Embeddings: Numerical representation of text that captures semantic meaning.
  • Vector Database: A specialized database optimized for storing and retrieving embeddings.

About Theoriq

Theoriq is a DeFi strategy curator. It curates on-chain vaults that turn tokenized assets into risk-managed yield: curators set the strategy and the risk limits, and AI-assisted systems execute and monitor within them. Its flagship vault, AlphaVault ETH, applies this framework to ETH-native yield, and the Theoriq Gold Vault extends it to tokenized gold.

Theoriq

Theoriq is a DeFi strategy curator for tokenized assets. We curate and risk-manage onchain yield, sourced from signal across market conditions and run through institutional-grade controls. AlphaVault ETH and Theoriq Gold Vault are live today, with more assets in the future.

Theoriq · Curating Tokenized RWAs · 2026Privacy · Brand kit · MiCA