Blogs

Building Real World RAG-based Applications with ApertureDB

November 21, 2024
6
Vishakha Gupta
Vishakha Gupta

Introduction to RAG, LLMs, Embedding Models, and Vector Search

Retrieval-Augmented Generation (RAG) is a powerful framework that combines retrieval-based methods with generative models. By leveraging Large Language Models (LLMs) and embedding models, RAG enhances the ability to search and generate relevant content. Vector search plays a crucial role in this process by efficiently retrieving information based on embeddings. We did a pretty detailed coverage of these concepts and more in our earlier blog series.

How We Test Question-Answering with ApertureDB Vector Search

What better way to test our product than to dog-food it ourselves, right?

We recently made our code available outlining a comprehensive step-by-step approach to creating a semantic search chatbot. The tutorial shows steps to ingest the Wikipedia-Cohere dataset from Hugging Face into ApertureDB. It explains how to build a RAG chain on the ingested data using LangChain with ApertureDB as its vector and document store for data management and querying, as shown in the image below. Finally, it details using a LLM to generate responses based on the retrieved (and re-ranked) text segments and user inputs, ensuring efficient and accurate information retrieval.

However, in order to get responses within the context of what ApertureData offers, which means information available on our website and documentation, the recipes outline how we generate embeddings for the corresponding pages and index into ApertureDB. Given how useful it could prove, especially when new users don’t always know the right keywords to search in a classic search bar, we decided to introduce it as a chatbot in our documentation (learn more about the history here)! 

RAG Applications From Our Users

AIMon, LlamaIndex, ApertureDB for Iterating On and Improving RAG Responses

“Hallucinations” were what the early day chatbots became known for! The recipe from AIMon documentation on "Fixing Hallucinations in a Documentation Chatbot with ApertureDB" is one sure way to increase the accuracy of responses generated by documentation chatbots. It focuses on addressing the issue of "hallucinations," where AI models generate content that seems plausible but is actually incorrect or irrelevant. 

The approach involves using ApertureDB to store and manage embeddings from the AIMon documentation, which are then queried to find precise and relevant information. By integrating AIMon, ApertureDB and LlamaIndex, the workflow iterates on and improves the chatbot's responses, ensuring they are grounded in accurate data. 

OpenAI Whisper, LangChain, ApertureDB for Searching Podcasts for Insights

Podcasts are a fun and conversational way to learn and are a treasure trove of information described first hand. Imagine you are on your 100th podcast and want to know what you have learned so far about multimodal AI across the various interviews you did. Now that would be tough to do manually! That’s where this set of blog articles solves the problem. The first article details a project that integrates OpenAI Whisper, LangChain, and ApertureDB to transcribe podcasts and store them in ApertureDB for easy searching and analysis. It describes how Whisper, an automatic speech recognition (ASR) model, transcribes audio content, while ApertureDB is used to manage and query the resulting text data via its LangChain integration. This process facilitates extracting valuable insights from audio recordings efficiently.

The second article explores the use of semantic search to extract valuable information from transcribed podcast episodes. By leveraging the capabilities of LangChain and ApertureDB, users can perform sophisticated searches across large datasets of transcriptions. 

The third article discusses the implementation of an optimized RAG (Retrieval-Augmented Generation) workflow. It highlights techniques for fine-tuning AI models to reduce hallucinations and improve response accuracy. The workflow combines LangChain, ApertureDB, and various other tools to ensure that generated responses are based on precise and relevant data, thereby enhancing the overall effectiveness of AI-driven applications.

RAG Introduction, Optimization, Agentic Workflow

OSS4AI in collaboration with Microsoft Reactor conducted three workshops to teach attendees how to build a RAG application from the basics all the way to the complex. The first workshop covered what a RAG architecture looks like, the many tools you can use, some of the different pieces that go into RAG, and a live demonstration of creating an example built on ApertureDB. The second workshop was dedicated to RAG optimization concepts with a live coding example in the second half. The third and final workshop was about creating a cookbook for AI Agents (an AI that can use other software as tools!). 

Building Multimodal AI Applications

Combining different AI technologies, such as LLMs, embedding models, and a database like ApertureDB that is purpose-built for multimodal AI, can significantly enhance the ability to retrieve and generate relevant content. Here are some key takeaways derived from the various ways that people have built RAG workflows and AI agents using ApertureDB’s multimodal vector search, graph database, and multimodal data management capabilities:

  1. RAG Workflows and Practical Implementation: Detailed guides, like those for setting up RAG workflows with LangChain, LlamaIndex and ApertureDB, provide a robust framework for developers. These workflows enable the creation of semantic search chatbots and other AI applications that efficiently manage and query large datasets.
  2. Addressing AI Model Hallucinations: Improving chatbot accuracy involves addressing the issue of hallucinations, where AI models generate plausible but incorrect responses. Using tools like AIMon and ApertureDB to store and manage large datasets can help iteratively improve response accuracy and reliability.
  3. Real-World Applications of RAG: Practical examples of RAG applications, such as transcribing podcasts with OpenAI Whisper and performing semantic searches, showcase the versatility of RAG in extracting valuable insights from various data types. These applications highlight the importance of integrating multiple AI tools for enhanced performance.

Next Up - Improving Chatbots: Monitoring, GraphRAG and Multimodal RAG

