Skip to content
CHIRAG_VIJAY
BACK TO [01] WORK
[LEX-01]STATUS: V1 LIVE

Lexora

RAG-based legal research assistant for Indian law.

STACK
  • FastAPI
  • BGE embeddings
  • cross-encoder rerank
  • RAGAS
  • Next.js / Vercel AI SDK
  • Docker
  • Langfuse
  • GCP Cloud Run

Problem

Legal research is slow, and answers are only useful if they're traceable to sources. A lawyer can't act on a confident paragraph with no citation behind it.

Architecture

A FastAPI backend embeds documents with BGE into a vector store, then reranks retrieved chunks with a cross-encoder before they reach the model. Reranking is where retrieval quality is won or lost. RAGAS runs continuous evaluation so regressions surface as numbers, not vibes. The frontend is a streaming Next.js chat. Observability runs through Langfuse, CI/CD through GitHub Actions, deployed on Cloud Run.

  1. 01Queryuser question
  2. 02BGE embedvector store
  3. 03Cross-encoder reranktop-k chunks
  4. 04Grounded answerstreamed + cited

Evidence

The improvement over the baseline is itself the signal. Every number below comes from RAGAS in CI.

RAGAS · BASELINE vs V1
Faithfulness
0.93was 0.84
RAGAS
Context Precision
0.87was 0.75
RAGAS
Context Recall
0.89was 0.75
RAGAS

Reranking did most of the work: a cross-encoder scoring each chunk against the query directly, not just by vector proximity, is what moved context precision from 0.75 to 0.87.