** RAG Agent **
This project implements a Retrieval-Augmented Generation (RAG) Agent that allows users to interact with U.S. federal government documents (like executive orders, memoranda, etc.) through a natural language interface.
Users can ask questions like:
- "Show documents signed by Trump between May 20 and May 25, 2025"
- "Summarize all executive orders from the past 10 days"
- "Were any memorandums published recently?"
In addition to querying federal documents, the chatbot can also answer general questions and casual queries, such as:
- "What is Newton’s 3rd law?"
- "Tell me a joke"
rag_agent_project/
├── agent/ # RAG agent logic (prompts, tools, routing)
├── api/ # FastAPI backend
├── db/ # Database connector
├── pipeline/ # ETL pipeline (fetch, clean, load federal data)
├── ui/ # Simple HTML frontend
├── venv/ # Python virtual environment (excluded from Git)
├── .gitignore
├── README.md
├── requirements.txt
- Query executive documents using natural language
- RAG pipeline with custom tools
- MySQL backend integration
- Frontend with HTML + Tailwind CSS
- FastAPI-based chat interface
- Clone the repository
git clone https://github.com/ApurvaPatil2401/rag-agent.git
cd rag-agent
- Create & activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
-
Configure MySQL Make sure you have a MySQL server running. Create a database named federal_data, and create a table named federal_documents as per your pipeline logic.
-
Run the pipeline
cd pipeline
python loader.py
- Start the backend API
cd api
uvicorn server:app --reload
- Open the frontend
Open ui/index.html in a browser. Start chatting!
📦 Example Queries Show documents signed by Trump in April 2025
Summarize executive orders from the last 2 weeks
Did any memorandums get published last week?
📜 License This project is for educational/demo purposes.
#sample output

