https://github.com/sushant1827/agentic-rag-deepseek
Project demonstrates an agentic Retrieval-Augmented Generation (RAG) application built using CrewAI and Streamlit.
https://github.com/sushant1827/agentic-rag-deepseek
agentic-rag chatbot crewai deepseek-r1 local-llm multi-agent-systems ollama retrieval-augmented-generation serperapi streamlit
Last synced: about 1 month ago
JSON representation
Project demonstrates an agentic Retrieval-Augmented Generation (RAG) application built using CrewAI and Streamlit.
- Host: GitHub
- URL: https://github.com/sushant1827/agentic-rag-deepseek
- Owner: sushant1827
- Created: 2025-03-24T15:29:46.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-24T15:32:17.000Z (7 months ago)
- Last Synced: 2025-07-31T13:32:32.904Z (2 months ago)
- Topics: agentic-rag, chatbot, crewai, deepseek-r1, local-llm, multi-agent-systems, ollama, retrieval-augmented-generation, serperapi, streamlit
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Agentic RAG Application with CrewAI and Streamlit
This project demonstrates an agentic Retrieval-Augmented Generation (RAG) application built using CrewAI and Streamlit. It allows users to upload a PDF document and then ask questions about its content, leveraging the power of Large Language Models (LLMs) and intelligent agents.
## Project Preview

## Features
- **PDF Document Upload:** Users can upload PDF files directly through the Streamlit interface.
- **PDF Indexing:** The application indexes the uploaded PDF, making its content searchable.
- **Agentic RAG:** Employs a CrewAI-powered crew of agents to handle information retrieval and response generation.
- **Web Search Fallback:** If information is not found in the PDF, the system intelligently falls back to web search using the Serper API.
- **Conversational Interface:** Provides a user-friendly chat interface for interacting with the system.
- **Clear Chat History:** Users can easily clear the chat history and start fresh.
- **Real-time Response:** The application displays the LLM's response in a streaming fashion, providing a more engaging user experience.
- **Local LLM Support:** Uses Ollama to run a local LLM (deepseek-r1:14b)## How It Works
The application uses a crew of two agents:
1. **Retriever Agent:**
- Responsible for retrieving relevant information based on the user's query.
- Prioritizes searching the uploaded PDF.
- Falls back to web search if the PDF doesn't contain the answer.
- Uses `PDFSearchTool` and `SerperDevTool`.
2. **Response Agent:**
- Synthesizes the retrieved information into a clear and concise response.
- Handles cases where no relevant information is found.These agents work together sequentially to provide accurate and helpful answers to user queries.
## Technologies Used
- **CrewAI:** A framework for orchestrating multi-agent systems.
- **Streamlit:** A Python library for creating interactive web applications.
- **Ollama:** For running the local LLM.
- **Deepseek-r1:14b:** The specific LLM used in this project.
- **Serper API:** For web search capabilities.
- **PDFSearchTool:** A custom tool for searching PDF documents.
- **Python:** The primary programming language.
- **dotenv:** For managing environment variables.## Prerequisites
- **Python 3.8+**
- **Ollama:** You need to have Ollama installed and running locally.
- **Serper API Key:** You'll need a Serper API key for web search functionality.
- **Required Python Packages:**
```bash
pip install streamlit crewai crewai-tools python-dotenv
```## Installation and Setup
1. **Clone the Repository:**
```bash
git clone
cd
```
2. **Install Dependencies:**
```bash
pip install -r requirements.txt
```
(You can create a `requirements.txt` file with the following content:
```
streamlit
crewai
crewai-tools
python-dotenv
```
)
3. **Set Environment Variables:**
- Create a `.env` file in the project's root directory.
- Add your Serper API key:
```
SERPER_API_KEY=your_serper_api_key_here
```
4. **Run Ollama:**
- Make sure you have Ollama installed and running.
- Pull the deepseek-r1:14b model:
```bash
ollama pull deepseek-r1:14b
```
5. **Run the Streamlit App:**
```bash
streamlit run rag_app.py
```## Usage
1. **Upload a PDF:** In the sidebar, use the file uploader to select and upload a PDF document.
2. **Wait for Indexing:** The application will index the PDF. This may take a few moments.
3. **Ask Questions:** In the chat interface, type your questions about the PDF content.
4. **View Responses:** The system will provide answers based on the PDF content or, if necessary, from the web.
5. **Clear Chat:** Use the "Clear Chat" button in the sidebar to reset the conversation.---