# yash3510/multi-llm-agentic-ai architecture

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

- Interactive diagram: https://gitdiagram.com/yash3510/multi-llm-agentic-ai
- Repository: https://github.com/yash3510/multi-llm-agentic-ai

## Overview

4CE is an on-premise agentic AI workbench delivered as a plugin set inside Open WebUI. Its main workflow classifies and routes a request, grounds it in local documents, produces and verifies a deliverable, retries once after a failed check, and withholds release until human approval. The README documents the chain and its tool capabilities; the sampled orchestrator excerpt confirms tool use and approval handling. Some internal stage links are therefore documented rather than independently visible in sampled source.

Main entry points: [`4ce/functions/orchestrator.py`](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py) (TONY orchestrator), [`backend/open_webui/main.py`](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/backend/open_webui/main.py) (Open WebUI runtime), [`backend/open_webui/retrieval/loaders/main.py`](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/backend/open_webui/retrieval/loaders/main.py) (Document retrieval), [`backend/open_webui/storage/provider.py`](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/backend/open_webui/storage/provider.py) (File storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Agent workflow"]
  node_orchestrator["TONY orchestrator<br/>[orchestrator.py]"]
  node_classify["Task classification<br/>[orchestrator.py]"]
  node_route["Local model routing<br/>[orchestrator.py]"]
  node_friday["FRIDAY grounding<br/>[orchestrator.py]"]
  node_jarvis["JARVIS deliverable<br/>[orchestrator.py]"]
  node_ultron["ULTRON verification<br/>[orchestrator.py]"]
  node_replan["Failure replan<br/>[orchestrator.py]"]
end

subgraph group_tools["Operational tools"]
  node_sandbox["Code sandbox<br/>[sandbox.py]"]
  node_calculations["Engineering calculations<br/>[calculations.py]"]
  node_sop["SOP thresholds<br/>[sop_check.py]"]
  node_files["Workspace files<br/>[files.py]"]
  node_sheets["Spreadsheet tools<br/>[sheets.py]"]
  node_calibration["Vision calibration<br/>[calibration.py]"]
  node_deliverables["Document rendering<br/>[deliverables.py]"]
end

subgraph group_host["Open WebUI host"]
  node_webui["Open WebUI runtime<br/>[main.py]"]
  node_chat_store[("Chat persistence<br/>[chats.py]")]
  node_retrieval["Document retrieval<br/>[main.py]"]
  node_storage["File storage<br/>[provider.py]"]
end

subgraph group_evidence["Evidence and release"]
  node_sovereignty["Sovereignty audit<br/>[sovereignty.py]"]
  node_audit["Audit trail<br/>[fource_audit.py]"]
end

node_user(("Workbench user"))
node_reviewer(("Human reviewer"))
node_local_model["Local model server"]

node_user -->|"submits turn"| node_orchestrator
node_orchestrator -->|"classifies task"| node_classify
node_classify -->|"selects task model"| node_route
node_route -->|"calls locally"| node_local_model
node_route -->|"routes request"| node_friday
node_friday -->|"grounds in RAG"| node_retrieval
node_friday -->|"provides analysis"| node_jarvis
node_jarvis -->|"submits output"| node_ultron
node_ultron -->|"replans on failure"| node_replan
node_replan -->|"reruns grounding"| node_friday
node_replan -->|"reruns production"| node_jarvis
node_ultron -->|"requests approval"| node_reviewer
node_reviewer -->|"approves or rejects"| node_orchestrator
node_orchestrator -->|"runs generated code"| node_sandbox
node_orchestrator -->|"invokes calculations"| node_calculations
node_orchestrator -->|"checks thresholds"| node_sop
node_orchestrator -->|"uses file tools"| node_files
node_orchestrator -->|"reads worksheets"| node_sheets
node_orchestrator -.->|"uses vision tools"| node_calibration
node_orchestrator -->|"renders approved output"| node_deliverables
node_orchestrator -->|"audits configuration"| node_sovereignty
node_orchestrator -->|"records execution"| node_audit
node_orchestrator -->|"registers selectable model"| node_webui
node_webui -.->|"persists chats"| node_chat_store
node_webui -.->|"uses file storage"| node_storage
node_retrieval -.->|"loads stored files"| node_storage

click node_orchestrator "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py"
click node_classify "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py"
click node_route "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py"
click node_friday "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py"
click node_jarvis "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py"
click node_ultron "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py"
click node_replan "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py"
click node_sandbox "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/sandbox.py"
click node_calculations "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/calculations.py"
click node_sop "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/sop_check.py"
click node_files "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/files.py"
click node_sheets "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/sheets.py"
click node_calibration "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/calibration.py"
click node_deliverables "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/deliverables.py"
click node_sovereignty "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/sovereignty.py"
click node_audit "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/backend/open_webui/utils/fource_audit.py"
click node_webui "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/backend/open_webui/main.py"
click node_chat_store "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/backend/open_webui/models/chats.py"
click node_retrieval "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/backend/open_webui/retrieval/loaders/main.py"
click node_storage "https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/backend/open_webui/storage/provider.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_orchestrator,node_classify,node_route,node_friday,node_jarvis,node_ultron,node_replan,node_user,node_reviewer toneBlue
class node_sandbox,node_calculations,node_sop,node_files,node_sheets,node_calibration,node_deliverables toneAmber
class node_webui,node_chat_store,node_retrieval,node_storage,node_local_model toneMint
class node_sovereignty,node_audit toneRose
```

## Components

### Agent workflow

- [TONY orchestrator](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py): `4ce/functions/orchestrator.py`
- [Task classification](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py): `4ce/functions/orchestrator.py`
- [Local model routing](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py): `4ce/functions/orchestrator.py`
- [FRIDAY grounding](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py): `4ce/functions/orchestrator.py`
- [JARVIS deliverable](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py): `4ce/functions/orchestrator.py`
- [ULTRON verification](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py): `4ce/functions/orchestrator.py`
- [Failure replan](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/functions/orchestrator.py): `4ce/functions/orchestrator.py`

### Operational tools

- [Code sandbox](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/sandbox.py): `4ce/tools/sandbox.py`
- [Engineering calculations](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/calculations.py): `4ce/tools/calculations.py`
- [SOP thresholds](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/sop_check.py): `4ce/tools/sop_check.py`
- [Workspace files](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/files.py): `4ce/tools/files.py`
- [Spreadsheet tools](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/sheets.py): `4ce/tools/sheets.py`
- [Vision calibration](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/calibration.py): `4ce/tools/calibration.py`
- [Document rendering](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/deliverables.py): `4ce/tools/deliverables.py`

### Open WebUI host

- [Open WebUI runtime](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/backend/open_webui/main.py): `backend/open_webui/main.py`
- [Chat persistence](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/backend/open_webui/models/chats.py): `backend/open_webui/models/chats.py`
- [Document retrieval](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/backend/open_webui/retrieval/loaders/main.py): `backend/open_webui/retrieval/loaders/main.py`
- [File storage](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/backend/open_webui/storage/provider.py): `backend/open_webui/storage/provider.py`

### Evidence and release

- [Sovereignty audit](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/4ce/tools/sovereignty.py): `4ce/tools/sovereignty.py`
- [Audit trail](https://github.com/yash3510/multi-llm-agentic-ai/blob/4ce/backend/open_webui/utils/fource_audit.py): `backend/open_webui/utils/fource_audit.py`

### Other components

- **Workbench user**
- **Human reviewer**
- **Local model server**

## Connections

- Workbench user → TONY orchestrator: submits turn
- TONY orchestrator → Task classification: classifies task (evidence: `4ce/functions/orchestrator.py`)
- Task classification → Local model routing: selects task model (evidence: `4ce/functions/orchestrator.py`)
- Local model routing → Local model server: calls locally
- Local model routing → FRIDAY grounding: routes request (evidence: `4ce/functions/orchestrator.py`)
- FRIDAY grounding → Document retrieval: grounds in RAG
- FRIDAY grounding → JARVIS deliverable: provides analysis (evidence: `4ce/functions/orchestrator.py`)
- JARVIS deliverable → ULTRON verification: submits output (evidence: `4ce/functions/orchestrator.py`)
- ULTRON verification → Failure replan: replans on failure (evidence: `4ce/functions/orchestrator.py`)
- Failure replan → FRIDAY grounding: reruns grounding (evidence: `4ce/functions/orchestrator.py`)
- Failure replan → JARVIS deliverable: reruns production (evidence: `4ce/functions/orchestrator.py`)
- ULTRON verification → Human reviewer: requests approval
- Human reviewer → TONY orchestrator: approves or rejects (evidence: `4ce/functions/orchestrator.py`)
- TONY orchestrator → Code sandbox: runs generated code
- TONY orchestrator → Engineering calculations: invokes calculations
- TONY orchestrator → SOP thresholds: checks thresholds
- TONY orchestrator → Workspace files: uses file tools
- TONY orchestrator → Spreadsheet tools: reads worksheets (evidence: `4ce/functions/orchestrator.py`)
- TONY orchestrator → Vision calibration: uses vision tools
- TONY orchestrator → Document rendering: renders approved output
- TONY orchestrator → Sovereignty audit: audits configuration
- TONY orchestrator → Audit trail: records execution (evidence: `4ce/functions/orchestrator.py`)
- TONY orchestrator → Open WebUI runtime: registers selectable model
- Open WebUI runtime → Chat persistence: persists chats (evidence: `backend/open_webui/main.py`)
- Open WebUI runtime → File storage: uses file storage
- Document retrieval → File storage: loads stored files
