Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DepositBack — get your security deposit back. anywhere.

Drop your lease, the landlord's deduction letter, and your move-out photos. An AI agent powered by Groq reads everything, cites statute, drafts a demand letter, and pre-fills the small-claims form.

Live demo: https://depositback-frontend.vercel.app

Backend is on Render's free plan — it spins down after inactivity, so the first request after a while can take ~30–60s to wake up.

🎬 Demo (3 min)

Watch the demo

youtu.be/9VOV1C75E9A


The problem

  • United States — ~$8B/year in wrongfully-withheld security deposits.
  • United Kingdom — 30% of TDS dispute outcomes go partially or fully in favor of the tenant; landlords routinely overclaim.
  • Pakistan — no deposit protection scheme exists; tenants in Karachi/Lahore commonly lose 1–3 months of advance to bogus deductions.

The pain is universal. Tenants don't know the law. Landlords do. Asymmetric information becomes asymmetric outcomes.

The solution

3 uploads. 60 seconds. A court-ready demand letter with statute citations for your jurisdiction.

Upload What the agent does
Lease (PDF or photo) Extracts terms; flags clauses (e.g., a deposit > the AB 12 cap)
Landlord's deduction letter Maps each line item against the jurisdiction's statute
Move-out photos Wear-vs-damage assessment using Groq's vision model

One-click jurisdiction switching — California, New York, Texas, England, Sindh today; new jurisdictions added by dropping a JSON file in backend/data/statutes/.

Why Groq

Capability How DepositBack uses it
Tool-calling loop One agent session calls 5 tools — reads PDFs, analyzes photos, looks up statutes, drafts the letter, pre-fills the court form — via a streaming tool-use loop against Groq's OpenAI-compatible API. The full event stream is visible in the UI.
Vision (Llama 4 Scout) Damage assessment via meta-llama/llama-4-scout-17b-16e-instruct. Tells "ordinary wear" from "chargeable damage" using the Connell v. Brownstein-Louis Co. (1927) standard for California, plus equivalent rules for the other supported jurisdictions.
Kimi K2 orchestration The main agent runs on moonshotai/kimi-k2-instruct-0905, chosen for strong multi-step tool-use across the lease, deduction letter, and statute corpus.
Low-latency streaming Groq's inference speed keeps the live event stream responsive across a multi-iteration agent run.

Jurisdictions supported

Jurisdiction Statute Forum
California Cal. Civ. Code §1950.5 (post AB 12) Small Claims, Form SC-100
New York N.Y. Gen. Oblig. Law §7-108 NYC Civil Court Small Claims Part
Texas Tex. Prop. Code §92.101–92.110 Justice Court
England & Wales Housing Act 2004 ss. 213-215 TDS / DPS / MyDeposits free ADR
Sindh, Pakistan Sindh Rented Premises Ordinance 1979 (with cantonment-area fallback to the Cantonments Rent Restriction Act 1963) Office of the Rent Controller

Adding a new jurisdiction = drop a JSON file. See backend/data/statutes/.

Architecture

┌────────────────────────────────────────────┐
│  React 18 + Vite SPA  (Vercel)             │
│  Upload UI · SSE stream · letter renderer  │
└─────────────────┬──────────────────────────┘
                  │ HTTPS
                  ▼
┌────────────────────────────────────────────┐
│  FastAPI + asyncio  (Render)               │
│  - main.py: routes, CORS                   │
│  - agent.py: Groq streaming + tools        │
│  - tools/: pdf, vision, statute, doc, form │
│  - data/statutes/: 5 JSON corpora          │
└─────────────────┬──────────────────────────┘
                  │ HTTPS
                  ▼
┌────────────────────────────────────────────┐
│  Groq — kimi-k2-instruct (agent) +         │
│         llama-4-scout (vision)             │
│  streaming tool-calling loop               │
└────────────────────────────────────────────┘

Run it locally in 60 seconds

git clone https://github.com/mufeezhanif/depositback.git
cd depositback

# install both services
make install

# add your Groq API key (free at console.groq.com)
cp backend/.env.example backend/.env
# edit backend/.env → GROQ_API_KEY=gsk_...

# run (in two terminals)
make backend    # FastAPI on :8000
make frontend   # Vite dev server on :5173

Open http://localhost:5173. Upload your files. Click Run analysis.

System dependency: poppler-utils (Linux: apt install poppler-utils, Mac: brew install poppler). The Dockerfile handles this automatically.

Tests

make test

Runs the backend smoke tests (no network calls — verifies imports, statute lookup, and document drafting).

Deploy

Frontend (Vercel):

cd frontend
vercel --prod
# set VITE_API_URL to your backend URL

Backend (Render):

cd backend
render services create --name depositback-backend --type web_service \
  --repo https://github.com/mufeezhanif/depositback --runtime docker \
  --root-directory backend --env-var GROQ_API_KEY=gsk_... \
  --env-var FRONTEND_ORIGIN=https://your-frontend.vercel.app

The backend ships with a Dockerfile (poppler installed); health-check is /api/health.

Repo layout

depositback/
├── frontend/                  React + Vite SPA
│   └── src/
│       ├── App.tsx
│       ├── components/
│       └── lib/
├── backend/                   FastAPI service
│   ├── main.py                routes
│   ├── agent.py               Groq streaming + tool loop
│   ├── tools/                 5 Python tool functions
│   ├── prompts/               agent system prompt + letter template
│   ├── data/statutes/         5 JSON corpora
│   └── tests/
├── Makefile
├── LICENSE                    MIT
└── README.md                  this file

Roadmap

Phase 2 (next 4 weeks): more jurisdictions (WA, MA, IL, FL, Punjab, Ontario, Scotland, NSW), email send-out with confirmation, auto follow-up scheduler, move-in vs move-out photo comparison, repair-cost market lookup, multilingual UI (Urdu, Spanish), confidence score per claim.

Phase 3 (month 2+): lease pre-signing analyzer, landlord-side product, lawyer-marketplace integration, mobile app, NGO partnerships.

Built by

Muhammad Mufeez — BSCS, FAST-NUCES Karachi. Built for the Cerebral Valley × Anthropic Built with Opus 4.7 hackathon (April 2026).

Disclaimer

DepositBack is a drafting assistant, not a lawyer. Statute citations are quoted verbatim from primary sources; verify against the live statute before filing. For complex matters consult a licensed attorney. Following the FTC's February 2025 finalized order on AI-lawyer claims, we make no representation of legal advice — only of well-cited drafting.

About

Helps renters get their security deposit back - reads your lease and the landlord's deductions, points to relevant tenant-protection laws, drafts a demand letter, and pre-fills small-claims court forms. Built with Claude and Python

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages