How sghangs/insurancevirtualagent works
Project type and purpose
• This is a full-stack, cloud-native RAG (Retrieval-Augmented Generation) chatbot called “Insurance Virtual Agent.”
• Purpose: Ingest PDF policy documents into a vector store via AWS Lambda, then answer user queries by retrieving and augmenting policy data with OpenAI LLMs, all exposed through a lightweight frontend and API.
File structure
• Top-level service folders:
• LambdaSetup – code, Dockerfile, and requirements for the S3-triggered Lambda that tokenizes PDFs and pushes embeddings to Pinecone.
• backend – FastAPI (main.py) and Dockerfile exposing the RAG inference API (self-RAG agent).
• frontend – Streamlit app (app.py) packaged in its own Dockerfile for user interaction.
• evaluation – scripts and components to generate synthetic data and run automated model evaluations.
• src – core library modules (entity definitions, pipeline orchestration, retriever, prompts, logging, utilities).
• Configuration/deployment:
• docker-compose.yml for local integration of frontend, backend, and possibly a local vector DB stub.
• .github/workflows/deploy.yml for CI/CD.
• Data and logs:
• .vector_db – sample vector store snapshots.
• logs/ and src/logs – runtime logs for each component.
README for additional insights
• Architectural description: S3 → S3-notify → AWS Lambda ingestion → Pinecone vector index → API retrieval → LLM (gpt-4o) → user.
• Tech stack callouts: Python, AWS S3, Lambda, ECR, Pinecone, LangChain, LangGraph, OpenAI GPT-4, Streamlit, FastAPI, Docker, AWS EC2.
Detail without overcomplication
• Essential components listed above
• Configuration/deployment artifacts (Dockerfiles, GitHub Actions) as annotations or a separate “DevOps” lane
• Metadata filtering, hybrid search, and agentic RAG as callouts on the retrieval path