A serverless AI chat application that answers questions about Sri Lankan legal acts and related documents using Retrieval-Augmented Generation (RAG) with LangChain.js and Azure.
Demo: live app 😊.
- Modern Chat UI built with Lit and hosted on Azure Static Web Apps
- Serverless API using Azure Functions and LangChain.js
- Document-grounded Q&A over official Sri Lankan legal PDFs
- GPT-4o mini as the backend AI model for intelligent responses
- Citations in answers for transparency
- Personal chat history
- Easy deployment to Azure with
azd deploy - Local development supported with Ollama
- PDFs in the
data/folder are ingested, chunked, and embedded for semantic search. - User questions are matched to relevant document chunks using vector search.
- GPT-4o mini generates intelligent answers grounded in the source documents and includes citations.
- All major Sri Lankan acts and amendments are included as PDFs.
- Deploy to Azure with:
azd deploy
- Or just the webapp:
azd deploy --service webapp
- Run locally with Ollama or Azure OpenAI.
- See the full documentation for setup instructions.
- All legal and policy PDFs are in the
data/folder.
MIT
Built with ❤️ using Azure AI, LangChain.js, and a commitment to legal accessibility
