Skip to content

ApurvaPatil2401/rag-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

** 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"

📁 Project Structure

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

Features

  • Query executive documents using natural language
  • RAG pipeline with custom tools
  • MySQL backend integration
  • Frontend with HTML + Tailwind CSS
  • FastAPI-based chat interface

Setup

  1. Clone the repository

git clone https://github.com/ApurvaPatil2401/rag-agent.git

cd rag-agent

  1. Create & activate virtual environment

python -m venv venv

source venv/bin/activate # On Windows: venv\Scripts\activate

  1. Install dependencies

pip install -r requirements.txt

  1. 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.

  2. Run the pipeline

cd pipeline

python loader.py

  1. Start the backend API

cd api

uvicorn server:app --reload

  1. 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

image

image

About

RAG Agent using local LLM with function calling and document retrieval

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors