How srujanrana07/rag-based-policy-agent works
Project Type and Purpose
• This is a focused, enterprise-grade Retrieval-Augmented Generation (RAG) system, exposed as a Flask REST API.
• Purpose: ingest and preprocess policy PDFs, build a searchable FAISS vector index of embeddings, and answer policy questions via Google Gemini LLM, all with strict context grounding.
File Structure Analysis
• Flat root directory with key modules (app.py/main.py as entrypoints).
• document_loader.py & deploy.sh: ingestion & deployment glue.
• vectorizer.py & retriever.py: embedding and search logic.
• gpt_client.py & submitter.py: LLM orchestration and query submission.
• Temporary/state files (answers_output.json, temp.json, log.txt) show runtime data flow.
• requirements.txt, .gitignore, Docker-ready deploy.sh signal containerized, Python-based micro-services.
README Insights
• Layers: PDF rendering (GhostScript) → Table extraction (Camelot-py) → Semantic embedding (Sentence Transformers) → Vector search (FAISS) → Reasoning (Gemini).
• Emphasis on modular Flask endpoints: /upload, /extract, /query.