Dev Jhawar, home
Résumé ↗
← All projects

Project 03, 2026

CaseCompass

Describe a consumer dispute and see how Indian commissions decided similar cases.

All services

CaseCompass screenshot

Interactive explainer

How the search merges results

CaseCompass runs a meaning search and a keyword search, then merges them with Reciprocal Rank Fusion. Drag k and watch the order change.

This is a small model of one part of CaseCompass: the step that merges its two search results. It runs in your browser on sample data and doesn't fetch anything or call an AI model, so it isn't the app itself.Use the real CaseCompass ↗

Story “My flight was cancelled and the airline won't refund me.”

Meaning search vectors

  1. 1AFlight cancelled, airline refused refund, refund ordered with interest
  2. 2BRescheduled flight, passenger missed connection, compensation awarded
  3. 3CRefund delayed eight months after cancellation, deficiency in service
  4. 4DAirline offered only a credit shell instead of a refund
  5. 5ELost baggage on a domestic flight, partial compensation
  6. 6FOverbooked flight, denied boarding, complaint dismissed

Keyword search tsvector

  1. 1GTravel agent kept the refund for a cancelled ticket
  2. 2CRefund delayed eight months after cancellation, deficiency in service
  3. 3DAirline offered only a credit shell instead of a refund
  4. 4AFlight cancelled, airline refused refund, refund ordered with interest
  5. 5HTrain ticket cancelled, refund refused under railway rules
  6. 6BRescheduled flight, passenger missed connection, compensation awarded

Fused with RRFmeaning keyword

  1. A
  2. B
  3. C
  4. D
  5. E
  6. F
  7. G
  8. H

Each case scores 1/(k + rank) from every list it appears in, and the scores add up. A small k trusts each list's top pick, so G, first in keyword search only, rises. A large k rewards cases both searches agree on, so D climbs past it. 60 is the usual default. Hover a case to find it in every list.

People with a consumer complaint rarely know how similar cases ended. CaseCompass searches past NCDRC and state-commission judgments and shows outcomes, amounts and the verbatim final order, without predicting your result.

The hard part

Matching a layperson's story to consumer-court judgments written in legal language, without letting a model invent outcomes. One small LLM call rewrites the query, then keyword and vector search are merged with Reciprocal Rank Fusion over late-chunked embeddings. Outcomes come from an offline extraction step plus code rules, and the counts are computed in code.

In numbers

  • 0.96MRR on a 27-story airline eval, up from 0.87 with plain vector searchsource ↗
  • 1.00hit@5 on the same eval: a relevant case in the top five every timesource ↗
  • 88%of top-5 results in the right category across 16 storiessource ↗
  • 627judgments indexedsource ↗

Figures as stated in the repo. Evals are small samples, and the repo says so.

What I built

CaseCompass takes a consumer dispute written in plain words and shows how Indian consumer commissions decided similar cases: who won, the refund and compensation, the laws cited, the verbatim sentence of the final order, and a link to the full judgment. It never predicts your result. It started with airline refunds and now covers ten categories.

How it works

An offline pipeline ingests judgments from Indian Kanoon, dedupes them, has a small model extract outcome fields, applies code rules, then chunks and embeds them twice with Jina (once normally, once with late chunking). A search rewrites the story into up to three legal queries, runs vector and keyword search, merges with RRF and collapses to the best chunk per case. The backend never calls Indian Kanoon during a search.

Decisions worth noting

  • No model writes the answer at search time. Counts like “7 of 10 ruled for the complainant” are computed in code from stored fields.
  • Amounts the model extracts must literally appear in the judgment text, or they are dropped. Unsure answers escalate to the larger model.
  • Reranking and merging the citation graph into the ranking both scored worse, so the reranker is off and related cases are a separate list.
  • The app degrades instead of failing: if Jina is down it falls back to keyword search with a notice.
  • Spend is capped in code: a cap of 3 LLM calls per request, a daily token budget, per-IP rate limits and a usage ledger.
  • The known weak spot is who appealed, which is why outcome labels are 71-78% accurate and the README says to read the order.
Esc