Agentic RAG is a project that demonstrates the use of Retrieval-Augmented Generation (RAG) with Semantic Kernel and ChromaDB. This project includes various methods to build an AI agent capable of retrieving travel documents, augmenting user queries with semantic search results, and streaming detailed travel recommendations. The project is designed to showcase how RAG can be applied in real-world scenarios, particularly in the travel domain, to provide users with accurate and contextually relevant information.
This project was created by Shivam Goyal, You can connect with me on LinkedIn to discuss more about this project or other AI-related topics.
- Integration with ChromaDB: Efficiently retrieves relevant documents from a database to augment user queries with factual data.
- Semantic Kernel-based Plugins: Leverages advanced AI capabilities to enhance the functionality of the agent, making it more versatile and powerful.
- Travel-Related Query Support: Provides detailed information about travel destinations, including weather updates, attractions, and more.
- Streaming Chat History: Maintains a detailed history of user interactions, enabling seamless and context-aware conversations.
- Clone the Repository:
Begin by cloning the repository to your local machine using the following command:
git clone https://github.com/ShivamGoyal03/Agentic-RAG.git
- Navigate to the Project Directory:
Change your working directory to the
Agentic RAG
folder. - Install Dependencies:
Install the required Python packages by running:
pip install -r requirements.txt
- SQLite Configuration:
Ensure you have the correct version of SQLite installed. If you encounter any issues, you can resolve them by running the following code in the notebook:
# %pip install pysqlite3-binary # import sys # sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
- Open the Notebook:
Launch the
semantic-kernel-chromadb.ipynb
notebook in Jupyter Notebook or Jupyter Lab. - Initialize the Environment: Follow the step-by-step instructions in the notebook to set up the environment and initialize ChromaDB.
- Run the AI Agent: Execute the provided code cells to test the agent's capabilities. You can query travel destinations, retrieve weather information, and explore other functionalities.
- Experiment with Examples: Use the examples provided in the notebook to understand how the agent processes queries and generates responses.
Retrieval-Augmented Generation (RAG) enhances the capabilities of AI models by:
- Contextual Relevance: Retrieves and integrates information from external databases to provide accurate and contextually relevant responses.
- Reduced Hallucinations: Grounds the AI's responses in factual data, minimizing the risk of generating incorrect or misleading information.
- Dynamic Knowledge Integration: Allows the AI to adapt to new information and domain-specific knowledge without requiring extensive retraining.
Agentic RAG builds upon the foundational principles of basic RAG by introducing several advanced features:
- Semantic Kernel Integration: Utilizes plugins to extend the agent's functionality, enabling it to handle a wider range of tasks.
- Multi-Plugin Support: Supports multiple plugins for diverse use cases, such as retrieving weather data and providing travel recommendations.
- Enhanced User Interaction: Streams responses with detailed chat history and function call tracking, ensuring a more interactive and user-friendly experience.
This project includes code examples demonstrating Agentic RAG using various approaches:
- AutoGen with ChromaDB and Azure AI Search: Combines the power of ChromaDB and Azure AI Search to retrieve and augment data efficiently.
- Semantic Kernel with ChromaDB and Azure AI Search: Leverages Semantic Kernel to enhance the agent's capabilities and provide more accurate responses.
- Azure AI Agent Service with File Interpretation Tool: Demonstrates how to use Azure AI Agent Service for interpreting and processing files.
For a detailed walkthrough of these implementations, check out my article: AI Agents: Mastering Agentic RAG - Part 5
For more insights and detailed explanations, refer to the main repository: AI Agents for Beginners