AI-Powered PDF Question Answering System using CrewAI and Groq
Upload any PDF and ask questions - get complete, AI-generated answers powered by advanced language models!
- 📄 PDF Upload & Search - Upload any PDF document and ask questions
- 🤖 AI-Powered Answers - Complete, coherent responses using state-of-the-art LLMs
- 🎯 Smart Search - Searches PDF first, then web if needed (optional)
- 🔑 User-Provided API Keys - Secure, no hardcoded secrets
- 🎨 Model Selection - Choose from multiple Groq models
- 💰 100% FREE - Uses FREE Groq API (no OpenAI costs!)
- 🚀 Fast & Reliable - Powered by Groq's lightning-fast inference
- 🔒 Privacy-Focused - Your API keys and documents are never stored
Get your FREE Groq API key (no credit card required):
- Go to: console.groq.com
- Sign up for FREE
- Get your API key
# Clone the repository
git clone https://github.com/YOUR_USERNAME/agentic-rag-pdf-qa.git
cd agentic-rag-pdf-qa
# Install dependencies
pip install -r requirements.txt
# Run the app
streamlit run app_final.py- Enter your Groq API key in the sidebar
- Select a model (Llama 3.3 70B recommended)
- Upload a PDF document
- Ask questions and get AI-powered answers!
- Python 3.10 or higher
- pip
pip install -r requirements.txtstreamlit- Web interfacecrewai- AI agent frameworkmarkitdown- PDF text extractionchonkie- Semantic chunkingqdrant-client- Vector databasefastembed- Fast embeddingspython-dotenv- Environment variables
-
Push to GitHub
git init git add . git commit -m "Initial commit" git push origin main
-
Deploy on Streamlit Cloud
- Go to share.streamlit.io
- Connect your GitHub repository
- Select
app_final.pyas the main file - Deploy!
-
No Secrets Needed!
- Users will enter their own API keys in the UI
- No need to configure secrets in Streamlit Cloud
- Frontend: Streamlit
- LLM: Groq API (Llama 3.3 70B, Mixtral, Gemma)
- PDF Processing: MarkItDown
- Vector Search: Qdrant + Chonkie
- AI Agents: CrewAI
- Web Search: FireCrawl (optional)
- PDF Upload: User uploads a PDF document
- Indexing: PDF is converted to text and chunked semantically
- Vector Storage: Chunks are stored in Qdrant vector database
- Question: User asks a question
- Retrieval: AI agent searches PDF for relevant information
- Synthesis: AI synthesizes a complete answer from retrieved chunks
- Response: User gets a coherent, AI-generated answer
- Llama 3.3 70B (Recommended) - Best quality, comprehensive answers
- Llama 3.1 8B - Faster responses, good quality
- Mixtral 8x7B - Excellent reasoning capabilities
- Gemma 2 9B - Balanced performance
✅ No OpenAI costs - Uses FREE Groq API
✅ Complete answers - Not just chunks, full AI synthesis
✅ Privacy-focused - API keys never stored
✅ Fast - Groq's inference is lightning fast
✅ Easy to deploy - One-click Streamlit Cloud deployment
✅ User-controlled - Users provide their own API keys
✅ Model choice - Select the best model for your needs
- ✅ API keys are never stored - only used during your session
- ✅ PDFs are processed locally in temporary storage
- ✅ No data is sent to external servers except Groq API
- ✅ Session data is cleared when you close the browser
agentic-rag-pdf-qa/
├── app_final.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── README.md # This file
├── DEPLOYMENT_GUIDE.md # Detailed deployment instructions
├── .gitignore # Git ignore rules
├── knowledge/ # Sample PDF files
│ └── dspy.pdf # Example document
└── src/
└── agentic_rag/
└── tools/
└── custom_tool.py # Custom search tools
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - Feel free to use and modify!
- CrewAI - AI agent framework
- Groq - FREE, fast LLM inference
- Streamlit - Amazing web framework
- Qdrant - Vector database
- Chonkie - Semantic chunking
Built with ❤️ for the AI community