# celestialgeeks/ip-sakti-sahayak architecture

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

- Interactive diagram: https://gitdiagram.com/celestialgeeks/ip-sakti-sahayak
- Repository: https://github.com/celestialgeeks/ip-sakti-sahayak

## Overview

IP-SAKTI Sahayak combines citation-grounded Ayush IP research with a founder-facing commercialization workflow: research and compliance checks, deterministic formulation simulation, registration guidance, and business enablement. The chat path is supported by sampled frontend and backend code; several additional product branches are documented in the README and represented by their exact route and page paths, but their internal wiring is not detailed here.

Main entry points: [`backend/app/main.py`](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/main.py) (FastAPI application), [`backend/app/core/rag_pipeline.py`](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/core/rag_pipeline.py) (RAG orchestration), [`backend/app/api/routes/chat.py`](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/chat.py) (Chat endpoint), [`frontend/src/app/chat/page.tsx`](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/frontend/src/app/chat/page.tsx) (Chat interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User Experience"]
  node_chat_ui["Chat interface<br/>[page.tsx]"]
  node_chat_hook["Chat streaming<br/>[useChat.ts]"]
  node_library_ui["Ayurvedic library<br/>[page.tsx]"]
  node_lab_ui["Formulation Lab<br/>[page.tsx]"]
  node_wizard_ui["Compliance wizard<br/>[page.tsx]"]
  node_business_ui["Business tools<br/>[page.tsx]"]
end

subgraph group_api["API Surface"]
  node_app["FastAPI application<br/>[main.py]"]
  node_chat_route["Chat endpoint<br/>[chat.py]"]
  node_classify_route["Classification endpoint<br/>[classify.py]"]
  node_abs_route["ABS checker<br/>[abs_check.py]"]
  node_lab_route["Formulation endpoint<br/>[formulation_lab.py]"]
  node_wizard_route["Wizard endpoint<br/>[wizard.py]"]
  node_business_route["Business endpoint<br/>[business.py]"]
  node_library_route["Library endpoint<br/>[ayurveda.py]"]
end

subgraph group_research["IP Research"]
  node_rag["RAG orchestration<br/>[rag_pipeline.py]"]
  node_citation["Citation verification<br/>[citation_engine.py]"]
end

subgraph group_founder["Founder Tools"]
  node_form_engine["Simulation engine<br/>[engine.py]"]
  node_ayurveda_service["Curated library"]
  node_business_service["Business catalogs"]
end

subgraph group_platform["Data And Integrations"]
  node_nvidia["NVIDIA NIM<br/>[nvidia_nim.py]"]
  node_qdrant[("Vector search<br/>[qdrant_service.py]")]
  node_sarvam["Indic translation<br/>[sarvam.py]"]
  node_supabase[("Session storage")]
end

node_user(("Ayush founder"))

node_user -->|"asks research"| node_chat_ui
node_user -->|"browses knowledge"| node_library_ui
node_user -->|"tests formulation"| node_lab_ui
node_user -->|"seeks registration"| node_wizard_ui
node_user -->|"seeks support"| node_business_ui
node_chat_ui -->|"submits query"| node_chat_hook
node_chat_hook -->|"POST chat"| node_chat_route
node_app -->|"mounts route"| node_chat_route
node_app -->|"mounts route"| node_classify_route
node_app -->|"mounts route"| node_abs_route
node_app -->|"mounts route"| node_lab_route
node_app -->|"mounts route"| node_wizard_route
node_app -->|"mounts route"| node_business_route
node_app -->|"mounts route"| node_library_route
node_chat_route -->|"runs research"| node_rag
node_rag -->|"generates and embeds"| node_nvidia
node_rag -->|"retrieves documents"| node_qdrant
node_rag -.->|"translates query"| node_sarvam
node_rag -.->|"saves sessions"| node_supabase
node_rag -->|"extracts citations"| node_citation
node_lab_route -->|"simulates formulation"| node_form_engine
node_library_route -->|"serves library"| node_ayurveda_service
node_business_route -->|"uses catalogs"| node_business_service

click node_chat_ui "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/frontend/src/app/chat/page.tsx"
click node_chat_hook "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/frontend/src/hooks/useChat.ts"
click node_library_ui "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/frontend/src/app/ayurveda/page.tsx"
click node_lab_ui "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/frontend/src/app/formulation-lab/page.tsx"
click node_wizard_ui "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/frontend/src/app/wizard/page.tsx"
click node_business_ui "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/frontend/src/app/business/page.tsx"
click node_app "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/main.py"
click node_chat_route "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/chat.py"
click node_classify_route "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/classify.py"
click node_abs_route "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/abs_check.py"
click node_lab_route "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/formulation_lab.py"
click node_wizard_route "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/wizard.py"
click node_business_route "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/business.py"
click node_library_route "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/ayurveda.py"
click node_rag "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/core/rag_pipeline.py"
click node_citation "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/core/citation_engine.py"
click node_form_engine "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/core/formulation/engine.py"
click node_ayurveda_service "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/services/ayurveda_service.py"
click node_business_service "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/services/business_service.py"
click node_nvidia "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/services/nvidia_nim.py"
click node_qdrant "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/services/qdrant_service.py"
click node_sarvam "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/services/sarvam.py"
click node_supabase "https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/services/supabase_service.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_chat_ui,node_chat_hook,node_library_ui,node_lab_ui,node_wizard_ui,node_business_ui toneBlue
class node_app,node_chat_route,node_classify_route,node_abs_route,node_lab_route,node_wizard_route,node_business_route,node_library_route toneAmber
class node_rag,node_citation toneMint
class node_form_engine,node_ayurveda_service,node_business_service toneRose
class node_nvidia,node_qdrant,node_sarvam,node_supabase,node_user toneIndigo
```

## Components

### User Experience

- [Chat interface](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/frontend/src/app/chat/page.tsx): `frontend/src/app/chat/page.tsx`
- [Chat streaming](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/frontend/src/hooks/useChat.ts): `frontend/src/hooks/useChat.ts`
- [Ayurvedic library](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/frontend/src/app/ayurveda/page.tsx): `frontend/src/app/ayurveda/page.tsx`
- [Formulation Lab](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/frontend/src/app/formulation-lab/page.tsx): `frontend/src/app/formulation-lab/page.tsx`
- [Compliance wizard](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/frontend/src/app/wizard/page.tsx): `frontend/src/app/wizard/page.tsx`
- [Business tools](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/frontend/src/app/business/page.tsx): `frontend/src/app/business/page.tsx`

### API Surface

- [FastAPI application](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/main.py): `backend/app/main.py`
- [Chat endpoint](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/chat.py): `backend/app/api/routes/chat.py`
- [Classification endpoint](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/classify.py): `backend/app/api/routes/classify.py`
- [ABS checker](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/abs_check.py): `backend/app/api/routes/abs_check.py`
- [Formulation endpoint](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/formulation_lab.py): `backend/app/api/routes/formulation_lab.py`
- [Wizard endpoint](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/wizard.py): `backend/app/api/routes/wizard.py`
- [Business endpoint](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/business.py): `backend/app/api/routes/business.py`
- [Library endpoint](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/api/routes/ayurveda.py): `backend/app/api/routes/ayurveda.py`

### IP Research

- [RAG orchestration](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/core/rag_pipeline.py): `backend/app/core/rag_pipeline.py`
- [Citation verification](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/core/citation_engine.py): `backend/app/core/citation_engine.py`

### Founder Tools

- [Simulation engine](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/core/formulation/engine.py): `backend/app/core/formulation/engine.py`
- [Curated library](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/services/ayurveda_service.py): `backend/app/services/ayurveda_service.py`
- [Business catalogs](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/services/business_service.py): `backend/app/services/business_service.py`

### Data And Integrations

- [NVIDIA NIM](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/services/nvidia_nim.py): `backend/app/services/nvidia_nim.py`
- [Vector search](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/services/qdrant_service.py): `backend/app/services/qdrant_service.py`
- [Indic translation](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/services/sarvam.py): `backend/app/services/sarvam.py`
- [Session storage](https://github.com/celestialgeeks/ip-sakti-sahayak/blob/master/backend/app/services/supabase_service.py): `backend/app/services/supabase_service.py`

### Other components

- **Ayush founder**

## Connections

- Ayush founder → Chat interface: asks research
- Ayush founder → Ayurvedic library: browses knowledge
- Ayush founder → Formulation Lab: tests formulation
- Ayush founder → Compliance wizard: seeks registration
- Ayush founder → Business tools: seeks support
- Chat interface → Chat streaming: submits query
- Chat streaming → Chat endpoint: POST chat
- FastAPI application → Chat endpoint: mounts route
- FastAPI application → Classification endpoint: mounts route
- FastAPI application → ABS checker: mounts route
- FastAPI application → Formulation endpoint: mounts route
- FastAPI application → Wizard endpoint: mounts route
- FastAPI application → Business endpoint: mounts route
- FastAPI application → Library endpoint: mounts route
- Chat endpoint → RAG orchestration: runs research
- RAG orchestration → NVIDIA NIM: generates and embeds
- RAG orchestration → Vector search: retrieves documents
- RAG orchestration → Indic translation: translates query
- RAG orchestration → Session storage: saves sessions
- RAG orchestration → Citation verification: extracts citations
- Formulation endpoint → Simulation engine: simulates formulation
- Library endpoint → Curated library: serves library
- Business endpoint → Business catalogs: uses catalogs
