# deeagg/ayur-intel architecture

> Architecture diagram of the GitHub repository deeagg/ayur-intel, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deeagg/ayur-intel
- Repository: https://github.com/deeagg/ayur-intel

## Overview

AYUR-INTEL is an evidence-backed product intelligence and decision-support platform for Ayurvedic product development. Its principal workflow begins with a product definition and passport, then organizes case-level innovation, patent/IP, regulatory, risk, and knowledge analysis before monitoring and review. The graph preserves the documented discovery, plant, assistant, and governance capabilities. Relationships are limited to README workflow statements and source-index references or excerpts; several specialized routes and services were not sampled, so uncertain links are omitted or dashed.

Main entry points: [`api/services/product_case_service.py`](https://github.com/deeagg/ayur-intel/blob/master/api/services/product_case_service.py) (Product case management), [`api/main.py`](https://github.com/deeagg/ayur-intel/blob/master/api/main.py) (FastAPI application), [`api/services/knowledge_service.py`](https://github.com/deeagg/ayur-intel/blob/master/api/services/knowledge_service.py) (Knowledge hub), [`api/routers/product_cases.py`](https://github.com/deeagg/ayur-intel/blob/master/api/routers/product_cases.py) (Product case API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_app["FastAPI application<br/>[main.py]"]
  node_db[("SQLAlchemy database<br/>[database.py]")]
  node_security["Auth and access controls<br/>[security.py]"]
  node_models["Domain records<br/>[models.py]"]
end

subgraph group_case["Product case"]
  node_case_api["Product case API<br/>[product_cases.py]"]
  node_case_service["Product case management"]
  node_passport["Product Passport<br/>[passport.js]"]
end

subgraph group_intelligence["Case intelligence"]
  node_innovation["Innovation analysis"]
  node_patent["Patent intelligence<br/>[patent_service.py]"]
  node_patent_adapter["Patent retrieval adapter<br/>[patent_adapter.py]"]
  node_ip["IP strategy"]
  node_regulatory["Regulatory pathways"]
  node_risk["Risk assessment<br/>[risk_service.py]"]
end

subgraph group_knowledge["Knowledge discovery"]
  node_plant["Plant discovery"]
  node_plantnet["Plant identification"]
  node_knowledge["Knowledge hub"]
  node_dravya["DRAVYA taxonomy<br/>[dravya_service.py]"]
  node_synthesis["Evidence synthesis"]
  node_graph["Knowledge graph"]
  node_assistant["RAG assistant"]
end

subgraph group_governance["Monitoring and review"]
  node_monitoring["Product monitoring"]
  node_review["Human review<br/>[review_service.py]"]
  node_audit["Audit trail<br/>[audit_service.py]"]
end

node_user(("Product developer"))

node_user -->|"uses"| node_app
node_app -->|"routes requests"| node_case_api
node_app -->|"initializes"| node_db
node_case_api -->|"delegates"| node_case_service
node_case_service -->|"persists cases"| node_db
node_case_service -->|"uses records"| node_models
node_user -->|"defines product"| node_passport
node_passport -.->|"submits case"| node_case_api
node_case_service -->|"anchors analysis"| node_innovation
node_case_service -->|"anchors screening"| node_patent
node_patent -->|"retrieves records"| node_patent_adapter
node_case_service -->|"anchors strategy"| node_ip
node_case_service -->|"anchors pathways"| node_regulatory
node_case_service -->|"anchors assessment"| node_risk
node_user -->|"discovers plants"| node_plant
node_plant -.->|"identifies plants"| node_plantnet
node_user -->|"explores evidence"| node_knowledge
node_knowledge -->|"uses taxonomy"| node_dravya
node_knowledge -->|"synthesizes evidence"| node_synthesis
node_user -->|"explores relationships"| node_graph
node_user -.->|"asks questions"| node_assistant
node_case_service -->|"tracks lifecycle"| node_monitoring
node_monitoring -->|"records activity"| node_audit
node_user -.->|"reviews findings"| node_review
node_review -->|"records decisions"| node_audit
node_user -.->|"authenticates"| node_security

click node_app "https://github.com/deeagg/ayur-intel/blob/master/api/main.py"
click node_db "https://github.com/deeagg/ayur-intel/blob/master/api/core/database.py"
click node_security "https://github.com/deeagg/ayur-intel/blob/master/api/core/security.py"
click node_case_api "https://github.com/deeagg/ayur-intel/blob/master/api/routers/product_cases.py"
click node_case_service "https://github.com/deeagg/ayur-intel/blob/master/api/services/product_case_service.py"
click node_passport "https://github.com/deeagg/ayur-intel/blob/master/web/static/js/passport.js"
click node_innovation "https://github.com/deeagg/ayur-intel/blob/master/api/services/innovation_service.py"
click node_patent "https://github.com/deeagg/ayur-intel/blob/master/api/services/patent_service.py"
click node_patent_adapter "https://github.com/deeagg/ayur-intel/blob/master/api/services/patent_adapter.py"
click node_ip "https://github.com/deeagg/ayur-intel/blob/master/api/services/ip_strategy_service.py"
click node_regulatory "https://github.com/deeagg/ayur-intel/blob/master/api/services/regulatory_service.py"
click node_risk "https://github.com/deeagg/ayur-intel/blob/master/api/services/risk_service.py"
click node_plant "https://github.com/deeagg/ayur-intel/blob/master/api/services/plant_discovery_service.py"
click node_plantnet "https://github.com/deeagg/ayur-intel/blob/master/api/services/plantnet_service.py"
click node_knowledge "https://github.com/deeagg/ayur-intel/blob/master/api/services/knowledge_service.py"
click node_dravya "https://github.com/deeagg/ayur-intel/blob/master/api/services/dravya_service.py"
click node_synthesis "https://github.com/deeagg/ayur-intel/blob/master/api/services/knowledge_synthesis_service.py"
click node_graph "https://github.com/deeagg/ayur-intel/blob/master/api/services/knowledge_graph_service.py"
click node_assistant "https://github.com/deeagg/ayur-intel/blob/master/api/services/assistant_service.py"
click node_monitoring "https://github.com/deeagg/ayur-intel/blob/master/api/services/monitoring_service.py"
click node_review "https://github.com/deeagg/ayur-intel/blob/master/api/services/review_service.py"
click node_audit "https://github.com/deeagg/ayur-intel/blob/master/api/services/audit_service.py"
click node_models "https://github.com/deeagg/ayur-intel/blob/master/api/models/models.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_app,node_db,node_security,node_models toneBlue
class node_case_api,node_case_service,node_passport toneAmber
class node_innovation,node_patent,node_patent_adapter,node_ip,node_regulatory,node_risk toneMint
class node_plant,node_plantnet,node_knowledge,node_dravya,node_synthesis,node_graph,node_assistant toneRose
class node_monitoring,node_review,node_audit,node_user toneIndigo
```

## Components

### Application entry

- [FastAPI application](https://github.com/deeagg/ayur-intel/blob/master/api/main.py): `api/main.py`
- [SQLAlchemy database](https://github.com/deeagg/ayur-intel/blob/master/api/core/database.py): `api/core/database.py`
- [Auth and access controls](https://github.com/deeagg/ayur-intel/blob/master/api/core/security.py): `api/core/security.py`
- [Domain records](https://github.com/deeagg/ayur-intel/blob/master/api/models/models.py): `api/models/models.py`

### Product case

- [Product case API](https://github.com/deeagg/ayur-intel/blob/master/api/routers/product_cases.py): `api/routers/product_cases.py`
- [Product case management](https://github.com/deeagg/ayur-intel/blob/master/api/services/product_case_service.py): `api/services/product_case_service.py`
- [Product Passport](https://github.com/deeagg/ayur-intel/blob/master/web/static/js/passport.js): `web/static/js/passport.js`

### Case intelligence

- [Innovation analysis](https://github.com/deeagg/ayur-intel/blob/master/api/services/innovation_service.py): `api/services/innovation_service.py`
- [Patent intelligence](https://github.com/deeagg/ayur-intel/blob/master/api/services/patent_service.py): `api/services/patent_service.py`
- [Patent retrieval adapter](https://github.com/deeagg/ayur-intel/blob/master/api/services/patent_adapter.py): `api/services/patent_adapter.py`
- [IP strategy](https://github.com/deeagg/ayur-intel/blob/master/api/services/ip_strategy_service.py): `api/services/ip_strategy_service.py`
- [Regulatory pathways](https://github.com/deeagg/ayur-intel/blob/master/api/services/regulatory_service.py): `api/services/regulatory_service.py`
- [Risk assessment](https://github.com/deeagg/ayur-intel/blob/master/api/services/risk_service.py): `api/services/risk_service.py`

### Knowledge discovery

- [Plant discovery](https://github.com/deeagg/ayur-intel/blob/master/api/services/plant_discovery_service.py): `api/services/plant_discovery_service.py`
- [Plant identification](https://github.com/deeagg/ayur-intel/blob/master/api/services/plantnet_service.py): `api/services/plantnet_service.py`
- [Knowledge hub](https://github.com/deeagg/ayur-intel/blob/master/api/services/knowledge_service.py): `api/services/knowledge_service.py`
- [DRAVYA taxonomy](https://github.com/deeagg/ayur-intel/blob/master/api/services/dravya_service.py): `api/services/dravya_service.py`
- [Evidence synthesis](https://github.com/deeagg/ayur-intel/blob/master/api/services/knowledge_synthesis_service.py): `api/services/knowledge_synthesis_service.py`
- [Knowledge graph](https://github.com/deeagg/ayur-intel/blob/master/api/services/knowledge_graph_service.py): `api/services/knowledge_graph_service.py`
- [RAG assistant](https://github.com/deeagg/ayur-intel/blob/master/api/services/assistant_service.py): `api/services/assistant_service.py`

### Monitoring and review

- [Product monitoring](https://github.com/deeagg/ayur-intel/blob/master/api/services/monitoring_service.py): `api/services/monitoring_service.py`
- [Human review](https://github.com/deeagg/ayur-intel/blob/master/api/services/review_service.py): `api/services/review_service.py`
- [Audit trail](https://github.com/deeagg/ayur-intel/blob/master/api/services/audit_service.py): `api/services/audit_service.py`

### Other components

- **Product developer**

## Connections

- Product developer → FastAPI application: uses (evidence: `README.md`)
- FastAPI application → Product case API: routes requests (evidence: `api/main.py`)
- FastAPI application → SQLAlchemy database: initializes (evidence: `api/main.py`)
- Product case API → Product case management: delegates
- Product case management → SQLAlchemy database: persists cases (evidence: `api/services/product_case_service.py`)
- Product case management → Domain records: uses records (evidence: `api/services/product_case_service.py`)
- Product developer → Product Passport: defines product (evidence: `README.md`)
- Product Passport → Product case API: submits case
- Product case management → Innovation analysis: anchors analysis (evidence: `README.md`)
- Product case management → Patent intelligence: anchors screening (evidence: `README.md`)
- Patent intelligence → Patent retrieval adapter: retrieves records (evidence: `api/services/patent_service.py`)
- Product case management → IP strategy: anchors strategy (evidence: `README.md`)
- Product case management → Regulatory pathways: anchors pathways (evidence: `README.md`)
- Product case management → Risk assessment: anchors assessment (evidence: `README.md`)
- Product developer → Plant discovery: discovers plants (evidence: `README.md`)
- Plant discovery → Plant identification: identifies plants
- Product developer → Knowledge hub: explores evidence (evidence: `README.md`)
- Knowledge hub → DRAVYA taxonomy: uses taxonomy (evidence: `api/routers/knowledge.py`)
- Knowledge hub → Evidence synthesis: synthesizes evidence (evidence: `api/routers/knowledge.py`)
- Product developer → Knowledge graph: explores relationships (evidence: `README.md`)
- Product developer → RAG assistant: asks questions
- Product case management → Product monitoring: tracks lifecycle (evidence: `README.md`)
- Product monitoring → Audit trail: records activity (evidence: `api/routers/monitoring.py`)
- Product developer → Human review: reviews findings
- Human review → Audit trail: records decisions (evidence: `api/services/review_service.py`)
- Product developer → Auth and access controls: authenticates
