Hukm
AI legal research for Saudi law professionals
A lawyer asks a question in Arabic and gets an answer grounded in real Saudi court rulings and regulations, with the ruling, volume and page it came from.
What I built
- A security audit of the Node.js and PostgreSQL backend with its critical findings fixed (an authentication bypass, cross user data access, unauthenticated WebSockets and a leaked API key), deployed through GitLab CI with test and secret scan gates.
- Reworked Redis caching: a per user billing cache after the audit, and versioned search cache keys so a fix never serves stale results.
- Hybrid vector and keyword search in Qdrant over 30,000+ Saudi court cases, 500+ regulations and 13 volumes of judicial rulings, with answers that cite the exact ruling, volume and page.
- The first version on self hosted models on a GPU server: Qwen and Llama through Ollama, a custom Saudi law model, and the HunyuanOCR vision model, with a scheduler that shares one GPU between OCR and the LLM.
- The Arabic OCR ingestion pipeline and a multi agent research pipeline, and a full rebuild of the embeddings when the platform moved to cloud models, which brought semantic search back.
- 1Question in Arabic
- 2Search, validation and web research agents
- 3Rerank the evidence
- 4Hybrid search in Qdrant
- 5Answer citing ruling, volume and page