Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Repository files navigation

🏛️ GovRAG - Intelligent Government Scheme & Policy Retrieval using Retrieval-Augmented Generation (RAG)

GovRAG is an AI-powered Retrieval-Augmented Generation (RAG) system designed to help government officials efficiently retrieve information from large collections of government schemes, policies, circulars, and official documents.

Instead of manually searching through hundreds of documents, the system performs semantic search over indexed government knowledge and generates accurate, context-aware responses using Large Language Models (LLMs).


📌 Problem Statement

Government departments maintain thousands of policy documents, schemes, guidelines, and notifications. Retrieving relevant information from these documents using traditional keyword search is time-consuming and often fails to capture the user's intent.

GovRAG addresses this challenge by combining semantic search with Retrieval-Augmented Generation (RAG), enabling intelligent retrieval of relevant information and reducing the time required to access government knowledge.


🚀 Features

  • 📄 Process large collections of government documents
  • 🔍 Semantic search using vector embeddings
  • 🤖 AI-generated responses grounded in retrieved documents
  • 📚 Context-aware policy and scheme retrieval
  • ⚡ Fast document retrieval using vector databases
  • 🧠 Embedding-based similarity search
  • 📖 Source-aware responses
  • 📊 Scalable knowledge retrieval pipeline

🏗️ System Architecture

Government Documents
(PDFs, Policies, Schemes, Circulars)
                │
                ▼
        Document Processing
                │
    ┌──────────────────────────┐
    │ Text Extraction          │
    │ Cleaning                 │
    │ Chunking                 │
    │ Embedding Generation     │
    └──────────────────────────┘
                │
                ▼
          Vector Database
                ▲
                │
      Government Officer Query
                │
                ▼
      Query Embedding Generation
                │
                ▼
      Semantic Similarity Search
                │
                ▼
     Retrieve Relevant Chunks
                │
                ▼
      LLM + Retrieved Context
                │
                ▼
       Contextual Response

⚙️ Technology Stack

Programming Language

  • Python

Frontend

  • Streamlit

AI Technologies

  • Retrieval-Augmented Generation (RAG)
  • Large Language Models (LLMs)
  • Sentence Embeddings
  • Knowledge Graph Integration

Vector Database

  • ChromaDB / FAISS

Libraries

  • LangChain
  • Hugging Face
  • Sentence Transformers
  • PyMuPDF
  • NumPy
  • Pandas

📂 Project Workflow

Document Ingestion Pipeline

The ingestion pipeline processes government documents before they become searchable.

Steps include:

  • Extract text from documents
  • Clean and preprocess text
  • Split documents into chunks
  • Generate embeddings
  • Store embeddings inside the vector database

Retrieval Pipeline

When a government official submits a query:

  • Convert the query into an embedding
  • Perform semantic similarity search
  • Retrieve the most relevant document chunks
  • Provide retrieved context to the LLM
  • Generate an accurate response grounded in official documents

📚 Why Retrieval-Augmented Generation?

Traditional LLMs rely only on pretrained knowledge and may generate outdated or hallucinated information.

RAG improves reliability by retrieving relevant information from official government documents before generating responses.

Benefits include:

  • Reduced hallucinations
  • Faster policy retrieval
  • Improved answer accuracy
  • Access to updated government documents
  • Better decision support

📁 Project Structure

GovRAG/

│
├── frontend/
│
├── chunking.py
├── ingestion_pipeline.py
├── retrieval.py
├── vectorization.py
├── evaluation.py
├── verification.py
├── ingestion_with_images.py
│
├── graph_rag/
│
├── data/
│
├── requirements.txt
│
└── README.md

🔄 RAG Workflow

Government Documents
        │
        ▼
Text Extraction
        │
        ▼
Chunking
        │
        ▼
Embedding Generation
        │
        ▼
Vector Database
        ▲
        │
User Query
        │
        ▼
Query Embedding
        │
        ▼
Semantic Search
        │
        ▼
Relevant Chunks
        │
        ▼
Large Language Model
        │
        ▼
Generated Response

🎯 Future Improvements

  • Hybrid Search (Keyword + Semantic Search)
  • Metadata Filtering
  • Multi-document Reasoning
  • Agentic RAG
  • Graph RAG Enhancements
  • OCR Support
  • Citation Generation
  • Query Expansion
  • Response Evaluation Dashboard

💡 Applications

  • Government Departments
  • Public Administration
  • Policy Analysis
  • Scheme Discovery
  • Administrative Decision Support
  • Citizen Service Portals
  • Government Knowledge Management

🧠 Learning Outcomes

This project demonstrates practical implementation of:

  • Retrieval-Augmented Generation (RAG)
  • Semantic Search
  • Embedding Models
  • Vector Databases
  • Knowledge Graph Integration
  • Prompt Engineering
  • Document Processing Pipelines
  • AI-powered Information Retrieval

👥 Contributors

Developed as part of an AI-powered Government Knowledge Retrieval System that leverages Retrieval-Augmented Generation (RAG), semantic search, and knowledge graph integration to improve the retrieval of government schemes and policy documents.

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages