How tanbir-ahm/recourse works
Recourse is a plain-language legal-help product for people and families dealing with arrest, custody, cheque-bounce cases, or frozen accounts. A user enters a situation through the web app or WhatsApp; the situation is routed, relevant law and judgments are retrieved, and an answer is phrased with legal claims grounded in those sources. Separately, questionnaire answers or uploaded papers feed fixed-rule safeguard checks, which can support an editable petition draft. The README documents these boundaries and capabilities; sampled source excerpts are partial, so uncertain internal wiring is omitted.
Main entry points: app.py Web app · whatsapp_bot.py WhatsApp front door · retrieval.py Legal retrieval · main.py Safeguard checks
Components 19
User channels
- Web app
app.py - WhatsApp front door
whatsapp_bot.py - Chat context
whatsapp_store.py
Grounded answers
- Situation router
scenario_router.py - Legal retrieval
retrieval.py - Grounded phrasing
chat_assistant.py - Claim screen
second_reader.py
Safeguard assessment
- Uploaded papers
recourse_upload.py - Safeguard checks
main.py - Questionnaire flow
interview_flow.py - Findings and severity
main.py
Legal knowledge
- Statutes and judgments
vaquill_search.py - Doctrine anchors
statute_doctrine_map.py - Statute data
bns_section_data_v2.py
Drafting
- Petition draft
petition_draft.py
Other components
- Person or family
- Language model
- Answer and next steps
- Petition PDF
Connections 27
- Person or family → Web app: asks or uploads
- Person or family → WhatsApp front door: messages
- WhatsApp front door → Chat context: reads and writes
- Web app → Situation router: routes situation
- WhatsApp front door → Situation router: routes situation
- Situation router → Legal retrieval: selects legal context
- Legal retrieval → Statutes and judgments: retrieves passages
- Legal retrieval → Doctrine anchors: uses anchors
- Legal retrieval → Statute data: uses statute data
- Web app → Grounded phrasing: requests explanation
- WhatsApp front door → Grounded phrasing: requests explanation
- Grounded phrasing → Language model: phrases response
- Legal retrieval → Grounded phrasing: provides sources
- Grounded phrasing → Claim screen: screens claims
- Claim screen → Answer and next steps: returns checked answer
- Web app → Uploaded papers: accepts documents
- Uploaded papers → Safeguard checks: provides document facts
- Web app → Questionnaire flow: collects answers
- Questionnaire flow → Safeguard checks: provides answers
- Safeguard checks → Statute data: checks legal provisions
- Safeguard checks → Statutes and judgments: grounds findings
- Safeguard checks → Findings and severity: produces verdict
- Findings and severity → Petition draft: supplies findings
- Web app → Petition draft: requests draft
- Petition draft → Petition PDF: renders document
- Web app → Answer and next steps: shows answer
- WhatsApp front door → Answer and next steps: delivers reply