Stay tuned for how we use some of our partner technologies to monitor and improve our documentation and responses from our chatbot. There is also a lot of exciting research taking place that builds on the basic RAG algorithm. Much of this is about hybridizing RAG with knowledge graphs, whether generated automatically from the text, assembled from structured data, or manually curated. Because ApertureDB combines high-performance vector search with a flexible graph database, it is ideally suited for such applications. 

We are currently not leveraging the full potential of ApertureDB's multimodal capabilities; it should be possible to not only index multimodal embeddings from our documentation but also respond with text, image, and video documents as sources of information. Imagine the possibilities!

Last but not least, don’t miss out on our ApertureData adventure – subscribe here to follow along with all the exciting updates! 

I want to acknowledge the insights and valuable edits from Sonam Gupta (AIXplain), Deniece Moxy.

Tags:

Related Blogs

Are Vector Databases Enough for Multimodal Data?
Videos & Podcasts
Are Vector Databases Enough for Multimodal Data?
AICamp talk with user examples showing the need to go beyond vector database...
Read More
Watch Now
Events
Minisode for The Data Product Management In Action podcast
Videos & Podcasts
Minisode for The Data Product Management In Action podcast
Explore Aperture\s mission to simplify the work of data scientists, engineers, and machine learning teams...
Read More
Watch Now
Industry Experts
ApertureDB Retail Data Sheet
Data Sheets
ApertureDB Retail Data Sheet
An overview of ApertureDB for Smart Retail / E-commerce
Read More
Watch Now
Applied
ApertureDB 2.0: Redefining Visual Data Management for AI
Blogs
ApertureDB 2.0: Redefining Visual Data Management for AI
A key to solving Visual AI challenges is to bring together the key learnings of...
Read More
Watch Now
Product
Building Real World RAG-based Applications with ApertureDB
Blogs
Building Real World RAG-based Applications with ApertureDB
Combining different AI technologies, such as LLMs, embedding models, and a database like ApertureDB that is purpose-built for multimodal AI, can significantly enhance the ability to retrieve and generate relevant content.
Read More
Managing Visual Data for Machine Learning and Data Science. Painlessly.
Blogs
Managing Visual Data for Machine Learning and Data Science. Painlessly.
Visual data or image/video data is growing fast. ApertureDB is a unique database...
Read More
What’s in Your Visual Dataset?
Blogs
What’s in Your Visual Dataset?
CV/ML users need to find, analyze, pre-process as needed; and to visualize their images and videos along with any metadata easily...
Read More
Transforming Retail and Ecommerce with Multimodal AI
Blogs
Transforming Retail and Ecommerce with Multimodal AI
Multimodal AI can boost retail sales by enabling better user experience at lower cost but needs the right infrastructure...
Read More
Vector Databases and Beyond for Multimodal AI: A Beginner's Guide Part 1
Blogs
Vector Databases and Beyond for Multimodal AI: A Beginner's Guide Part 1
Multimodal AI, vector databases, large language models (LLMs)...
Read More
How a Purpose-Built Database for Multimodal AI Can Save You Time and Money
Blogs
How a Purpose-Built Database for Multimodal AI Can Save You Time and Money
With extensive data systems needed for modern applications, costs...
Read More
Minute-Made Data Preparation with ApertureDB
Blogs
Minute-Made Data Preparation with ApertureDB
Working with visual data (images, videos) and its metadata is no picnic...
Read More
Why Do We Need A Purpose-Built Database For Multimodal Data?
Blogs
Why Do We Need A Purpose-Built Database For Multimodal Data?
Recently, data engineering and management has grown difficult for companies building modern applications...
Read More
Building a Specialized Database for Analytics on Images and Videos
Blogs
Building a Specialized Database for Analytics on Images and Videos
ApertureDB is a database for visual data such as images, videos, embeddings and associated metadata like annotations, purpose-built for...
Read More
Vector Databases and Beyond for Multimodal AI: A Beginner's Guide Part 2
Blogs
Vector Databases and Beyond for Multimodal AI: A Beginner's Guide Part 2
Multimodal AI, vector databases, large language models (LLMs)...
Read More
Challenges and Triumphs: Multimodal AI in Life Sciences
Blogs
Challenges and Triumphs: Multimodal AI in Life Sciences
AI presents a new and unparalleled transformational opportunity for the life sciences sector...
Read More
Your Multimodal Data Is Constantly Evolving - How Bad Can It Get?
Blogs
Your Multimodal Data Is Constantly Evolving - How Bad Can It Get?
The data landscape has dramatically changed in the last two decades...
Read More
Can A RAG Chatbot Really Improve Content?
Blogs
Can A RAG Chatbot Really Improve Content?
We asked our chatbot questions like "Can ApertureDB store pdfs?" and the answer it gave..
Read More
ApertureDB Now Available on DockerHub
Blogs
ApertureDB Now Available on DockerHub
Getting started with ApertureDB has never been easier or safer...
Read More
Are Vector Databases Enough for Visual Data Use Cases?
Blogs
Are Vector Databases Enough for Visual Data Use Cases?
ApertureDB vector search and classification functionality is offered as part of our unified API defined to...
Read More
Accelerate Industrial and Visual Inspection with Multimodal AI
Blogs
Accelerate Industrial and Visual Inspection with Multimodal AI
From worker safety to detecting product defects to overall quality control, industrial and visual inspection plays a crucial role...
Read More
ApertureDB 2.0: Redefining Visual Data Management for AI
Blogs
ApertureDB 2.0: Redefining Visual Data Management for AI
A key to solving Visual AI challenges is to bring together the key learnings of...
Read More
Stay Connected:
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.