Skip to content
Artificial Intelligence

HukukMind

An AI-powered legal assistant specialised in Turkish law, built by our team Core-AF. It runs on a RAG architecture: answers are grounded in a knowledge base of precedent court rulings and the text of the Constitution, and every answer cites the article it relies on. The project won second place at the AI event organised by Gİ-TEK.

Year
2026
Category
Artificial Intelligence
Tech stack
RAG · Python · FastAPI · LangChain · ChromaDB · PostgreSQL · Next.js
HukukMind
HukukMind — 2

Overview

The answer to a legal question is usually somewhere in the legislation, but finding the right article takes domain knowledge. General-purpose language models, on the other hand, easily drift into making things up when answering such questions. We built HukukMind where those two problems meet: the model does not answer freely, it answers by looking at the legal texts it has been given.

To ground the answers in real sources we prepared a dataset of close to 500,000 records containing precedent court rulings and the Constitution of the Republic of Türkiye. We vectorised the texts with HuggingFace Embeddings and stored them locally in ChromaDB. Before answering, the model retrieves the relevant provisions from this database, builds its answer on top of them and cites the article it used.

The backend runs on Python, FastAPI and LangChain, which carry the LLM chains and the asynchronous REST API. To read the intent behind an incoming question and route it to the right flow, we wrote a Semantic Router layer. PostgreSQL handles session management and lets the assistant remember earlier messages without losing context. Answers stream token by token over SSE (Server-Sent Events), so there is no waiting for the full response.

We built the interface with Next.js 16, React 19 and Tailwind CSS v4. Markdown support, source citations and dark mode are its highlights, and the chat history is kept in the left panel under topic titles.

I developed the project together with my teammate Muhammed Ali Altın under the name Core-AF. While laying its foundations, the technical background and problem-solving approach we gained from the Genç2030 training programme was our main guide. HukukMind is still under active development; we would love to release it as soon as possible.

Highlights

  • 01RAG architecture grounding answers in the Constitution and precedent rulings, with citations
  • 02A legal dataset of nearly 500,000 records in a ChromaDB vector database
  • 03Semantic Router layer that reads the question's intent and picks the right flow
  • 04Session management and conversation memory on PostgreSQL
  • 05Real-time answers streaming token by token over SSE
  • 06Second place at the Gİ-TEK artificial intelligence event