# srijan-mukherjee/sih architecture

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

- Interactive diagram: https://gitdiagram.com/srijan-mukherjee/sih
- Repository: https://github.com/srijan-mukherjee/sih

## Overview

IP-SAKTI Sahayak is a web platform for Ayurveda-related IP and regulatory decision support. Users manage products and versioned ingredient, formulation, claim, evidence, and market details; the backend can then produce claim and product analyses, preliminary IP-route and patent screens, and change-impact reviews. A separate knowledge-assistant workflow ingests source documents and supports source-backed retrieval. The sampled files confirm app/router registration, content integrity handling, analysis orchestration, and RAG ingestion and retrieval; some router-to-service and assistant-generation wiring is not shown, so those links are omitted.

Main entry points: [`OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/main.py`](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/main.py) (FastAPI application), [`OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/database.py`](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/database.py) (Application database), [`OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/retrieval.py`](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/retrieval.py) (Hybrid retrieval), [`OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/analysis_service.py`](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/analysis_service.py) (Analysis orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_frontend["Web application<br/>[App.jsx]"]
end

subgraph group_api["API and identity"]
  node_app["FastAPI application<br/>[main.py]"]
  node_auth_router["Authentication routes<br/>[auth.py]"]
  node_auth_service["Authentication service<br/>[auth_service.py]"]
  node_jwt["JWT handling<br/>[jwt_handler.py]"]
end

subgraph group_product["Product review"]
  node_product_router["Product routes<br/>[products.py]"]
  node_product_service["Product service<br/>[product_service.py]"]
  node_content_router["Version content routes<br/>[version_content.py]"]
  node_content_service["Version content service"]
  node_analysis_router["Analysis routes<br/>[analysis.py]"]
  node_analysis_service["Analysis orchestration"]
  node_analysis_modules["Claim and classification analysis"]
  node_ip_router["IP screening routes<br/>[ip.py]"]
  node_ip_screening["IP route screening<br/>[ip_routes.py]"]
  node_change_router["Change-impact routes<br/>[change_impact.py]"]
  node_change_service["Change-impact review"]
end

subgraph group_knowledge["Knowledge assistant"]
  node_knowledge_router["Knowledge routes<br/>[knowledge.py]"]
  node_ingestion["Document ingestion<br/>[ingestion.py]"]
  node_retrieval["Hybrid retrieval<br/>[retrieval.py]"]
  node_generation["Answer generation<br/>[generation.py]"]
  node_vector_search["Vector search<br/>[vector_search.py]"]
  node_keyword_search["Keyword search<br/>[keyword_search.py]"]
  node_reranker["Result reranking<br/>[reranker.py]"]
end

subgraph group_runtime["Persistence and providers"]
  node_db[("Application database<br/>[database.py]")]
  node_rag_models["Corpus document and chunk records<br/>[rag_models.py]"]
  node_embedding["Embedding provider<br/>[provider.py]"]
  node_llm["Language model provider<br/>[provider.py]"]
end

node_user(("Product user"))

node_user -->|"uses"| node_frontend
node_frontend -->|"API requests"| node_app
node_app -->|"registers"| node_auth_router
node_app -->|"registers"| node_product_router
node_app -->|"registers"| node_content_router
node_app -->|"registers"| node_analysis_router
node_app -->|"registers"| node_ip_router
node_app -->|"registers"| node_change_router
node_app -->|"registers"| node_knowledge_router
node_auth_router -->|"delegates"| node_auth_service
node_auth_service -->|"queries and writes"| node_db
node_auth_service -->|"creates tokens"| node_jwt
node_product_router -->|"delegates"| node_product_service
node_product_service -->|"reads and writes"| node_db
node_content_router -->|"delegates"| node_content_service
node_content_service -->|"reads and writes"| node_db
node_analysis_router -->|"delegates"| node_analysis_service
node_analysis_service -->|"reads and writes"| node_db
node_analysis_service -->|"runs analysis"| node_analysis_modules
node_analysis_service -->|"builds route map"| node_ip_screening
node_ip_router -->|"requests screening"| node_ip_screening
node_change_router -->|"delegates"| node_change_service
node_change_service -->|"reads and writes"| node_db
node_knowledge_router -->|"starts ingestion"| node_ingestion
node_ingestion -->|"embeds chunks"| node_embedding
node_ingestion -->|"stores chunks"| node_db
node_db -->|"stores records"| node_rag_models
node_retrieval -->|"embeds query"| node_embedding
node_retrieval -->|"runs vector search"| node_vector_search
node_retrieval -->|"runs keyword search"| node_keyword_search
node_retrieval -->|"reranks results"| node_reranker
node_vector_search -->|"searches vectors"| node_db
node_keyword_search -->|"searches text"| node_db

click node_frontend "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/FRONTEND/src/App.jsx"
click node_app "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/main.py"
click node_auth_router "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/auth.py"
click node_auth_service "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/auth_service.py"
click node_jwt "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/utils/jwt_handler.py"
click node_product_router "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/products.py"
click node_product_service "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/product_service.py"
click node_content_router "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/version_content.py"
click node_content_service "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/version_content_service.py"
click node_analysis_router "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/analysis.py"
click node_analysis_service "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/analysis_service.py"
click node_analysis_modules "https://github.com/srijan-mukherjee/sih/tree/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/analysis"
click node_ip_router "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/ip.py"
click node_ip_screening "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/analysis/ip_routes.py"
click node_change_router "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/change_impact.py"
click node_change_service "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/change_impact_service.py"
click node_knowledge_router "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/knowledge.py"
click node_ingestion "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/ingestion.py"
click node_retrieval "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/retrieval.py"
click node_generation "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/generation.py"
click node_db "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/database.py"
click node_rag_models "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/models/rag_models.py"
click node_embedding "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/embeddings/provider.py"
click node_vector_search "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/vector_search.py"
click node_keyword_search "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/keyword_search.py"
click node_reranker "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/reranker.py"
click node_llm "https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/llm/provider.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_frontend,node_user toneBlue
class node_app,node_auth_router,node_auth_service,node_jwt toneAmber
class node_product_router,node_product_service,node_content_router,node_content_service,node_analysis_router,node_analysis_service,node_analysis_modules,node_ip_router,node_ip_screening,node_change_router,node_change_service toneMint
class node_knowledge_router,node_ingestion,node_retrieval,node_generation,node_vector_search,node_keyword_search,node_reranker toneRose
class node_db,node_rag_models,node_embedding,node_llm toneIndigo
```

## Components

### User interface

- [Web application](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/FRONTEND/src/App.jsx): `OneDrive/Desktop/sih/IP-SHAKTI/FRONTEND/src/App.jsx`

### API and identity

- [FastAPI application](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/main.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/main.py`
- [Authentication routes](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/auth.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/auth.py`
- [Authentication service](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/auth_service.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/auth_service.py`
- [JWT handling](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/utils/jwt_handler.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/utils/jwt_handler.py`

### Product review

- [Product routes](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/products.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/products.py`
- [Product service](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/product_service.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/product_service.py`
- [Version content routes](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/version_content.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/version_content.py`
- [Version content service](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/version_content_service.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/version_content_service.py`
- [Analysis routes](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/analysis.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/analysis.py`
- [Analysis orchestration](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/analysis_service.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/analysis_service.py`
- [Claim and classification analysis](https://github.com/srijan-mukherjee/sih/tree/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/analysis): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/analysis`
- [IP screening routes](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/ip.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/ip.py`
- [IP route screening](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/analysis/ip_routes.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/analysis/ip_routes.py`
- [Change-impact routes](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/change_impact.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/change_impact.py`
- [Change-impact review](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/change_impact_service.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/services/change_impact_service.py`

### Knowledge assistant

- [Knowledge routes](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/knowledge.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/routers/knowledge.py`
- [Document ingestion](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/ingestion.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/ingestion.py`
- [Hybrid retrieval](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/retrieval.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/retrieval.py`
- [Answer generation](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/generation.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/generation.py`
- [Vector search](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/vector_search.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/vector_search.py`
- [Keyword search](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/keyword_search.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/keyword_search.py`
- [Result reranking](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/reranker.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/rag/reranker.py`

### Persistence and providers

- [Application database](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/database.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/database.py`
- [Corpus document and chunk records](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/models/rag_models.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/models/rag_models.py`
- [Embedding provider](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/embeddings/provider.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/embeddings/provider.py`
- [Language model provider](https://github.com/srijan-mukherjee/sih/blob/main/OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/llm/provider.py): `OneDrive/Desktop/sih/IP-SHAKTI/BACKEND/app/llm/provider.py`

### Other components

- **Product user**

## Connections

- Product user → Web application: uses
- Web application → FastAPI application: API requests
- FastAPI application → Authentication routes: registers
- FastAPI application → Product routes: registers
- FastAPI application → Version content routes: registers
- FastAPI application → Analysis routes: registers
- FastAPI application → IP screening routes: registers
- FastAPI application → Change-impact routes: registers
- FastAPI application → Knowledge routes: registers
- Authentication routes → Authentication service: delegates
- Authentication service → Application database: queries and writes
- Authentication service → JWT handling: creates tokens
- Product routes → Product service: delegates
- Product service → Application database: reads and writes
- Version content routes → Version content service: delegates
- Version content service → Application database: reads and writes
- Analysis routes → Analysis orchestration: delegates
- Analysis orchestration → Application database: reads and writes
- Analysis orchestration → Claim and classification analysis: runs analysis
- Analysis orchestration → IP route screening: builds route map
- IP screening routes → IP route screening: requests screening
- Change-impact routes → Change-impact review: delegates
- Change-impact review → Application database: reads and writes
- Knowledge routes → Document ingestion: starts ingestion
- Document ingestion → Embedding provider: embeds chunks
- Document ingestion → Application database: stores chunks
- Application database → Corpus document and chunk records: stores records
- Hybrid retrieval → Embedding provider: embeds query
- Hybrid retrieval → Vector search: runs vector search
- Hybrid retrieval → Keyword search: runs keyword search
- Hybrid retrieval → Result reranking: reranks results
- Vector search → Application database: searches vectors
- Keyword search → Application database: searches text
