Retrieval Augmented Generation (RAG)

What is RAG?

Retrieval Augmented Generation (RAG) is a hybrid AI model that combines the capabilities of LLMs with a retrieval-based approach to enhance its output. Essentially, RAG operates by first retrieving relevant information from a database or document corpus and then using this information to inform the generative process. This approach allows the AI to produce responses that are not only based on its pre-trained knowledge but also enriched with specific details and facts pulled from external sources. The inclusion of retrieved documents into the generation process helps in creating more accurate, informative, and contextually relevant outputs.

How is RAG Used in BrainSoup?

In BrainSoup, RAG takes advantage of the platform's unique architecture to leverage documents stored both in the user-defined Documents folder and within each chat room's Sandboxed File System. Here's how it works:

  1. Document Retrieval: When an agent within BrainSoup is activated to perform a task or answer a question, it first searches through available documents that have been added by the user or generated during interactions within the chat room. This search is guided by keywords or context provided in the user's query.
  2. Contextual Understanding: Once relevant documents are identified, their contents are temporarily integrated into the agent's working memory. This process enriches the agent's understanding by providing it with additional context, data, and facts that are directly related to the user's request.
  3. Enhanced Response Generation: Leveraging this augmented knowledge base, BrainSoup agents can then generate responses or complete tasks with a higher degree of specificity and relevance. The agents use the information gleaned from these documents as a foundation for crafting answers that are not only reflective of their built-in capabilities but also deeply informed by external data sources.

By utilizing RAG in this manner, BrainSoup enables users to create highly customized and knowledgeable agents capable of handling complex queries with ease. Whether it’s pulling technical details from a PDF manual or incorporating facts from a saved research article, RAG empowers agents to deliver more precise and informed responses.