AI AWS IAM Sentinel is an enterprise-grade GenAI assistant designed to provide precise, context-aware answers strictly from the AWS IAM User Guide. It leverages a robust RAG (Retrieval-Augmented Generation) pipeline to ensure high accuracy and security-focused responses.
Live Demo: https://ritesh-iam-sentinel.vercel.app/
- Context-Aware Q&A: Answers questions based solely on the official AWS IAM User Guide.
- Automated Data Pipeline: Automatically parses, chunks, and indexes the AWS IAM PDF guide into a vector database on startup.
- Hybrid Search: Combines semantic search (vector) with BM25 keyword matching for optimal retrieval.
- Enterprise-Ready: Built with FastAPI and Next.js, optimized for production deployments.
- Background Indexing: Performs heavy indexing tasks in a background thread to keep the service responsive.
- Frontend: Next.js (TypeScript, Tailwind CSS, Lucide React)
- Backend: FastAPI (Python 3.11)
- Vector Database: Qdrant Cloud
- LLM: OpenAI GPT-4o (via LangChain)
- Embeddings:
BAAI/bge-small-en-v1.5(running locally on CPU) - Orchestration: LangChain & LangGraph
- Ingestion: On startup, the system reads
iam-ug.pdf, chunks it using recursive character splitting, and uploads embeddings to Qdrant. - Retrieval: When a user asks a question, the system retrieves relevant chunks using the BGE embedding model.
- Generation: The context is passed to GPT-4o with a strict "answer only from context" prompt.
- Docker & Docker Compose
- OpenAI API Key
- Qdrant Cloud Account (Free tier works)
- Clone the repository.
- Create a
.envfile in the root directory (use.env.exampleas a template):cp .env.example .env
- Fill in your credentials:
OPENAI_API_KEY: Your OpenAI key.QDRANT_URL&QDRANT_API_KEY: Your Qdrant Cloud instance details.DATABASE_URL: Your database connection string (if using persistence).
The easiest way to run the entire system:
docker-compose up --build- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
This project is optimized for deployment on Render.
- The
Dockerfileincludes pre-caching of embedding models to prevent startup timeouts. - Use
docker-compose.prod.ymlfor production-grade configurations.
The project includes support for Hugging Face Spaces:
- See
backend/Dockerfile.hffor the specific HF configuration. - The system is designed to run efficiently on CPU-only environments.
├── backend/ # FastAPI Application
│ ├── app/ # Core logic, APIs, and services
│ ├── data/ # PDF source files
│ └── scripts/ # Utility scripts
├── frontend/ # Next.js UI
│ ├── src/ # Components and app logic
│ └── public/ # Static assets
├── data/ # Persistent data volume
└── docker-compose.yml # Orchestration
This project is for educational and enterprise demonstration purposes. Data source: AWS IAM User Guide.