A powerful AI assistant that combines Retrieval-Augmented Generation (RAG) with Web Search capabilities, powered by Groq's ultra-fast LLM.
- 📄 PDF Document Q&A (RAG): Upload any PDF and ask questions about its content
- 🌐 Real-time Web Search: Get current information from the internet using Serper
- 🧠 Smart Tool Selection: The agent automatically decides whether to search your document or the web
- ⚡ Ultra-Fast Responses: Powered by Groq's lightning-fast inference
| Component | Technology |
|---|---|
| LLM | Groq (Llama 3 / Mixtral) |
| Embeddings | HuggingFace (sentence-transformers) |
| Vector Store | FAISS |
| Web Search | Serper API |
| Orchestration | LangChain |
| UI | Streamlit |
- Groq API Key: console.groq.com - Create a free account
- Serper API Key: serper.dev - Free 2,500 searches
# Clone the repository
git clone <your-repo-url>
cd agentic_Ai_assignment
# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Create .env file with your keys
cp .env.example .env
# Edit .env and add your API keys
# Run the app
streamlit run app.py- Enter your API keys in the sidebar (or set them in
.env) - (Optional) Upload a PDF document for RAG functionality
- Start chatting! The agent will:
- Search your PDF for document-specific questions
- Search the web for current events and general knowledge
git init
git add .
git commit -m "Initial commit: RAG + Web Search Agent"
git remote add origin <your-github-repo-url>
git push -u origin main- Go to share.streamlit.io
- Click "New app"
- Connect your GitHub repository
- Select
app.pyas the main file
In your Streamlit app settings, go to Secrets and add:
GROQ_API_KEY = "gsk_your_actual_groq_key_here"
SERPER_API_KEY = "your_actual_serper_key_here"- "Summarize the main points from the document"
- "What does the document say about [specific topic]?"
- "Find information about [keyword] in the PDF"
- "What's the latest news about AI?"
- "Who won the latest FIFA World Cup?"
- "What is the current stock price of Tesla?"
agentic_Ai_assignment/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── .env # Your actual API keys (don't commit!)
├── .gitignore # Git ignore file
└── README.md # This file
- The first PDF processing might take a moment as it downloads the embedding model
- HuggingFace embeddings run locally on CPU (no API key needed)
- Groq has generous free tier limits for the LLM
- Serper provides 2,500 free searches
This project is for educational purposes - University Assignment.