AWS Builder Center
Swachh.ai: A Serverless GenAI Waste Assistant on AWS

Swachh.ai: A Serverless GenAI Waste Assistant on AWS

For the WeMakeDevs Environmental Hacks, I built Swachh.ai—a location-aware RAG decision assistant that helps Indian households dispose of hazardous waste safely. Here is how I deployed the Next.js and FastAPI architecture using zero-idle serverless AWS infrastructure.

Aspiring Cloud Engineer | Full-Stack Developer

♻️ The Problem: Household Hazardous Waste

Ordinary citizens generally know where a plastic bottle goes, but difficult, hazardous household waste creates massive confusion. Swollen power banks, fused CFL bulbs, and expired medicines often end up in regular trash, leading to severe environmental and safety hazards like truck compaction fires and toxic water contamination.
Generic AI chatbots fail here because they simply explain what an item is. I wanted to build something that tells citizens exactly what to do with it.

💡 The Solution: Swachh.ai

For the WeMakeDevs Environmental Hacks (Track 03 - Waste & Energy), I built Swachh.ai. It is a location-aware, regulation-grounded waste-disposal decision assistant.
Instead of generating a Wikipedia-style summary, it takes your multi-item waste input and your city, retrieves official Indian environmental laws (like the E-Waste and Battery Waste Management Rules), and generates an itemized, safe, and legally cited disposal plan using a Retrieval-Augmented Generation (RAG) architecture.

☁️ The Serverless AWS Architecture

As a solo developer, I wanted this project to be highly scalable without paying for idle EC2 instances. I built the cloud architecture strictly following AWS serverless best practices:
  • Amazon S3: Acts as the durable object repository for our authoritative government gazette documents and markdown knowledge source files.
  • Amazon ECR: Hosts the private production Docker container image ( swachh-ai-backend:latest ), which includes pre-ingested vector embeddings for incredibly fast cold starts.
  • Amazon ECS + AWS Fargate: Runs the live FastAPI and ChromaDB RAG backend on 100% serverless compute. This allows the API to scale automatically without managing any underlying virtual machines.
  • Amazon CloudWatch: Centralizes all ECS container logs and RAG retrieval metrics for real-time monitoring.

💻 The Tech Stack

  • Frontend: Next.js 16 (App Router), TypeScript, and Tailwind CSS (Hosted on Vercel)
  • Backend: FastAPI (Python 3.12) with Pydantic for typed schema validation
  • AI & RAG: Google Gemini AI, LangChain, local ChromaDB, and  all-MiniLM-L6-v2  embeddings
  • Cloud: AWS ECS, Fargate, ECR, S3, and CloudWatch

🚀 See It In Action

Building this solo for the WeMakeDevs hackathon was an incredible experience that deeply solidified my cloud deployment fundamentals. Let's build a cleaner future!
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article