Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🤖 RAG + Web Search Agent

A powerful AI assistant that combines Retrieval-Augmented Generation (RAG) with Web Search capabilities, powered by Groq's ultra-fast LLM.

🌟 Features

  • 📄 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

🛠️ Tech Stack

Component Technology
LLM Groq (Llama 3 / Mixtral)
Embeddings HuggingFace (sentence-transformers)
Vector Store FAISS
Web Search Serper API
Orchestration LangChain
UI Streamlit

🚀 Quick Start

1. Get Your API Keys (Free!)

2. Local Setup

# 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

3. Using the App

  1. Enter your API keys in the sidebar (or set them in .env)
  2. (Optional) Upload a PDF document for RAG functionality
  3. Start chatting! The agent will:
    • Search your PDF for document-specific questions
    • Search the web for current events and general knowledge

☁️ Deploy to Streamlit Cloud

Step 1: Push to GitHub

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

Step 2: Deploy on Streamlit Cloud

  1. Go to share.streamlit.io
  2. Click "New app"
  3. Connect your GitHub repository
  4. Select app.py as the main file

Step 3: Add Secrets

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"

📝 Example Questions

For PDF Documents:

  • "Summarize the main points from the document"
  • "What does the document say about [specific topic]?"
  • "Find information about [keyword] in the PDF"

For Web Search:

  • "What's the latest news about AI?"
  • "Who won the latest FIFA World Cup?"
  • "What is the current stock price of Tesla?"

🏗️ Project Structure

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

⚠️ Important Notes

  • 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

📄 License

This project is for educational purposes - University Assignment.


About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages