← Back to portfolio

Case Study

Renter's Rights Assistant

One side of this lease has read a hundred others. Now you have too.

Built as "FinePrint" — a real, working prototype — view the repo. Both halves of the RAG pipeline (retrieval and generation) run live for every query, on real embeddings and a real, deliberately narrow knowledge base — no staged fallback data. Business impact figures below are reasoned estimates, not measured production numbers.

1. The Original Workflow

Landlords have seen dozens of leases; their lawyers wrote the template. A first-time renter is staring at theirs for the first time, trying to figure out if "landlord may enter for inspection" is normal or a problem. Today that means googling the individual phrase, sifting through forum answers and blog posts that rarely say which state's law they're describing, and — if the deadline to sign is close, which it usually is — giving up on researching every clause and just signing.

For someone diligent enough to actually try, this is realistically 1–2 hours of scattered searching per lease, with genuinely unreliable results at the end: general web search doesn't know that India's tenancy law is state-specific, or that Karnataka in particular hasn't adopted the central Model Tenancy Act that most online advice assumes applies uniformly.

2. The Friction Points

FrictionRoot CauseImpact
No single source of truth for "is this clause normal"Indian tenancy law is state-specific and most online advice doesn't say which state it applies toRenters can't tell if a clause is standard practice or a red flag
Confident answers regardless of actual knowledgeGeneral search results and chatbots don't reliably ground answers in the current, applicable law textA wrong confident answer is worse than "I don't know" — a renter might dismiss a real red flag or panic over a normal clause
Legal help is slow and expensiveA lawyer consultation costs money and takes days to schedule for a decision that has to be made before signingRenters end up signing without review because the lease deadline moves faster than the legal-advice pipeline
Karnataka hasn't adopted the Model Tenancy ActMost Indian tenancy content online assumes the central Act applies uniformlyA Karnataka renter relying on generic "Model Tenancy Act" advice could be told incorrect defaults

3. Prerequisites

  1. A curated, embedded knowledge base has to exist before retrieval works. An empty or generic knowledge base would make the pipeline retrieve nothing relevant, or worse, something plausible-sounding but wrong.
  2. The system has to be honest about jurisdictional gaps — like Karnataka not having adopted the central Act — rather than presenting one uniform national answer, or it actively misleads state-specific renters.
  3. Genuinely low-cost embeddings and generation, to keep this viable as a self-funded, freely usable tool. This shaped real build decisions — Voyage AI's free-tier embeddings, Gemini's free-tier generation — rather than assuming a paid API budget.

4. The AI-Enabled Redesign

  1. Ask — the user pastes a lease clause, or asks a plain-English question.
  2. Retrieve — the question is embedded (Voyage AI voyage-4-lite) and compared by cosine similarity against every chunk in the knowledge base — the Model Tenancy Act 2021, Karnataka-specific rental practice, and a curated set of common red-flag clause patterns. The scan runs live across every provision, and the ones that actually match light up and stay lit.
  3. Analyze — only the retrieved chunks are handed to the generation model (Gemini gemini-3.5-flash, thinking mode off — this is grounded classification, not open reasoning), instructed to ground every claim in them and cite the source.
  4. Judge — each issue gets a severity read — fine, worth questioning, red flag — plus a quote card showing the exact law fragment or clause pattern it's grounded in.

5. Human Fallback Triggers

  • No retrieved chunk clears a minimum similarity threshold for the question asked — the system says the knowledge base doesn't confidently cover this, rather than answering from the model's unverified general knowledge.
  • The question relates to a state outside the knowledge base's coverage (anything beyond the Model Tenancy Act baseline and Karnataka specifics) — flagged explicitly as out of scope rather than answered with an assumed-uniform national answer.
  • Retrieved chunks conflict (e.g. a red-flag pattern and a "this is standard practice" note both match) — both are surfaced with their individual citations, rather than the model silently picking one.
  • Anything requiring advice specific to the user's individual circumstances — the system stays at "here's what the law/pattern says," never "here's what you personally should do," and says so explicitly.

6. Sample AI Prompt

System prompt — retrieval-grounded clause classificationYou are a lease-clause analysis assistant. You are given a user's question or pasted lease clause, plus a set of retrieved source chunks from a fixed knowledge base (Model Tenancy Act 2021 text, Karnataka-specific rental practice notes, and known red-flag clause patterns). Rules: 1. Answer using ONLY the retrieved chunks provided. Do not use outside knowledge of tenancy law, even if you believe it to be correct. 2. For each point you make, attach the exact source chunk it came from as a citation. 3. Classify the clause/question as one of: "fine" | "worth_questioning" | "red_flag". 4. If the retrieved chunks don't clearly cover the question, or coverage is uncertain for the user's likely state, say so explicitly rather than answering from general knowledge. Output classification: "insufficient_coverage" instead of guessing. 5. If retrieved chunks conflict with each other, present both perspectives with their separate citations rather than resolving the conflict yourself. Output strict JSON: { "classification": "fine"|"worth_questioning"|"red_flag"|"insufficient_coverage", "explanation": string, "citations": [{ "source": string, "quote": string }] }
Example input — retrieved chunk: Model Tenancy Act 2021 §16 (entry notice requirements); question: "My lease says landlord may enter anytime for inspection, no notice required. Is that normal?"[retrieved: "The landlord shall give at least twenty-four hours' notice to the tenant before entering the premises for inspection or repair, except in case of emergency." — Model Tenancy Act 2021, §16]
Example output{ "classification": "red_flag", "explanation": "The Model Tenancy Act 2021 requires landlords to give at least 24 hours' notice before entry for inspection, except in emergencies. A clause permitting entry 'anytime' with no notice conflicts with this baseline.", "citations": [ { "source": "Model Tenancy Act 2021, §16", "quote": "The landlord shall give at least twenty-four hours' notice to the tenant before entering the premises for inspection or repair, except in case of emergency." } ] }

