# mohiitt/quorum architecture

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

- Interactive diagram: https://gitdiagram.com/mohiitt/quorum
- Repository: https://github.com/mohiitt/quorum

## Overview

Quorum is a trust and consensus gate for Fetch.ai multi-agent workflows. A claim enters through the API or an agent, is checked by source, consistency, and reasoning validators, then scored into a verdict; accepted claims update workflow state, while review-needed claims are quarantined. The pipeline also records provenance and updates agent and validator trust. The API exposes these results to a dashboard and a WebSocket event stream. The README documents the product flow; unsampled dashboard and agent internals are represented at their exact tree paths, with uncertain wiring omitted.

Main entry points: [`quorum/pipeline.py`](https://github.com/mohiitt/quorum/blob/main/quorum/pipeline.py) (Validation Pipeline), [`dashboard/src/lib/api.ts`](https://github.com/mohiitt/quorum/blob/main/dashboard/src/lib/api.ts) (Dashboard API Client), [`quorum/state/redis_store.py`](https://github.com/mohiitt/quorum/blob/main/quorum/state/redis_store.py) (Redis Store), [`quorum/api/routes.py`](https://github.com/mohiitt/quorum/blob/main/quorum/api/routes.py) (REST Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Claim Entry"]
  node_pipeline["Validation Pipeline<br/>[pipeline.py]"]
  node_models["Shared Claim Models<br/>[models.py]"]
end

subgraph group_validation["Validation And Consensus"]
  node_source["Source Validator<br/>[source.py]"]
  node_consistency["Consistency Validator<br/>[consistency.py]"]
  node_reasoning["Reasoning Validator<br/>[reasoning.py]"]
  node_consensus["Consensus Engine<br/>[engine.py]"]
  node_scoring["Consensus Scoring<br/>[scoring.py]"]
end

subgraph group_state["Workflow State"]
  node_quarantine["Claim Quarantine<br/>[quarantine.py]"]
  node_redis[("Redis Store<br/>[redis_store.py]")]
  node_workflow_state[("Canonical Workflow State<br/>[redis_store.py]")]
  node_provenance[("Provenance Records<br/>[provenance.py]")]
  node_trust[("Trust Scores<br/>[trust.py]")]
end

subgraph group_service["API And Dashboard"]
  node_api["FastAPI Service<br/>[main.py]"]
  node_routes["REST Routes<br/>[routes.py]"]
  node_websocket["WebSocket Stream<br/>[ws.py]"]
  node_event_bus["Consensus Event Bus<br/>[event_bus.py]"]
  node_dashboard["Dashboard API Client<br/>[api.ts]"]
  node_consensus_page["Live Consensus View<br/>[page.tsx]"]
  node_provenance_page["Provenance View<br/>[page.tsx]"]
  node_trust_page["Trust View<br/>[page.tsx]"]
  node_quarantine_page["Quarantine View<br/>[page.tsx]"]
end

subgraph group_agents["Agent Integrations"]
  node_agent_gateway["uAgent Gateway"]
  node_agent_protocols["Agent Protocols<br/>[protocols.py]"]
  node_demo_workflow["Weather Demo Workflow<br/>[demo_workflow.py]"]
end

node_workflow_actor(("Workflow Agent"))

node_workflow_actor -->|"submits claim"| node_api
node_api -->|"mounts routes"| node_routes
node_routes -->|"validates claim"| node_pipeline
node_pipeline -->|"runs validator"| node_source
node_pipeline -->|"runs validator"| node_consistency
node_pipeline -->|"runs validator"| node_reasoning
node_pipeline -->|"scores results"| node_consensus
node_consensus -->|"computes score"| node_scoring
node_pipeline -->|"routes review claims"| node_quarantine
node_pipeline -->|"writes accepted claims"| node_workflow_state
node_pipeline -->|"records outcome"| node_provenance
node_pipeline -->|"updates scores"| node_trust
node_pipeline -->|"persists data"| node_redis
node_workflow_state -->|"stored in"| node_redis
node_provenance -->|"stored in"| node_redis
node_trust -->|"stored in"| node_redis
node_pipeline -->|"publishes events"| node_event_bus
node_api -->|"routes stream"| node_websocket
node_websocket -->|"subscribes events"| node_event_bus
node_routes -->|"reads claim data"| node_redis
node_dashboard -.->|"requests results"| node_api
node_consensus_page -.->|"uses client"| node_dashboard
node_provenance_page -.->|"uses client"| node_dashboard
node_trust_page -.->|"uses client"| node_dashboard
node_quarantine_page -.->|"uses client"| node_dashboard
node_agent_gateway -->|"submits claims"| node_pipeline
node_agent_gateway -->|"uses protocols"| node_agent_protocols
node_demo_workflow -.->|"demonstrates gate"| node_agent_gateway
node_routes -->|"builds claim"| node_models
node_pipeline -->|"processes claims"| node_models

click node_api "https://github.com/mohiitt/quorum/blob/main/quorum/api/main.py"
click node_routes "https://github.com/mohiitt/quorum/blob/main/quorum/api/routes.py"
click node_websocket "https://github.com/mohiitt/quorum/blob/main/quorum/api/ws.py"
click node_pipeline "https://github.com/mohiitt/quorum/blob/main/quorum/pipeline.py"
click node_source "https://github.com/mohiitt/quorum/blob/main/quorum/validators/source.py"
click node_consistency "https://github.com/mohiitt/quorum/blob/main/quorum/validators/consistency.py"
click node_reasoning "https://github.com/mohiitt/quorum/blob/main/quorum/validators/reasoning.py"
click node_consensus "https://github.com/mohiitt/quorum/blob/main/quorum/consensus/engine.py"
click node_scoring "https://github.com/mohiitt/quorum/blob/main/quorum/consensus/scoring.py"
click node_quarantine "https://github.com/mohiitt/quorum/blob/main/quorum/consensus/quarantine.py"
click node_redis "https://github.com/mohiitt/quorum/blob/main/quorum/state/redis_store.py"
click node_workflow_state "https://github.com/mohiitt/quorum/blob/main/quorum/state/redis_store.py"
click node_provenance "https://github.com/mohiitt/quorum/blob/main/quorum/state/provenance.py"
click node_trust "https://github.com/mohiitt/quorum/blob/main/quorum/state/trust.py"
click node_event_bus "https://github.com/mohiitt/quorum/blob/main/quorum/api/event_bus.py"
click node_dashboard "https://github.com/mohiitt/quorum/blob/main/dashboard/src/lib/api.ts"
click node_consensus_page "https://github.com/mohiitt/quorum/blob/main/dashboard/src/app/consensus/page.tsx"
click node_provenance_page "https://github.com/mohiitt/quorum/blob/main/dashboard/src/app/provenance/page.tsx"
click node_trust_page "https://github.com/mohiitt/quorum/blob/main/dashboard/src/app/trust/page.tsx"
click node_quarantine_page "https://github.com/mohiitt/quorum/blob/main/dashboard/src/app/quarantine/page.tsx"
click node_agent_gateway "https://github.com/mohiitt/quorum/blob/main/quorum/agents/agentverse_agent.py"
click node_agent_protocols "https://github.com/mohiitt/quorum/blob/main/quorum/agents/protocols.py"
click node_demo_workflow "https://github.com/mohiitt/quorum/blob/main/quorum/agents/demo_workflow.py"
click node_models "https://github.com/mohiitt/quorum/blob/main/quorum/contracts/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_pipeline,node_models toneBlue
class node_source,node_consistency,node_reasoning,node_consensus,node_scoring toneAmber
class node_quarantine,node_redis,node_workflow_state,node_provenance,node_trust toneMint
class node_api,node_routes,node_websocket,node_event_bus,node_dashboard,node_consensus_page,node_provenance_page,node_trust_page,node_quarantine_page toneRose
class node_agent_gateway,node_agent_protocols,node_demo_workflow,node_workflow_actor toneIndigo
```

## Components

### Claim Entry

- [Validation Pipeline](https://github.com/mohiitt/quorum/blob/main/quorum/pipeline.py): `quorum/pipeline.py`
- [Shared Claim Models](https://github.com/mohiitt/quorum/blob/main/quorum/contracts/models.py): `quorum/contracts/models.py`

### Validation And Consensus

- [Source Validator](https://github.com/mohiitt/quorum/blob/main/quorum/validators/source.py): `quorum/validators/source.py`
- [Consistency Validator](https://github.com/mohiitt/quorum/blob/main/quorum/validators/consistency.py): `quorum/validators/consistency.py`
- [Reasoning Validator](https://github.com/mohiitt/quorum/blob/main/quorum/validators/reasoning.py): `quorum/validators/reasoning.py`
- [Consensus Engine](https://github.com/mohiitt/quorum/blob/main/quorum/consensus/engine.py): `quorum/consensus/engine.py`
- [Consensus Scoring](https://github.com/mohiitt/quorum/blob/main/quorum/consensus/scoring.py): `quorum/consensus/scoring.py`

### Workflow State

- [Claim Quarantine](https://github.com/mohiitt/quorum/blob/main/quorum/consensus/quarantine.py): `quorum/consensus/quarantine.py`
- [Redis Store](https://github.com/mohiitt/quorum/blob/main/quorum/state/redis_store.py): `quorum/state/redis_store.py`
- [Canonical Workflow State](https://github.com/mohiitt/quorum/blob/main/quorum/state/redis_store.py): `quorum/state/redis_store.py`
- [Provenance Records](https://github.com/mohiitt/quorum/blob/main/quorum/state/provenance.py): `quorum/state/provenance.py`
- [Trust Scores](https://github.com/mohiitt/quorum/blob/main/quorum/state/trust.py): `quorum/state/trust.py`

### API And Dashboard

- [FastAPI Service](https://github.com/mohiitt/quorum/blob/main/quorum/api/main.py): `quorum/api/main.py`
- [REST Routes](https://github.com/mohiitt/quorum/blob/main/quorum/api/routes.py): `quorum/api/routes.py`
- [WebSocket Stream](https://github.com/mohiitt/quorum/blob/main/quorum/api/ws.py): `quorum/api/ws.py`
- [Consensus Event Bus](https://github.com/mohiitt/quorum/blob/main/quorum/api/event_bus.py): `quorum/api/event_bus.py`
- [Dashboard API Client](https://github.com/mohiitt/quorum/blob/main/dashboard/src/lib/api.ts): `dashboard/src/lib/api.ts`
- [Live Consensus View](https://github.com/mohiitt/quorum/blob/main/dashboard/src/app/consensus/page.tsx): `dashboard/src/app/consensus/page.tsx`
- [Provenance View](https://github.com/mohiitt/quorum/blob/main/dashboard/src/app/provenance/page.tsx): `dashboard/src/app/provenance/page.tsx`
- [Trust View](https://github.com/mohiitt/quorum/blob/main/dashboard/src/app/trust/page.tsx): `dashboard/src/app/trust/page.tsx`
- [Quarantine View](https://github.com/mohiitt/quorum/blob/main/dashboard/src/app/quarantine/page.tsx): `dashboard/src/app/quarantine/page.tsx`

### Agent Integrations

- [uAgent Gateway](https://github.com/mohiitt/quorum/blob/main/quorum/agents/agentverse_agent.py): `quorum/agents/agentverse_agent.py`
- [Agent Protocols](https://github.com/mohiitt/quorum/blob/main/quorum/agents/protocols.py): `quorum/agents/protocols.py`
- [Weather Demo Workflow](https://github.com/mohiitt/quorum/blob/main/quorum/agents/demo_workflow.py): `quorum/agents/demo_workflow.py`

### Other components

- **Workflow Agent**

## Connections

- Workflow Agent → FastAPI Service: submits claim (evidence: `README.md`)
- FastAPI Service → REST Routes: mounts routes (evidence: `quorum/api/main.py`)
- REST Routes → Validation Pipeline: validates claim (evidence: `quorum/api/routes.py`)
- Validation Pipeline → Source Validator: runs validator (evidence: `quorum/pipeline.py`)
- Validation Pipeline → Consistency Validator: runs validator (evidence: `quorum/pipeline.py`)
- Validation Pipeline → Reasoning Validator: runs validator (evidence: `quorum/pipeline.py`)
- Validation Pipeline → Consensus Engine: scores results (evidence: `quorum/pipeline.py`)
- Consensus Engine → Consensus Scoring: computes score (evidence: `quorum/consensus/engine.py`)
- Validation Pipeline → Claim Quarantine: routes review claims (evidence: `README.md`)
- Validation Pipeline → Canonical Workflow State: writes accepted claims (evidence: `README.md`)
- Validation Pipeline → Provenance Records: records outcome (evidence: `quorum/pipeline.py`)
- Validation Pipeline → Trust Scores: updates scores (evidence: `quorum/pipeline.py`)
- Validation Pipeline → Redis Store: persists data (evidence: `quorum/pipeline.py`)
- Canonical Workflow State → Redis Store: stored in (evidence: `quorum/state/redis_store.py`)
- Provenance Records → Redis Store: stored in (evidence: `quorum/state/provenance.py`)
- Trust Scores → Redis Store: stored in (evidence: `quorum/state/trust.py`)
- Validation Pipeline → Consensus Event Bus: publishes events (evidence: `quorum/pipeline.py`)
- FastAPI Service → WebSocket Stream: routes stream (evidence: `quorum/api/main.py`)
- WebSocket Stream → Consensus Event Bus: subscribes events (evidence: `quorum/api/ws.py`)
- REST Routes → Redis Store: reads claim data (evidence: `quorum/api/routes.py`)
- Dashboard API Client → FastAPI Service: requests results
- Live Consensus View → Dashboard API Client: uses client
- Provenance View → Dashboard API Client: uses client
- Trust View → Dashboard API Client: uses client
- Quarantine View → Dashboard API Client: uses client
- uAgent Gateway → Validation Pipeline: submits claims (evidence: `quorum/agents/agentverse_agent.py`)
- uAgent Gateway → Agent Protocols: uses protocols (evidence: `quorum/agents/agentverse_agent.py`)
- Weather Demo Workflow → uAgent Gateway: demonstrates gate (evidence: `README.md`)
- REST Routes → Shared Claim Models: builds claim (evidence: `quorum/api/routes.py`)
- Validation Pipeline → Shared Claim Models: processes claims (evidence: `quorum/pipeline.py`)
