Liberal democracies are built on the rule of law, among other things. Legislation enforces and protects citizens' rights, and ensures that governments' powers are limiteed and its actions are properly scrutinized. However, modern nation states have enormous legal corpuses, making it very difficult for the common citizen to oversee and understand fully. This chatbot is aimed at helping Iraqi citizens and NGOs easily access, in a conversational setting, the Iraqi law corpus and ask questions about it.
The chatbot is based on Retrieval Augmented Generation, a technique that allows LLMs to parse large corpuses of documents and retrieve only the relevant ones based on a specific user query. This techniques allows LLMs to expand their knowledge (as, most likely, Iraqi legislation was not a prevalent source in the original training of modern LLMs) and provide accurate answers without hallucinating.
The LLM used in this project is gemini-2.5-flash-lite (pay-as-you-go - I'm a volunteer, be considerate with the amount of queries!). The embedding model is gemini-embedding-001 and the reranking model is semantic-reranker-512. Embedding vectors are stored and retrieved using Qdrant. The web app is built using Flask and styled with Bootstrap 5. (This Udemy course was very helpful to get started with Flask!)
© 2026 KOHRW. All rights reserved.