Legal information + guided next steps assistant for the Bharatiya Nyaya Sanhita (BNS) — ask a question (e.g., theft/fraud/property dispute) and get:
- a category-specific checklist of steps
- an optional FIR draft (for certain categories)
- relevant BNS section excerpts retrieved via Databricks Vector Search
Not legal advice. This app provides general information only — consult a qualified lawyer for your specific situation.
Question (chat)
→ Model classifies case as types (theft / fraud / property_dispute / general)
→ For legal query:
→ shows actionable steps
→ shows relevant BNS section
→ generate FIR draft (details provided by user)
→ If non-legal/general:
→ gives proper explaination for legal decision making
→ (optional) download FIR as PDF
| Document | Audience | What it covers |
|---|---|---|
| README (this file) | Users / developers | What Nyaya Path is, how it works, how to run it |
- Open the app(https://nyaya-path-7474652446860732.aws.databricksapps.com/).
- Enter your details in the sidebar (Name, Police Station, Incident Date).
- Ask a question like:
- “My bag is stolen what to do?”
- “What is fraud?”
- “Property dispute steps”
- If applicable, download the generated FIR PDF.
This repo is designed to run as a Databricks App (https://nyaya-path-7474652446860732.aws.databricksapps.com/) and uses:
- a Databricks model serving endpoint named
nyaya-path - a Databricks Vector Search index at
bns-endpoint/workspace.default.bns_index
In app/app.py, these are currently configured as:
DATABRICKS_HOST = "Your_Databricks_API_ID"ENDPOINT_NAME = "nyaya-path"- Vector Search index:
("bns-endpoint", "workspace.default.bns_index")
Note:
app/app.pycurrently contains a hard-coded token placeholder. For production, you should move secrets to Databricks Secrets / environment variables.
- Create a Databricks App and connect this GitHub repository.
- Ensure the app runs from the
app/directory (Databricks Apps entry usesapp/app.yaml). - Install dependencies from
app/requirements.txt.
app/app.yaml runs:
streamlit run app.py
- A Databricks model serving endpoint:
- Name:
nyaya-path
- Name:
- A Databricks Vector Search endpoint + index:
- Endpoint:
bns-endpoint - Index:
workspace.default.bns_index - Expected columns retrieved by the app:
content,section,section__name
- Endpoint:
- Install dependencies (local Streamlit app dependencies live under
app/requirements.txt):
pip install -r app/requirements.txt- Run the app:
cd app
streamlit run app.pyIf you want local development to use environment variables instead of hard-coded values, update
app/app.pyto readDATABRICKS_HOST/DATABRICKS_TOKENfrom env.
| Path | Purpose |
|---|---|
app/app.py |
Streamlit app (case classification + steps + FIR generation + Vector Search retrieval) |
app/app.yaml |
Databricks Apps entry point (runs Streamlit) |
app/requirements.txt |
Streamlit runtime dependencies (Databricks Vector Search + reportlab) |
data/bns.csv |
BNS source dataset (used to build the vector index externally / via notebooks) |
notebooks/NyayaPath.ipynb |
Notebook(s) for data/index work (project experimentation) |
demo/demo.ipynb |
Demo notebook |
.env.example |
Example env file for local dev (not currently wired into app/app.py) |
No automated test suite is included in the repository currently.
| Component | Technology |
|---|---|
| App framework | Streamlit |
| LLM | Databricks model serving endpoint (nyaya-path) invoked via REST |
| Vector search | Databricks VectorSearchClient (databricks-vectorsearch) |
| PDF generation | reportlab |
| Data | CSV (data/bns.csv) |