Projects

Apr 2026 - Present

Apnavakil

Built an AI-powered legal assistant that helps users understand their rights and legal options through natural language conversations. Implemented a RAG pipeline using PostgreSQL (pgvector) to retrieve relevant constitutional and legal references, enabling context-aware and evidence-based responses. Designed a scalable backend with AI orchestration, document ingestion, semantic search, Redis/BullMQ background processing, and cloud-native deployment architecture.

Apnavakil
Next.js
Next.js
TypeScript
TypeScript
Node.js
Node.js
Supabase
Supabase
Redis
Redis
pgvector
pgvector
Google Gemini
Google Gemini
Docker
Docker
RAG (GenAI)
RAG

ApnaVakil is an AI-powered legal assistance platform designed to help citizens understand their rights, legal options, and next steps through natural language conversations.

The platform enables users to describe real-world situations in simple language, such as traffic disputes, police interactions, cyber fraud, consumer complaints, workplace issues, and other legal concerns. The AI assistant analyzes user queries, retrieves relevant legal and constitutional information through a Retrieval-Augmented Generation (RAG) pipeline, and provides context-aware guidance in an easy-to-understand format.

The backend is built using Node.js, TypeScript, PostgreSQL (Supabase), pgvector, Redis, and BullMQ. Legal documents such as constitutional provisions and legal references are processed through a document ingestion pipeline where PDFs are parsed, chunked, embedded, and indexed for semantic search. The system leverages vector similarity search to retrieve relevant legal context and combines it with Google's Gemini models to generate grounded, structured, and user-friendly responses.

For voice interactions, the platform integrates OpenAI Whisper Large V3 Turbo through the Hugging Face Inference API for Speech-to-Text (STT) and ElevenLabs for natural Text-to-Speech (TTS), enabling future voice-based legal assistance workflows.

Key Features

  • AI-powered legal guidance and citizen rights assistance
  • Constitutional and legal document retrieval using RAG
  • Semantic search with pgvector embeddings
  • Conversational AI orchestration layer
  • Background document processing and embedding generation using BullMQ and Redis
  • Voice-enabled architecture using Whisper Large V3 Turbo and ElevenLabs
  • Conversation history and context management
  • Scalable backend architecture with PostgreSQL and Supabase
  • Cloud-native deployment using Docker and Google Cloud Run

Tech Stack

Node.js, TypeScript, Fastify, PostgreSQL, Supabase, Prisma, pgvector, Redis, BullMQ, Docker, Google Cloud Run, Gemini, Whisper Large V3 Turbo, ElevenLabs, AI/LLM Integration, Retrieval-Augmented Generation (RAG)