# rabijezekthi/dataai architecture

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

- Interactive diagram: https://gitdiagram.com/rabijezekthi/dataai
- Repository: https://github.com/rabijezekthi/dataai

## Overview

This is a procurement-intelligence application: a buyer submits a request, reviews two approval checkpoints, and receives ranked vendor recommendations with compliance risks and evidence. The Streamlit app presents the workflow; LangGraph routes intake through policy retrieval, quote analysis, risk assessment, and synthesis. Document and Vendor MCP servers supply policy and quote capabilities, while agent roles and an A2A bus support specialist analysis. JSON memory, optional vector retrieval, catalog administration, and evaluation are additional product capabilities. Some app wiring is omitted from excerpts, so those relationships are cited to the README where documented.

Main entry points: [`orchestration/workflow.py`](https://github.com/rabijezekthi/dataai/blob/main/orchestration/workflow.py) (Workflow router), [`app.py`](https://github.com/rabijezekthi/dataai/blob/main/app.py) (Streamlit app), [`orchestration/mcp_runtime.py`](https://github.com/rabijezekthi/dataai/blob/main/orchestration/mcp_runtime.py) (MCP client), [`agents/a2a_bus.py`](https://github.com/rabijezekthi/dataai/blob/main/agents/a2a_bus.py) (Agent message bus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Buyer experience"]
  node_ui["Streamlit app<br/>[app.py]"]
end

subgraph group_workflow["Workflow and agents"]
  node_workflow["Workflow router<br/>[workflow.py]"]
  node_state_model["Workflow state<br/>[state.py]"]
  node_request_model["Request schemas<br/>[schemas.py]"]
  node_intake["Intake agent<br/>[roles.py]"]
  node_retrieval["Policy agent<br/>[roles.py]"]
  node_pricing["Pricing agent<br/>[roles.py]"]
  node_risk["Risk agent<br/>[roles.py]"]
  node_a2a["Agent message bus<br/>[a2a_bus.py]"]
end

subgraph group_sources["Procurement sources"]
  node_mcp_runtime["MCP client<br/>[mcp_runtime.py]"]
  node_doc_server["Document MCP<br/>[server.py]"]
  node_vendor_server["Vendor MCP<br/>[server.py]"]
  node_catalog["Catalog administration<br/>[data_admin.py]"]
end

subgraph group_state["Memory and evaluation"]
  node_memory[("JSON memory<br/>[store.py]")]
  node_vector[("Decision retrieval<br/>[vector_store.py]")]
  node_evaluation["Run evaluation<br/>[metrics.py]"]
end

node_buyer(("Procurement buyer"))

node_buyer -->|"submits request"| node_ui
node_ui -->|"invokes workflow"| node_workflow
node_workflow -->|"calls intake"| node_intake
node_workflow -->|"calls retrieval"| node_retrieval
node_workflow -->|"calls pricing"| node_pricing
node_workflow -->|"calls risk"| node_risk
node_workflow -->|"validates state"| node_state_model
node_state_model -->|"uses request"| node_request_model
node_pricing -->|"publishes shortlist"| node_a2a
node_risk -->|"publishes verdict"| node_a2a
node_workflow -->|"consumes verdict"| node_a2a
node_ui -->|"retrieves data"| node_mcp_runtime
node_mcp_runtime -->|"calls policy tool"| node_doc_server
node_mcp_runtime -->|"calls quote tool"| node_vendor_server
node_ui -->|"manages catalog"| node_catalog
node_ui -->|"records decisions"| node_memory
node_ui -->|"stores decisions"| node_vector
node_ui -->|"scores runs"| node_evaluation
node_workflow -->|"returns recommendation"| node_ui

click node_ui "https://github.com/rabijezekthi/dataai/blob/main/app.py"
click node_workflow "https://github.com/rabijezekthi/dataai/blob/main/orchestration/workflow.py"
click node_state_model "https://github.com/rabijezekthi/dataai/blob/main/orchestration/state.py"
click node_request_model "https://github.com/rabijezekthi/dataai/blob/main/agents/schemas.py"
click node_intake "https://github.com/rabijezekthi/dataai/blob/main/agents/roles.py"
click node_retrieval "https://github.com/rabijezekthi/dataai/blob/main/agents/roles.py"
click node_pricing "https://github.com/rabijezekthi/dataai/blob/main/agents/roles.py"
click node_risk "https://github.com/rabijezekthi/dataai/blob/main/agents/roles.py"
click node_a2a "https://github.com/rabijezekthi/dataai/blob/main/agents/a2a_bus.py"
click node_mcp_runtime "https://github.com/rabijezekthi/dataai/blob/main/orchestration/mcp_runtime.py"
click node_doc_server "https://github.com/rabijezekthi/dataai/blob/main/mcp_servers/doc_mcp/server.py"
click node_vendor_server "https://github.com/rabijezekthi/dataai/blob/main/mcp_servers/vendor_mcp/server.py"
click node_catalog "https://github.com/rabijezekthi/dataai/blob/main/mcp_servers/vendor_mcp/data_admin.py"
click node_memory "https://github.com/rabijezekthi/dataai/blob/main/memory/store.py"
click node_vector "https://github.com/rabijezekthi/dataai/blob/main/memory/vector_store.py"
click node_evaluation "https://github.com/rabijezekthi/dataai/blob/main/evaluation/metrics.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_ui toneBlue
class node_workflow,node_state_model,node_request_model,node_intake,node_retrieval,node_pricing,node_risk,node_a2a toneAmber
class node_mcp_runtime,node_doc_server,node_vendor_server,node_catalog toneMint
class node_memory,node_vector,node_evaluation toneRose
class node_buyer toneIndigo
```

## Components

### Buyer experience

- [Streamlit app](https://github.com/rabijezekthi/dataai/blob/main/app.py): `app.py`

### Workflow and agents

- [Workflow router](https://github.com/rabijezekthi/dataai/blob/main/orchestration/workflow.py): `orchestration/workflow.py`
- [Workflow state](https://github.com/rabijezekthi/dataai/blob/main/orchestration/state.py): `orchestration/state.py`
- [Request schemas](https://github.com/rabijezekthi/dataai/blob/main/agents/schemas.py): `agents/schemas.py`
- [Intake agent](https://github.com/rabijezekthi/dataai/blob/main/agents/roles.py): `agents/roles.py`
- [Policy agent](https://github.com/rabijezekthi/dataai/blob/main/agents/roles.py): `agents/roles.py`
- [Pricing agent](https://github.com/rabijezekthi/dataai/blob/main/agents/roles.py): `agents/roles.py`
- [Risk agent](https://github.com/rabijezekthi/dataai/blob/main/agents/roles.py): `agents/roles.py`
- [Agent message bus](https://github.com/rabijezekthi/dataai/blob/main/agents/a2a_bus.py): `agents/a2a_bus.py`

### Procurement sources

- [MCP client](https://github.com/rabijezekthi/dataai/blob/main/orchestration/mcp_runtime.py): `orchestration/mcp_runtime.py`
- [Document MCP](https://github.com/rabijezekthi/dataai/blob/main/mcp_servers/doc_mcp/server.py): `mcp_servers/doc_mcp/server.py`
- [Vendor MCP](https://github.com/rabijezekthi/dataai/blob/main/mcp_servers/vendor_mcp/server.py): `mcp_servers/vendor_mcp/server.py`
- [Catalog administration](https://github.com/rabijezekthi/dataai/blob/main/mcp_servers/vendor_mcp/data_admin.py): `mcp_servers/vendor_mcp/data_admin.py`

### Memory and evaluation

- [JSON memory](https://github.com/rabijezekthi/dataai/blob/main/memory/store.py): `memory/store.py`
- [Decision retrieval](https://github.com/rabijezekthi/dataai/blob/main/memory/vector_store.py): `memory/vector_store.py`
- [Run evaluation](https://github.com/rabijezekthi/dataai/blob/main/evaluation/metrics.py): `evaluation/metrics.py`

### Other components

- **Procurement buyer**

## Connections

- Procurement buyer → Streamlit app: submits request (evidence: `README.md`)
- Streamlit app → Workflow router: invokes workflow (evidence: `app.py`)
- Workflow router → Intake agent: calls intake (evidence: `orchestration/workflow.py`)
- Workflow router → Policy agent: calls retrieval (evidence: `orchestration/workflow.py`)
- Workflow router → Pricing agent: calls pricing (evidence: `orchestration/workflow.py`)
- Workflow router → Risk agent: calls risk (evidence: `orchestration/workflow.py`)
- Workflow router → Workflow state: validates state (evidence: `orchestration/workflow.py`)
- Workflow state → Request schemas: uses request (evidence: `orchestration/state.py`)
- Pricing agent → Agent message bus: publishes shortlist (evidence: `agents/roles.py`)
- Risk agent → Agent message bus: publishes verdict (evidence: `agents/roles.py`)
- Workflow router → Agent message bus: consumes verdict (evidence: `orchestration/workflow.py`)
- Streamlit app → MCP client: retrieves data (evidence: `README.md`)
- MCP client → Document MCP: calls policy tool (evidence: `orchestration/mcp_runtime.py`)
- MCP client → Vendor MCP: calls quote tool (evidence: `orchestration/mcp_runtime.py`)
- Streamlit app → Catalog administration: manages catalog (evidence: `README.md`)
- Streamlit app → JSON memory: records decisions (evidence: `README.md`)
- Streamlit app → Decision retrieval: stores decisions (evidence: `README.md`)
- Streamlit app → Run evaluation: scores runs (evidence: `README.md`)
- Workflow router → Streamlit app: returns recommendation (evidence: `app.py`)
