|
| 1 | +# Agentic RAG with LangGraph: AI Blog Search |
| 2 | + |
| 3 | +## Overview |
| 4 | +AI Blog Search is an Agentic RAG application designed to enhance information retrieval from AI-related blog posts. This system leverages LangChain, LangGraph, and Google's Gemini model to fetch, process, and analyze blog content, providing users with accurate and contextually relevant answers. |
| 5 | + |
| 6 | +## LangGraph Workflow |
| 7 | + |
| 8 | + |
| 9 | +## Demo |
| 10 | +https://github.com/user-attachments/assets/cee07380-d3dc-45f4-ad26-7d944ba9c32b |
| 11 | + |
| 12 | +## Features |
| 13 | +- **Document Retrieval:** Uses Qdrant as a vector database to store and retrieve blog content based on embeddings. |
| 14 | +- **Agentic Query Processing:** Uses an AI-powered agent to determine whether a query should be rewritten, answered, or require more retrieval. |
| 15 | +- **Relevance Assessment:** Implements an automated relevance grading system using Google's Gemini model. |
| 16 | +- **Query Refinement:** Enhances poorly structured queries for better retrieval results. |
| 17 | +- **Streamlit UI:** Provides a user-friendly interface for entering blog URLs, queries and retrieving insightful responses. |
| 18 | +- **Graph-Based Workflow:** Implements a structured state graph using LangGraph for efficient decision-making. |
| 19 | + |
| 20 | +## Technologies Used |
| 21 | +- **Programming Language**: [Python 3.10+](https://www.python.org/downloads/release/python-31011/) |
| 22 | +- **Framework**: [LangChain](https://www.langchain.com/) and [LangGraph](https://langchain-ai.github.io/langgraph/tutorials/introduction/) |
| 23 | +- **Database**: [Qdrant](https://qdrant.tech/) |
| 24 | +- **Models**: |
| 25 | + - Embeddings: [Google Gemini API (embedding-001)](https://ai.google.dev/gemini-api/docs/embeddings) |
| 26 | + - Chat: [Google Gemini API (gemini-2.0-flash)](https://ai.google.dev/gemini-api/docs/models/gemini#gemini-2.0-flash) |
| 27 | +- **Blogs Loader**: [Langchain WebBaseLoader](https://python.langchain.com/docs/integrations/document_loaders/web_base/) |
| 28 | +- **Document Splitter**: [RecursiveCharacterTextSplitter](https://python.langchain.com/v0.1/docs/modules/data_connection/document_transformers/recursive_text_splitter/) |
| 29 | +- **User Interface (UI)**: [Streamlit](https://docs.streamlit.io/) |
| 30 | + |
| 31 | +## Requirements |
| 32 | +1. **Install Dependencies**: |
| 33 | + ```bash |
| 34 | + pip install -r requirements.txt |
| 35 | + ``` |
| 36 | + |
| 37 | +2. **Run the Application**: |
| 38 | + ```bash |
| 39 | + streamlit run app.py |
| 40 | + ``` |
| 41 | + |
| 42 | +3. **Use the Application**: |
| 43 | + - Paste your Google API Key in the sidebar. |
| 44 | + - Paste the blog link. |
| 45 | + - Enter your query about the blog post. |
| 46 | + |
| 47 | +## :mailbox: Connect With Me |
| 48 | +<img align="right" src="https://media.giphy.com/media/2HtWpp60NQ9CU/giphy.gif" alt="handshake gif" width="150"> |
| 49 | + |
| 50 | +<p align="left"> |
| 51 | + <a href="https://linkedin.com/in/codewithcharan" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/linked-in-alt.svg" alt="codewithcharan" height="30" width="40" style="margin-right: 10px" /></a> |
| 52 | + <a href="https://instagram.com/joyboy._.ig" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/instagram.svg" alt="__mr.__.unique" height="30" width="40" /></a> |
| 53 | + <a href="https://twitter.com/Joyboy_x_" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/twitter.svg" alt="codewithcharan" height="30" width="40" style="margin-right: 10px" /></a> |
| 54 | +</p> |
| 55 | + |
| 56 | +<img src="https://readme-typing-svg.herokuapp.com/?font=Righteous&size=35¢er=true&vCenter=true&width=500&height=70&duration=4000&lines=Thanks+for+visiting!+👋;+Message+me+on+Linkedin!;+I'm+always+down+to+collab+:)"/> |
0 commit comments