# bharathkcs/quvi architecture

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

- Interactive diagram: https://gitdiagram.com/bharathkcs/quvi
- Repository: https://github.com/bharathkcs/quvi

## Overview

QUVI is procurement decision-support software: it ingests bids and project evidence, evaluates vendors and offers, forecasts delivery, and presents cited recommendations while leaving awards to people. The documented path runs from the web UI through the API and durable conductor workflow to specialized agents, with rules and trust checks governing results. The graph also preserves Ask, storage, ML, and optional LLM capabilities. Relationships are based on the README and shown excerpts; unsampled internals and wiring are not asserted beyond documented links.

Main entry points: [`backend/app/conductor/workflow.py`](https://github.com/bharathkcs/quvi/blob/main/backend/app/conductor/workflow.py) (Conductor workflow), [`backend/app/api`](https://github.com/bharathkcs/quvi/tree/main/backend/app/api) (REST API), [`backend/app/agents/a1_intake`](https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a1_intake) (Bid intake), [`backend/app/agents/a3_bid_leveling`](https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a3_bid_leveling) (Bid leveling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_web["Web application"]
  node_api["REST API"]
end

subgraph group_workflow["Procurement workflow"]
  node_intake["Bid intake"]
  node_vendor["Vendor trust"]
  node_leveling["Bid leveling"]
  node_submittal["Submittal review"]
  node_leadtime["Lead-time forecast"]
  node_watch["Global watch"]
  node_risk["Delivery risk"]
  node_alternatives["Alternatives"]
  node_conductor["Conductor workflow<br/>[workflow.py]"]
end

subgraph group_decision["Decision services"]
  node_rules["Deterministic rules"]
  node_trust["Evidence safeguards"]
  node_rag["Cited Ask<br/>[ask.py]"]
end

subgraph group_platform["Runtime platform"]
  node_database[("Application database<br/>[db.py]")]
  node_persistence["Persistence layer<br/>[persist.py]"]
  node_storage["Object storage<br/>[storage.py]"]
  node_runtime["Runtime configuration<br/>[runtime_config.py]"]
end

subgraph group_evidence["Evidence and AI"]
  node_ml["Gated ML models<br/>[train.py]"]
  node_llm["LLM router<br/>[router.py]"]
end

node_manager(("Project team"))

node_manager -->|"uses"| node_web
node_web -->|"REST requests"| node_api
node_api -->|"starts workflow"| node_conductor
node_conductor -->|"dispatches"| node_intake
node_conductor -->|"dispatches"| node_vendor
node_conductor -->|"dispatches"| node_leveling
node_conductor -->|"dispatches"| node_submittal
node_conductor -->|"dispatches"| node_leadtime
node_conductor -->|"dispatches"| node_watch
node_conductor -->|"dispatches"| node_risk
node_conductor -->|"dispatches"| node_alternatives
node_leveling -->|"checks bids"| node_rules
node_submittal -->|"checks clauses"| node_rules
node_risk -->|"computes risk"| node_rules
node_conductor -->|"durable events"| node_database
node_api -->|"reads and writes"| node_database
node_intake -.->|"stores files"| node_storage
node_intake -->|"screens evidence"| node_trust
node_leveling -->|"grounds claims"| node_trust
node_submittal -->|"grounds findings"| node_trust
node_api -->|"serves Ask"| node_rag
node_rag -->|"uses verified evidence"| node_trust
node_leadtime -->|"gated forecasting"| node_ml
node_leveling -->|"gated ranking"| node_ml
node_intake -.->|"optional extraction"| node_llm
node_llm -->|"checks mode"| node_runtime
node_api -.->|"persists records"| node_persistence
node_conductor -->|"checks agent modes"| node_runtime

click node_web "https://github.com/bharathkcs/quvi/tree/main/web/app"
click node_api "https://github.com/bharathkcs/quvi/tree/main/backend/app/api"
click node_intake "https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a1_intake"
click node_vendor "https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a2_vendor_trust"
click node_leveling "https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a3_bid_leveling"
click node_submittal "https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a4_submittal"
click node_leadtime "https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a5_lead_time"
click node_watch "https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a6_global_watch"
click node_risk "https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a7_delivery_risk"
click node_alternatives "https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a8_alternatives"
click node_conductor "https://github.com/bharathkcs/quvi/blob/main/backend/app/conductor/workflow.py"
click node_rules "https://github.com/bharathkcs/quvi/tree/main/backend/app/rules"
click node_trust "https://github.com/bharathkcs/quvi/tree/main/backend/app/trust"
click node_rag "https://github.com/bharathkcs/quvi/blob/main/backend/app/rag/ask.py"
click node_database "https://github.com/bharathkcs/quvi/blob/main/backend/app/db.py"
click node_persistence "https://github.com/bharathkcs/quvi/blob/main/backend/app/persist.py"
click node_storage "https://github.com/bharathkcs/quvi/blob/main/backend/app/storage.py"
click node_ml "https://github.com/bharathkcs/quvi/blob/main/backend/app/ml/train.py"
click node_llm "https://github.com/bharathkcs/quvi/blob/main/backend/app/llm/router.py"
click node_runtime "https://github.com/bharathkcs/quvi/blob/main/backend/app/runtime_config.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_api toneBlue
class node_intake,node_vendor,node_leveling,node_submittal,node_leadtime,node_watch,node_risk,node_alternatives,node_conductor toneAmber
class node_rules,node_trust,node_rag toneMint
class node_database,node_persistence,node_storage,node_runtime toneRose
class node_ml,node_llm,node_manager toneIndigo
```

## Components

### User interface

- [Web application](https://github.com/bharathkcs/quvi/tree/main/web/app): `web/app`
- [REST API](https://github.com/bharathkcs/quvi/tree/main/backend/app/api): `backend/app/api`

### Procurement workflow

- [Bid intake](https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a1_intake): `backend/app/agents/a1_intake`
- [Vendor trust](https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a2_vendor_trust): `backend/app/agents/a2_vendor_trust`
- [Bid leveling](https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a3_bid_leveling): `backend/app/agents/a3_bid_leveling`
- [Submittal review](https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a4_submittal): `backend/app/agents/a4_submittal`
- [Lead-time forecast](https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a5_lead_time): `backend/app/agents/a5_lead_time`
- [Global watch](https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a6_global_watch): `backend/app/agents/a6_global_watch`
- [Delivery risk](https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a7_delivery_risk): `backend/app/agents/a7_delivery_risk`
- [Alternatives](https://github.com/bharathkcs/quvi/tree/main/backend/app/agents/a8_alternatives): `backend/app/agents/a8_alternatives`
- [Conductor workflow](https://github.com/bharathkcs/quvi/blob/main/backend/app/conductor/workflow.py): `backend/app/conductor/workflow.py`

### Decision services

- [Deterministic rules](https://github.com/bharathkcs/quvi/tree/main/backend/app/rules): `backend/app/rules`
- [Evidence safeguards](https://github.com/bharathkcs/quvi/tree/main/backend/app/trust): `backend/app/trust`
- [Cited Ask](https://github.com/bharathkcs/quvi/blob/main/backend/app/rag/ask.py): `backend/app/rag/ask.py`

### Runtime platform

- [Application database](https://github.com/bharathkcs/quvi/blob/main/backend/app/db.py): `backend/app/db.py`
- [Persistence layer](https://github.com/bharathkcs/quvi/blob/main/backend/app/persist.py): `backend/app/persist.py`
- [Object storage](https://github.com/bharathkcs/quvi/blob/main/backend/app/storage.py): `backend/app/storage.py`
- [Runtime configuration](https://github.com/bharathkcs/quvi/blob/main/backend/app/runtime_config.py): `backend/app/runtime_config.py`

### Evidence and AI

- [Gated ML models](https://github.com/bharathkcs/quvi/blob/main/backend/app/ml/train.py): `backend/app/ml/train.py`
- [LLM router](https://github.com/bharathkcs/quvi/blob/main/backend/app/llm/router.py): `backend/app/llm/router.py`

### Other components

- **Project team**

## Connections

- Project team → Web application: uses
- Web application → REST API: REST requests
- REST API → Conductor workflow: starts workflow (evidence: `backend/app/api/routes_items.py`)
- Conductor workflow → Bid intake: dispatches
- Conductor workflow → Vendor trust: dispatches
- Conductor workflow → Bid leveling: dispatches
- Conductor workflow → Submittal review: dispatches
- Conductor workflow → Lead-time forecast: dispatches
- Conductor workflow → Global watch: dispatches
- Conductor workflow → Delivery risk: dispatches
- Conductor workflow → Alternatives: dispatches
- Bid leveling → Deterministic rules: checks bids
- Submittal review → Deterministic rules: checks clauses
- Delivery risk → Deterministic rules: computes risk
- Conductor workflow → Application database: durable events
- REST API → Application database: reads and writes (evidence: `backend/app/api/routes_items.py`)
- Bid intake → Object storage: stores files
- Bid intake → Evidence safeguards: screens evidence
- Bid leveling → Evidence safeguards: grounds claims
- Submittal review → Evidence safeguards: grounds findings
- REST API → Cited Ask: serves Ask (evidence: `backend/app/api/routes_items.py`)
- Cited Ask → Evidence safeguards: uses verified evidence
- Lead-time forecast → Gated ML models: gated forecasting
- Bid leveling → Gated ML models: gated ranking
- Bid intake → LLM router: optional extraction
- LLM router → Runtime configuration: checks mode (evidence: `backend/app/llm/router.py`)
- REST API → Persistence layer: persists records
- Conductor workflow → Runtime configuration: checks agent modes (evidence: `backend/app/main.py`)
