LLM & Retrieval · 2025

LawBot

Document-grounded legal research with hybrid retrieval

A document-grounded legal assistant for Indonesian TNI law revisions, combining fine-tuned language models with hybrid retrieval and reranking.

  • PyTorch
  • Transformers
  • QLoRA
  • LangChain
  • ChromaDB
  • Streamlit
RAG / 01HybridBM25 · semantic · reranking

Problem worth solving

Make Indonesian TNI law revision material easier to query while keeping generated answers grounded in the underlying legal documents.

Engineering decisions

  1. Built a document pipeline for cleaning, chunking, tokenization, embeddings, and ChromaDB vector storage.
  2. Combined BM25, semantic search, cosine similarity, and cross-encoder reranking for hybrid retrieval.
  3. Fine-tuned several pretrained language models with QLoRA.
  4. Evaluated ROUGE-1, Semantic F1, factual accuracy, answer completeness, and hallucination rate.

What changed

  • Delivered a Streamlit prototype that returns document-grounded answers with supporting knowledge-base references.
  • Established a comparative evaluation workflow for both retrieval relevance and answer quality without claiming an unreported aggregate score.