Error handling: if no retrieved chunk has meaningful similarity to the question, the model outputs classification: "insufficient_coverage", an explanation stating the knowledge base doesn't cover this, and an empty citations array — never a fabricated citation to a chunk that wasn't actually retrieved.

7. Prompt Testing

CaseInputExpected OutputWhat a Bad Result Reveals
ClearThe entry-notice example above, clearly covered by a retrieved chunkred_flag, with an accurate, quoted citationAn uncited or paraphrased answer here means grounding isn't actually being enforced
Ambiguous / low-signalA question about a clause type the 19-chunk knowledge base barely covers (e.g. a niche subletting clause)insufficient_coverage, not a guessed classificationAnswering confidently anyway means the system is prioritizing having an answer over having a correct one
Multi-signal / contradictoryA Karnataka question where the Model Tenancy Act chunk suggests one answer, but a Karnataka-practice chunk notes the central Act isn't adopted thereBoth citations surfaced with the jurisdictional caveat stated explicitly, not a single confident answerSilently picking the national answer would give a Karnataka renter incorrect defaults — exactly the failure mode this project exists to prevent
Edge caseAn unrelated question pasted by mistake (e.g. "what's a good rent negotiation script")insufficient_coverage or an explicit statement this isn't a fine/red-flag question, not a fabricated legal-sounding answerProducing a confident-sounding answer to an out-of-scope question reveals the model filling gaps instead of admitting them

8. Business Impact

MetricBeforeAfterReasoning
Time to get a grounded read on one clause~15–20 min of googling and cross-referencing~30 secRetrieval plus grounded generation collapses the manual cross-referencing step into a single query
Time to review a full lease (~15 clauses)~1.5–2 hrs of scattered research~10–15 minAsking each clause in turn replaces open-ended search with a targeted, grounded question
Jurisdictional accuracy stated explicitlyGeneric advice often silently assumes national uniformityEvery answer states its jurisdictional coverage, including the Karnataka gapA capability, not a rate — the system either states its coverage honestly or it doesn't, and the fallback triggers ensure it does

The math, shown: 15 clauses worth checking in a typical lease, at ~7 minutes saved each (17–20 min of googling collapsed to ~30 sec of asking) ≈ 100+ minutes saved per lease reviewed — before counting the value of catching a red flag that a rushed, deadline-pressured skim would have missed entirely.

9. Product Thinking — Risks & Tradeoffs

Risk: a narrow, 19-chunk knowledge base could give a false sense of complete coverage if the insufficient_coverage fallback doesn't trigger reliably. Mitigated by treating the similarity threshold as a product decision tuned conservatively — better to under-answer than overclaim, which is the project's own stated design principle.

Risk: users could treat a "worth_questioning" or "fine" classification as definitive legal advice rather than a grounded read of general patterns. Mitigated with persistent framing that this isn't a substitute for a lawyer on anything genuinely high-stakes — a large deposit dispute already escalated, for instance.

Design choice — what stays out of scope, on purpose: no state coverage beyond the Model Tenancy Act baseline and Karnataka, no lawyer marketplace, no accounts. This matches the project's own explicit scope stance rather than pretending to cover all of India before the jurisdictional-honesty work is actually done for each state.

Dependency: answer quality is bounded entirely by the knowledge base's completeness and chunking quality. A RAG system is only as good as what's actually indexed — this one is deliberately small rather than deliberately wrong.

10. Current State & What's Next

  • Live today: both halves of the RAG pipeline run for real, on every query — real embeddings (Voyage AI voyage-4-lite) and real generation (Gemini gemini-3.5-flash), no staged fallback data anywhere in the flow.
  • Scope, by design: a 19-chunk knowledge base across three source documents — intentionally small, so it can be right about a little rather than confidently wrong about everything.
  • Not built yet: no backend, auth, or persistence — state lives in React and resets on refresh. No coverage beyond Karnataka, no lawyer marketplace, no accounts.
  • Next build, honestly: expanding state coverage past Karnataka is a phase-2 decision, not something to quietly bolt on without doing the same jurisdictional-honesty work already done here.
← Back to portfolio