# keertana-n/verisai architecture

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

- Interactive diagram: https://gitdiagram.com/keertana-n/verisai
- Repository: https://github.com/keertana-n/verisai

## Overview

VerisAI combines a local document-to-compliance pipeline with a React dashboard. The backend entry point reads one file from its data directory, extracts text or tabular records, then requests legal analysis, a compliance verdict, and a plain-language explanation. A separate document-reader agent can extract structured fields, but the shown pipeline does not invoke it. The frontend presents dashboard, tax, compliance, and account screens; no frontend-to-backend connection is shown in the sampled files, so that relationship is omitted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/keertana-n/verisai/blob/main/frontend/src/App.tsx) (Route Application), [`frontend/src/layouts/DashboardLayout.tsx`](https://github.com/keertana-n/verisai/blob/main/frontend/src/layouts/DashboardLayout.tsx) (Dashboard Layout), [`backend/main.py`](https://github.com/keertana-n/verisai/blob/main/backend/main.py) (Pipeline & File Reader), [`backend/legal_knowledge_agent/agent.py`](https://github.com/keertana-n/verisai/blob/main/backend/legal_knowledge_agent/agent.py) (Legal Knowledge Agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_processing["Document Processing"]
  node_pipeline["Pipeline &amp; File Reader<br/>[main.py]"]
  node_reader["Document Reader Agent<br/>[agent.py]"]
end

subgraph group_analysis["Compliance Analysis"]
  node_legal["Legal Knowledge Agent<br/>[agent.py]"]
  node_verdict["Compliance Verdict Agent<br/>[agent.py]"]
  node_explanation["Explanation Agent<br/>[agent.py]"]
end

subgraph group_experience["Dashboard Experience"]
  node_app["Route Application<br/>[App.tsx]"]
  node_layout["Dashboard Layout"]
  node_dashboard["Dashboard Home<br/>[DashboardHome.tsx]"]
  node_taxes["Direct &amp; Indirect Taxes<br/>[DirectTaxes.tsx]"]
  node_indirect["Indirect Taxes<br/>[IndirectTaxes.tsx]"]
  node_compliance["Compliance Score"]
  node_settings["Settings<br/>[Settings.tsx]"]
end

subgraph group_account["Account Screens"]
  node_login["Login<br/>[Login.tsx]"]
  node_signup["Signup<br/>[Signup.tsx]"]
  node_landing["Landing Page<br/>[Index &#40;1&#41;.tsx]"]
  node_notfound["Not Found<br/>[NotFound.tsx]"]
end

node_operator(("User"))
node_gemini{{"Gemini API"}}

node_operator -->|"provides file"| node_pipeline
node_pipeline -->|"submits document"| node_legal
node_pipeline -->|"submits facts and analysis"| node_verdict
node_pipeline -->|"submits verdict"| node_explanation
node_legal -->|"requests analysis"| node_gemini
node_verdict -->|"requests verdict"| node_gemini
node_explanation -->|"requests explanation"| node_gemini
node_operator -->|"opens interface"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_signup
node_app -->|"wraps dashboard routes"| node_layout
node_app -->|"routes unmatched paths"| node_notfound
node_layout -.->|"renders route outlet"| node_dashboard
node_layout -.->|"renders route outlet"| node_taxes
node_layout -.->|"renders route outlet"| node_indirect
node_layout -.->|"renders route outlet"| node_compliance
node_layout -.->|"renders route outlet"| node_settings

click node_pipeline "https://github.com/keertana-n/verisai/blob/main/backend/main.py"
click node_reader "https://github.com/keertana-n/verisai/blob/main/backend/document_reader_agent/agent.py"
click node_legal "https://github.com/keertana-n/verisai/blob/main/backend/legal_knowledge_agent/agent.py"
click node_verdict "https://github.com/keertana-n/verisai/blob/main/backend/compliance_verdict_agent/agent.py"
click node_explanation "https://github.com/keertana-n/verisai/blob/main/backend/explanation_agent/agent.py"
click node_app "https://github.com/keertana-n/verisai/blob/main/frontend/src/App.tsx"
click node_layout "https://github.com/keertana-n/verisai/blob/main/frontend/src/layouts/DashboardLayout.tsx"
click node_dashboard "https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/DashboardHome.tsx"
click node_taxes "https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/DirectTaxes.tsx"
click node_indirect "https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/IndirectTaxes.tsx"
click node_compliance "https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/ComplianceScore.tsx"
click node_settings "https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/Settings.tsx"
click node_login "https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/Login.tsx"
click node_signup "https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/Signup.tsx"
click node_landing "https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/Index%20(1).tsx"
click node_notfound "https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/NotFound.tsx"

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_pipeline,node_reader,node_operator toneBlue
class node_legal,node_verdict,node_explanation toneAmber
class node_app,node_layout,node_dashboard,node_taxes,node_indirect,node_compliance,node_settings,node_gemini toneMint
class node_login,node_signup,node_landing,node_notfound toneRose
```

## Components

### Document Processing

- [Pipeline & File Reader](https://github.com/keertana-n/verisai/blob/main/backend/main.py): `backend/main.py`
- [Document Reader Agent](https://github.com/keertana-n/verisai/blob/main/backend/document_reader_agent/agent.py): `backend/document_reader_agent/agent.py`

### Compliance Analysis

- [Legal Knowledge Agent](https://github.com/keertana-n/verisai/blob/main/backend/legal_knowledge_agent/agent.py): `backend/legal_knowledge_agent/agent.py`
- [Compliance Verdict Agent](https://github.com/keertana-n/verisai/blob/main/backend/compliance_verdict_agent/agent.py): `backend/compliance_verdict_agent/agent.py`
- [Explanation Agent](https://github.com/keertana-n/verisai/blob/main/backend/explanation_agent/agent.py): `backend/explanation_agent/agent.py`

### Dashboard Experience

- [Route Application](https://github.com/keertana-n/verisai/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Dashboard Layout](https://github.com/keertana-n/verisai/blob/main/frontend/src/layouts/DashboardLayout.tsx): `frontend/src/layouts/DashboardLayout.tsx`
- [Dashboard Home](https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/DashboardHome.tsx): `frontend/src/pages/DashboardHome.tsx`
- [Direct & Indirect Taxes](https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/DirectTaxes.tsx): `frontend/src/pages/DirectTaxes.tsx`
- [Indirect Taxes](https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/IndirectTaxes.tsx): `frontend/src/pages/IndirectTaxes.tsx`
- [Compliance Score](https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/ComplianceScore.tsx): `frontend/src/pages/ComplianceScore.tsx`
- [Settings](https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/Settings.tsx): `frontend/src/pages/Settings.tsx`

### Account Screens

- [Login](https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/Login.tsx): `frontend/src/pages/Login.tsx`
- [Signup](https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/Signup.tsx): `frontend/src/pages/Signup.tsx`
- [Landing Page](https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/Index%20(1).tsx): `frontend/src/pages/Index (1).tsx`
- [Not Found](https://github.com/keertana-n/verisai/blob/main/frontend/src/pages/NotFound.tsx): `frontend/src/pages/NotFound.tsx`

### Other components

- **User**
- **Gemini API**

## Connections

- User → Pipeline & File Reader: provides file (evidence: `backend/main.py`)
- Pipeline & File Reader → Legal Knowledge Agent: submits document (evidence: `backend/main.py`)
- Pipeline & File Reader → Compliance Verdict Agent: submits facts and analysis (evidence: `backend/main.py`)
- Pipeline & File Reader → Explanation Agent: submits verdict (evidence: `backend/main.py`)
- Legal Knowledge Agent → Gemini API: requests analysis (evidence: `backend/legal_knowledge_agent/agent.py`)
- Compliance Verdict Agent → Gemini API: requests verdict (evidence: `backend/compliance_verdict_agent/agent.py`)
- Explanation Agent → Gemini API: requests explanation (evidence: `backend/explanation_agent/agent.py`)
- User → Route Application: opens interface (evidence: `frontend/src/App.tsx`)
- Route Application → Landing Page: routes to (evidence: `frontend/src/App.tsx`)
- Route Application → Login: routes to (evidence: `frontend/src/App.tsx`)
- Route Application → Signup: routes to (evidence: `frontend/src/App.tsx`)
- Route Application → Dashboard Layout: wraps dashboard routes (evidence: `frontend/src/App.tsx`)
- Route Application → Not Found: routes unmatched paths (evidence: `frontend/src/App.tsx`)
- Dashboard Layout → Dashboard Home: renders route outlet
- Dashboard Layout → Direct & Indirect Taxes: renders route outlet
- Dashboard Layout → Indirect Taxes: renders route outlet
- Dashboard Layout → Compliance Score: renders route outlet
- Dashboard Layout → Settings: renders route outlet
