The latest version of our platform is out now, it’s packed with new features and enhancements designed to boost your Workflows and integrate even more sophisticated AI capabilities into your applications. Here's a look into what's new, how it works, and why it matters for your projects.
RAG Related Features
Revolutionary RAG Components for Flexible Data Handling
Our newest additions, the RagEngine
and RagContext
, are designed to significantly upgrade how data flows through AI-driven systems. The RagEngine
orchestrates the retrieval, processing, and generation stages of data, acting much like the conductor of an orchestra, ensuring each section comes in at the right time for perfect harmony. The RagContext
, on the other hand, serves as the container that passes essential data throughout these stages, ensuring nothing gets lost along the way.
Stages of RAG:
QueryRagStage
: Think of this as the brainstorming phase, where the system expands and interprets user queries to understand and anticipate needs more effectively.RetrievalRagStage
: This is the research phase, where the system searches the data to gather the most relevant information.
ResponseRagStage
: In the final stage, like a presentation, the system polishes and delivers the information in a coherent and contextually appropriate manner.
To explain further about the graphic above, the RAG process begins by querying for specific information, expanding and interpreting user queries to accurately anticipate and understand their needs. It then retrieves the most relevant information from a comprehensive dataset, and finally, modifies and tailors this data to produce a coherent and contextually appropriate response.
Targeted RAG Modules for Precision and Efficiency
To make these stages even more effective, Griptape has introduced specific RAG modules for different tasks:
Retrieval Modules
likeVectorStoreRetrieval
andTextLoaderRetrieval
handle fetching data from structured databases and real-time feeds, respectively, ensuring that the system always has the latest and most relevant data at its disposal.Response Modules
such asPromptResponseRagModule
andTextChunksResponseRagModule
work on crafting precise and engaging responses based on the data retrieved, ensuring that the output is not only informative but also accurate.
Below is an example of how you can use the new RagEngine
with your own data stores. In this code snippet, we are setting up a system to manage and respond to queries using RAG. First we load and store text data from a website into a local vector store using Griptape tools. This allows us to efficiently retrieve information based on user queries. An agent will then be created with tools meant to handle the retrieval of this data and generate responses.
Moreover, the LocalVectorStoreDriver.persist_file
makes data management easier by allowing you to store and retrieve large datasets efficiently. This feature allows the LocalVectorStoreDriver
to persist the vector store to a file, which helps prevent memory overload when working with large datasets, ensuring more efficient data management.
We can modify our RAG code above by passing the path/to/file we want to persist into the LocalVectorStoreDriver
.
Enhanced Search and Reranking Capabilities
The new CohereRerankDriver
refines how search results are ordered, pushing the most relevant information to the forefront. Imagine searching through a bookshelf where the most useful books always end up at eye level, ready for you to pick up. This is what our reranking driver does for digital content.
Reranking is needed when you have more than one data source and you’d like the AI to intelligently rank the responses it gets during the Retrieval stage of the RagEngine
. Let’s update our initial code to show how this can work.
Streamlining Operations with Utilities and Web Drivers
With additions like GoogleWebSearchDriver
and DuckDuckGoWebSearchDriver
, your applications can now leverage the unique capabilities of these search giants directly. Whether it's Google's vast index or DuckDuckGo's privacy-focused results, you can choose the tool that best fits your needs.
Future-Proofing with API Changes and Enhancements
We've made several API changes, removing outdated features and streamlining existing ones to reduce complexity and escalate performance. For instance, the transition from TextQueryTask
to RagTask
allows for a smoother integration of retrieval and response functionalities, in turn, making your development process more intuitive.
See the full change list here!
Conclusion
The enhancements and new features introduced are designed to empower developers by simplifying complex processes and providing powerful tools that enable the creation of more responsive and intelligent systems. Explore the capabilities of Griptape’s newest release and discover how they can transform your projects, making them more efficient and impactful. We are excited to see what you build.