# rohitguddin/graminai architecture

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

- Interactive diagram: https://gitdiagram.com/rohitguddin/graminai
- Repository: https://github.com/rohitguddin/graminai

## Overview

GraminAI is a scaffold for a multilingual business-feasibility advisory product. The documented user journey runs from business inputs through four independent analyses—market, geographic, competition, and financial—then opportunity synthesis, SWOT, and a consolidated report. The API and workflow structure, agent contexts, schemas, provider adapters, calculator, and scheme repositories are represented; the README describes several capabilities as planned. Provider calls and persistence wiring are not established by the sampled source, so uncertain connections are omitted.

Main entry points: [`apps/api/app/workflows/graph.py`](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/workflows/graph.py) (Workflow Graph), [`apps/api/app/providers/implementations/openrouter_llm.py`](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/providers/implementations/openrouter_llm.py) (LLM Adapter), [`apps/api/app/agents/financial/agent.py`](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/financial/agent.py) (Financial Agent), [`apps/web/hooks/useFeasibility.ts`](https://github.com/rohitguddin/graminai/blob/main/apps/web/hooks/useFeasibility.ts) (Feasibility Hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_web["Web App<br/>[page.tsx]"]
  node_feasibility_hook["Feasibility Hook<br/>[useFeasibility.ts]"]
  node_report_result["Feasibility Report<br/>[report.py]"]
end

subgraph group_orchestration["API Workflow"]
  node_api["FastAPI App<br/>[main.py]"]
  node_feasibility_route["Feasibility Route<br/>[feasibility.py]"]
  node_feasibility_service["Feasibility Service<br/>[feasibility.py]"]
  node_workflow["Workflow Graph<br/>[graph.py]"]
end

subgraph group_analysis["Feasibility Analysis"]
  node_market_agent["Market Agent<br/>[agent.py]"]
  node_geographic_agent["Geographic Agent<br/>[agent.py]"]
  node_competition_agent["Competition Agent<br/>[agent.py]"]
  node_financial_agent["Financial Agent<br/>[agent.py]"]
  node_opportunity_agent["Opportunity Agent<br/>[agent.py]"]
  node_swot_agent["SWOT Agent<br/>[agent.py]"]
  node_report_agent["Report Agent<br/>[agent.py]"]
  node_financial_calculator["Financial Calculator<br/>[financial.py]"]
end

subgraph group_integrations["Data Integrations"]
  node_market_provider["Market Data Provider<br/>[datagov_market.py]"]
  node_geographic_provider["Geographic Provider"]
  node_competition_provider["Places Provider"]
  node_government_provider["Government Schemes"]
  node_llm_provider["LLM Adapter<br/>[openrouter_llm.py]"]
end

subgraph group_state["Schemes and State"]
  node_scheme_repository["Scheme Repository<br/>[schemes.py]"]
  node_scheme_database[("Scheme Database<br/>[models.py]")]
end

node_entrepreneur(("Entrepreneur"))

node_entrepreneur -->|"enters inputs"| node_web
node_web -->|"submits request"| node_feasibility_hook
node_feasibility_hook -->|"posts request"| node_api
node_api -->|"dispatches route"| node_feasibility_route
node_feasibility_route -->|"handles analysis"| node_feasibility_service
node_feasibility_service -->|"starts workflow"| node_workflow
node_workflow -->|"runs independently"| node_market_agent
node_workflow -->|"runs independently"| node_geographic_agent
node_workflow -->|"runs independently"| node_competition_agent
node_workflow -->|"runs independently"| node_financial_agent
node_workflow -->|"then synthesizes"| node_opportunity_agent
node_workflow -->|"then synthesizes"| node_swot_agent
node_workflow -->|"generates report"| node_report_agent
node_financial_agent -->|"calculates figures"| node_financial_calculator
node_report_agent -->|"produces report"| node_report_result
node_feasibility_hook -->|"receives response"| node_report_result
node_market_agent -.-> node_market_provider
node_geographic_agent -.-> node_geographic_provider
node_competition_agent -.-> node_competition_provider
node_financial_agent -.-> node_government_provider
node_government_provider -.-> node_scheme_repository
node_scheme_repository -.-> node_scheme_database
node_market_agent -.-> node_llm_provider
node_geographic_agent -.-> node_llm_provider
node_competition_agent -.-> node_llm_provider
node_financial_agent -.-> node_llm_provider
node_opportunity_agent -.-> node_llm_provider
node_swot_agent -.-> node_llm_provider

click node_web "https://github.com/rohitguddin/graminai/blob/main/apps/web/app/page.tsx"
click node_feasibility_hook "https://github.com/rohitguddin/graminai/blob/main/apps/web/hooks/useFeasibility.ts"
click node_api "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/main.py"
click node_feasibility_route "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/api/routes/feasibility.py"
click node_feasibility_service "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/services/feasibility.py"
click node_workflow "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/workflows/graph.py"
click node_market_agent "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/market/agent.py"
click node_geographic_agent "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/geographic/agent.py"
click node_competition_agent "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/competition/agent.py"
click node_financial_agent "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/financial/agent.py"
click node_opportunity_agent "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/opportunity/agent.py"
click node_swot_agent "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/swot/agent.py"
click node_report_agent "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/report/agent.py"
click node_financial_calculator "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/calculators/financial.py"
click node_market_provider "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/providers/implementations/datagov_market.py"
click node_geographic_provider "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/providers/implementations/google_maps_geographic.py"
click node_competition_provider "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/providers/implementations/google_places_competition.py"
click node_government_provider "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/providers/implementations/government_schemes.py"
click node_llm_provider "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/providers/implementations/openrouter_llm.py"
click node_scheme_repository "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/repositories/schemes.py"
click node_scheme_database "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/database/models.py"
click node_report_result "https://github.com/rohitguddin/graminai/blob/main/apps/api/app/schemas/report.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_web,node_feasibility_hook,node_report_result toneBlue
class node_api,node_feasibility_route,node_feasibility_service,node_workflow toneAmber
class node_market_agent,node_geographic_agent,node_competition_agent,node_financial_agent,node_opportunity_agent,node_swot_agent,node_report_agent,node_financial_calculator toneMint
class node_market_provider,node_geographic_provider,node_competition_provider,node_government_provider,node_llm_provider toneRose
class node_scheme_repository,node_scheme_database,node_entrepreneur toneIndigo
```

## Components

### User Experience

- [Web App](https://github.com/rohitguddin/graminai/blob/main/apps/web/app/page.tsx): `apps/web/app/page.tsx`
- [Feasibility Hook](https://github.com/rohitguddin/graminai/blob/main/apps/web/hooks/useFeasibility.ts): `apps/web/hooks/useFeasibility.ts`
- [Feasibility Report](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/schemas/report.py): `apps/api/app/schemas/report.py`

### API Workflow

- [FastAPI App](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/main.py): `apps/api/app/main.py`
- [Feasibility Route](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/api/routes/feasibility.py): `apps/api/app/api/routes/feasibility.py`
- [Feasibility Service](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/services/feasibility.py): `apps/api/app/services/feasibility.py`
- [Workflow Graph](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/workflows/graph.py): `apps/api/app/workflows/graph.py`

### Feasibility Analysis

- [Market Agent](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/market/agent.py): `apps/api/app/agents/market/agent.py`
- [Geographic Agent](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/geographic/agent.py): `apps/api/app/agents/geographic/agent.py`
- [Competition Agent](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/competition/agent.py): `apps/api/app/agents/competition/agent.py`
- [Financial Agent](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/financial/agent.py): `apps/api/app/agents/financial/agent.py`
- [Opportunity Agent](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/opportunity/agent.py): `apps/api/app/agents/opportunity/agent.py`
- [SWOT Agent](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/swot/agent.py): `apps/api/app/agents/swot/agent.py`
- [Report Agent](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/agents/report/agent.py): `apps/api/app/agents/report/agent.py`
- [Financial Calculator](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/calculators/financial.py): `apps/api/app/calculators/financial.py`

### Data Integrations

- [Market Data Provider](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/providers/implementations/datagov_market.py): `apps/api/app/providers/implementations/datagov_market.py`
- [Geographic Provider](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/providers/implementations/google_maps_geographic.py): `apps/api/app/providers/implementations/google_maps_geographic.py`
- [Places Provider](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/providers/implementations/google_places_competition.py): `apps/api/app/providers/implementations/google_places_competition.py`
- [Government Schemes](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/providers/implementations/government_schemes.py): `apps/api/app/providers/implementations/government_schemes.py`
- [LLM Adapter](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/providers/implementations/openrouter_llm.py): `apps/api/app/providers/implementations/openrouter_llm.py`

### Schemes and State

- [Scheme Repository](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/repositories/schemes.py): `apps/api/app/repositories/schemes.py`
- [Scheme Database](https://github.com/rohitguddin/graminai/blob/main/apps/api/app/database/models.py): `apps/api/app/database/models.py`

### Other components

- **Entrepreneur**

## Connections

- Entrepreneur → Web App: enters inputs
- Web App → Feasibility Hook: submits request
- Feasibility Hook → FastAPI App: posts request
- FastAPI App → Feasibility Route: dispatches route
- Feasibility Route → Feasibility Service: handles analysis
- Feasibility Service → Workflow Graph: starts workflow
- Workflow Graph → Market Agent: runs independently
- Workflow Graph → Geographic Agent: runs independently
- Workflow Graph → Competition Agent: runs independently
- Workflow Graph → Financial Agent: runs independently
- Workflow Graph → Opportunity Agent: then synthesizes
- Workflow Graph → SWOT Agent: then synthesizes
- Workflow Graph → Report Agent: generates report
- Financial Agent → Financial Calculator: calculates figures
- Report Agent → Feasibility Report: produces report
- Feasibility Hook → Feasibility Report: receives response
- Market Agent → Market Data Provider
- Geographic Agent → Geographic Provider
- Competition Agent → Places Provider
- Financial Agent → Government Schemes
- Government Schemes → Scheme Repository
- Scheme Repository → Scheme Database
- Market Agent → LLM Adapter
- Geographic Agent → LLM Adapter
- Competition Agent → LLM Adapter
- Financial Agent → LLM Adapter
- Opportunity Agent → LLM Adapter
- SWOT Agent → LLM Adapter
