# rajkumar9mak/bis-setu architecture

> Architecture diagram of the GitHub repository rajkumar9mak/bis-setu, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rajkumar9mak/bis-setu
- Repository: https://github.com/rajkumar9mak/bis-setu

## Overview

BIS Setu is a standards-compliance and product-verification platform with industry, consumer, and AI-copilot workflows. The documented product also includes laboratory discovery and manufacturer tracking. The README describes broader capabilities such as renewal alerts and dossier export, but their implementation wiring is not visible in the sampled source; those connections are therefore left out.

Main entry points: [`backend/main.py`](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/main.py) (FastAPI application), [`backend/services/rag_engine.py`](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/services/rag_engine.py) (Grounded answer engine), [`frontend/app/api/[...path]/route.ts`](https://github.com/rajkumar9mak/bis-setu/blob/main/frontend/app/api/%5B...path%5D/route.ts) (API proxy), [`backend/ingestion/indexer.py`](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/ingestion/indexer.py) (Standards indexer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_industry_ui["Industry mode<br/>[page.tsx]"]
  node_consumer_ui["Consumer mode<br/>[page.tsx]"]
  node_copilot_ui["AI copilot<br/>[page.tsx]"]
  node_labs_ui["Lab finder<br/>[page.tsx]"]
  node_dashboard_ui["Manufacturer dashboard<br/>[page.tsx]"]
  node_api_proxy["API proxy<br/>[route.ts]"]
end

subgraph group_api["API workflows"]
  node_app["FastAPI application<br/>[main.py]"]
  node_compliance_api["Compliance API<br/>[compliance.py]"]
  node_verification_api["Verification API<br/>[verification.py]"]
  node_rag_api["RAG API<br/>[rag.py]"]
  node_standards_api["Standards API<br/>[standards.py]"]
  node_dashboard_api["Dashboard API<br/>[dashboard.py]"]
  node_documents_api["Documents API<br/>[documents.py]"]
  node_grievances_api["Grievances API<br/>[grievances.py]"]
end

subgraph group_knowledge["Standards knowledge"]
  node_rag_engine["Grounded answer engine<br/>[rag_engine.py]"]
  node_indexer["Standards indexer<br/>[indexer.py]"]
  node_pdf_parser["PDF parsing<br/>[pdf_parser.py]"]
  node_clause_parser["Clause extraction<br/>[clause_parser.py]"]
  node_chunker["Clause chunking<br/>[chunker.py]"]
  node_hybrid["Hybrid retrieval"]
  node_lexical["BM25 retrieval"]
  node_vector["Vector retrieval"]
  node_reranker["Result reranking<br/>[reranker.py]"]
  node_citation["Citation building"]
  node_grounding["Grounding checks<br/>[grounding.py]"]
end

subgraph group_domain["Compliance and records"]
  node_compliance_engine["Roadmap and fees"]
  node_verification_engine["Licence verification"]
  node_database[("Application database<br/>[db.py]")]
  node_labs_engine["Standards discovery"]
end

node_industry_user(("Industry user"))
node_consumer_user(("Consumer"))
node_copilot_user(("Copilot user"))
node_gemini["Gemini API"]

node_industry_user -->|"uses"| node_industry_ui
node_consumer_user -->|"uses"| node_consumer_ui
node_copilot_user -->|"asks"| node_copilot_ui
node_industry_ui -->|"sends requests"| node_api_proxy
node_consumer_ui -->|"sends requests"| node_api_proxy
node_copilot_ui -->|"sends requests"| node_api_proxy
node_labs_ui -->|"sends requests"| node_api_proxy
node_dashboard_ui -->|"sends requests"| node_api_proxy
node_api_proxy -->|"proxies API calls"| node_app
node_app -->|"registers router"| node_compliance_api
node_app -->|"registers router"| node_verification_api
node_app -->|"registers router"| node_rag_api
node_app -->|"registers router"| node_standards_api
node_app -->|"registers router"| node_dashboard_api
node_app -->|"registers router"| node_documents_api
node_app -->|"registers router"| node_grievances_api
node_compliance_api -->|"requests roadmap and fees"| node_compliance_engine
node_verification_api -->|"verifies licence"| node_verification_engine
node_rag_api -->|"queries"| node_rag_engine
node_rag_api -->|"reindexes standards"| node_indexer
node_standards_api -->|"discovers standards"| node_labs_engine
node_dashboard_api -->|"reads dashboard data"| node_database
node_documents_api -->|"accesses records"| node_database
node_grievances_api -->|"accesses records"| node_database
node_rag_engine -->|"uses indexed clauses"| node_indexer
node_rag_engine -->|"retrieves evidence"| node_hybrid
node_hybrid -->|"searches terms"| node_lexical
node_hybrid -->|"searches vectors"| node_vector
node_rag_engine -->|"reranks results"| node_reranker
node_rag_engine -->|"checks evidence"| node_grounding
node_rag_engine -->|"builds citations"| node_citation
node_indexer -->|"parses documents"| node_pdf_parser
node_indexer -->|"extracts clauses"| node_clause_parser
node_indexer -->|"chunks clauses"| node_chunker
node_rag_engine -.->|"requests synthesis"| node_gemini

click node_industry_ui "https://github.com/rajkumar9mak/bis-setu/blob/main/frontend/app/industry/page.tsx"
click node_consumer_ui "https://github.com/rajkumar9mak/bis-setu/blob/main/frontend/app/consumer/page.tsx"
click node_copilot_ui "https://github.com/rajkumar9mak/bis-setu/blob/main/frontend/app/copilot/page.tsx"
click node_labs_ui "https://github.com/rajkumar9mak/bis-setu/blob/main/frontend/app/labs/page.tsx"
click node_dashboard_ui "https://github.com/rajkumar9mak/bis-setu/blob/main/frontend/app/dashboard/page.tsx"
click node_api_proxy "https://github.com/rajkumar9mak/bis-setu/blob/main/frontend/app/api/%5B...path%5D/route.ts"
click node_app "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/main.py"
click node_compliance_api "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/compliance.py"
click node_verification_api "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/verification.py"
click node_rag_api "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/rag.py"
click node_standards_api "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/standards.py"
click node_dashboard_api "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/dashboard.py"
click node_documents_api "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/documents.py"
click node_grievances_api "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/grievances.py"
click node_compliance_engine "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/services/compliance_engine.py"
click node_verification_engine "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/services/verification_engine.py"
click node_database "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/database/db.py"
click node_rag_engine "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/services/rag_engine.py"
click node_indexer "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/ingestion/indexer.py"
click node_pdf_parser "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/ingestion/pdf_parser.py"
click node_clause_parser "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/ingestion/clause_parser.py"
click node_chunker "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/ingestion/chunker.py"
click node_hybrid "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/retrievers/hybrid_retriever.py"
click node_lexical "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/retrievers/lexical_retriever.py"
click node_vector "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/retrievers/vector_retriever.py"
click node_reranker "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/retrievers/reranker.py"
click node_citation "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/services/citation_builder.py"
click node_grounding "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/services/grounding.py"
click node_labs_engine "https://github.com/rajkumar9mak/bis-setu/blob/main/backend/services/standards_discovery.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_industry_ui,node_consumer_ui,node_copilot_ui,node_labs_ui,node_dashboard_ui,node_api_proxy,node_industry_user,node_copilot_user toneBlue
class node_app,node_compliance_api,node_verification_api,node_rag_api,node_standards_api,node_dashboard_api,node_documents_api,node_grievances_api toneAmber
class node_rag_engine,node_indexer,node_pdf_parser,node_clause_parser,node_chunker,node_hybrid,node_lexical,node_vector,node_reranker,node_citation,node_grounding,node_gemini toneMint
class node_compliance_engine,node_verification_engine,node_database,node_labs_engine toneRose
class node_consumer_user toneIndigo
```

## Components

### Web experience

- [Industry mode](https://github.com/rajkumar9mak/bis-setu/blob/main/frontend/app/industry/page.tsx): `frontend/app/industry/page.tsx`
- [Consumer mode](https://github.com/rajkumar9mak/bis-setu/blob/main/frontend/app/consumer/page.tsx): `frontend/app/consumer/page.tsx`
- [AI copilot](https://github.com/rajkumar9mak/bis-setu/blob/main/frontend/app/copilot/page.tsx): `frontend/app/copilot/page.tsx`
- [Lab finder](https://github.com/rajkumar9mak/bis-setu/blob/main/frontend/app/labs/page.tsx): `frontend/app/labs/page.tsx`
- [Manufacturer dashboard](https://github.com/rajkumar9mak/bis-setu/blob/main/frontend/app/dashboard/page.tsx): `frontend/app/dashboard/page.tsx`
- [API proxy](https://github.com/rajkumar9mak/bis-setu/blob/main/frontend/app/api/%5B...path%5D/route.ts): `frontend/app/api/[...path]/route.ts`

### API workflows

- [FastAPI application](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/main.py): `backend/main.py`
- [Compliance API](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/compliance.py): `backend/api/compliance.py`
- [Verification API](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/verification.py): `backend/api/verification.py`
- [RAG API](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/rag.py): `backend/api/rag.py`
- [Standards API](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/standards.py): `backend/api/standards.py`
- [Dashboard API](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/dashboard.py): `backend/api/dashboard.py`
- [Documents API](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/documents.py): `backend/api/documents.py`
- [Grievances API](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/api/grievances.py): `backend/api/grievances.py`

### Standards knowledge

- [Grounded answer engine](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/services/rag_engine.py): `backend/services/rag_engine.py`
- [Standards indexer](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/ingestion/indexer.py): `backend/ingestion/indexer.py`
- [PDF parsing](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/ingestion/pdf_parser.py): `backend/ingestion/pdf_parser.py`
- [Clause extraction](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/ingestion/clause_parser.py): `backend/ingestion/clause_parser.py`
- [Clause chunking](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/ingestion/chunker.py): `backend/ingestion/chunker.py`
- [Hybrid retrieval](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/retrievers/hybrid_retriever.py): `backend/retrievers/hybrid_retriever.py`
- [BM25 retrieval](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/retrievers/lexical_retriever.py): `backend/retrievers/lexical_retriever.py`
- [Vector retrieval](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/retrievers/vector_retriever.py): `backend/retrievers/vector_retriever.py`
- [Result reranking](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/retrievers/reranker.py): `backend/retrievers/reranker.py`
- [Citation building](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/services/citation_builder.py): `backend/services/citation_builder.py`
- [Grounding checks](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/services/grounding.py): `backend/services/grounding.py`

### Compliance and records

- [Roadmap and fees](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/services/compliance_engine.py): `backend/services/compliance_engine.py`
- [Licence verification](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/services/verification_engine.py): `backend/services/verification_engine.py`
- [Application database](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/database/db.py): `backend/database/db.py`
- [Standards discovery](https://github.com/rajkumar9mak/bis-setu/blob/main/backend/services/standards_discovery.py): `backend/services/standards_discovery.py`

### Other components

- **Industry user**
- **Consumer**
- **Copilot user**
- **Gemini API**

## Connections

- Industry user → Industry mode: uses
- Consumer → Consumer mode: uses
- Copilot user → AI copilot: asks
- Industry mode → API proxy: sends requests
- Consumer mode → API proxy: sends requests
- AI copilot → API proxy: sends requests
- Lab finder → API proxy: sends requests
- Manufacturer dashboard → API proxy: sends requests
- API proxy → FastAPI application: proxies API calls
- FastAPI application → Compliance API: registers router
- FastAPI application → Verification API: registers router
- FastAPI application → RAG API: registers router
- FastAPI application → Standards API: registers router
- FastAPI application → Dashboard API: registers router
- FastAPI application → Documents API: registers router
- FastAPI application → Grievances API: registers router
- Compliance API → Roadmap and fees: requests roadmap and fees
- Verification API → Licence verification: verifies licence
- RAG API → Grounded answer engine: queries
- RAG API → Standards indexer: reindexes standards
- Standards API → Standards discovery: discovers standards
- Dashboard API → Application database: reads dashboard data
- Documents API → Application database: accesses records
- Grievances API → Application database: accesses records
- Grounded answer engine → Standards indexer: uses indexed clauses
- Grounded answer engine → Hybrid retrieval: retrieves evidence
- Hybrid retrieval → BM25 retrieval: searches terms
- Hybrid retrieval → Vector retrieval: searches vectors
- Grounded answer engine → Result reranking: reranks results
- Grounded answer engine → Grounding checks: checks evidence
- Grounded answer engine → Citation building: builds citations
- Standards indexer → PDF parsing: parses documents
- Standards indexer → Clause extraction: extracts clauses
- Standards indexer → Clause chunking: chunks clauses
- Grounded answer engine → Gemini API: requests synthesis
