# abental/n8n-multi-agent-pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/abental/n8n-multi-agent-pipeline
- Repository: https://github.com/abental/n8n-multi-agent-pipeline

## Overview

The product is a local, n8n-orchestrated AI analysis pipeline. A client submits text and/or images to Workflow A; the agent chooses vision, text, and report tools, then returns a JSON report with a tool-call trace. Torch-Infer exposes image detection, text classification, and entity extraction; the report workflow uses the local llama.cpp server. The README documents workflow-level routing, while sampled source confirms Torch-Infer’s API-to-analyzer calls and the LLM server startup. Workflow internals were not sampled, so their documented connections are cited to the README.

Main entry points: [`n8n-workflows/A_Orchestrator.json`](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/n8n-workflows/A_Orchestrator.json) (AI Orchestrator), [`torch-infer/app/rest/apis.py`](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/torch-infer/app/rest/apis.py) (Inference API), [`n8n-workflows/B_VisionTool.json`](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/n8n-workflows/B_VisionTool.json) (Vision Tool), [`n8n-workflows/C_TextTool.json`](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/n8n-workflows/C_TextTool.json) (Text Tool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Workflow Orchestration"]
  node_orchestrator["AI Orchestrator"]
  node_vision_tool["Vision Tool<br/>[B_VisionTool.json]"]
  node_text_tool["Text Tool<br/>[C_TextTool.json]"]
  node_report_tool["Report Writer<br/>[D_ReportTool.json]"]
end

subgraph group_inference["Torch-Infer Analysis"]
  node_torch_api["Inference API<br/>[apis.py]"]
  node_image_analysis["Object Detection<br/>[image.py]"]
  node_text_classification["Text Classification<br/>[text.py]"]
  node_entity_extraction["Entity Extraction<br/>[text.py]"]
  node_torch_app["FastAPI Service<br/>[main.py]"]
end

subgraph group_llm["Local LLM Serving"]
  node_llm_server["LLM Server<br/>[start.py]"]
end

node_client(("Client"))

node_client -->|"submits input"| node_orchestrator
node_orchestrator -->|"calls vision"| node_vision_tool
node_orchestrator -->|"calls text"| node_text_tool
node_orchestrator -->|"calls report"| node_report_tool
node_orchestrator -->|"uses LLM"| node_llm_server
node_vision_tool -->|"requests detection"| node_torch_api
node_text_tool -->|"requests analysis"| node_torch_api
node_report_tool -->|"requests generation"| node_llm_server
node_torch_app -->|"mounts router"| node_torch_api
node_torch_api -->|"calls detection"| node_image_analysis
node_torch_api -->|"calls classification"| node_text_classification
node_torch_api -->|"calls extraction"| node_entity_extraction
node_orchestrator -->|"returns report"| node_client

click node_orchestrator "https://github.com/abental/n8n-multi-agent-pipeline/blob/master/n8n-workflows/A_Orchestrator.json"
click node_vision_tool "https://github.com/abental/n8n-multi-agent-pipeline/blob/master/n8n-workflows/B_VisionTool.json"
click node_text_tool "https://github.com/abental/n8n-multi-agent-pipeline/blob/master/n8n-workflows/C_TextTool.json"
click node_report_tool "https://github.com/abental/n8n-multi-agent-pipeline/blob/master/n8n-workflows/D_ReportTool.json"
click node_torch_api "https://github.com/abental/n8n-multi-agent-pipeline/blob/master/torch-infer/app/rest/apis.py"
click node_image_analysis "https://github.com/abental/n8n-multi-agent-pipeline/blob/master/torch-infer/app/analyzers/image.py"
click node_text_classification "https://github.com/abental/n8n-multi-agent-pipeline/blob/master/torch-infer/app/analyzers/text.py"
click node_entity_extraction "https://github.com/abental/n8n-multi-agent-pipeline/blob/master/torch-infer/app/analyzers/text.py"
click node_torch_app "https://github.com/abental/n8n-multi-agent-pipeline/blob/master/torch-infer/app/main.py"
click node_llm_server "https://github.com/abental/n8n-multi-agent-pipeline/blob/master/llm-server/start.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_vision_tool,node_text_tool,node_report_tool,node_client toneBlue
class node_torch_api,node_image_analysis,node_text_classification,node_entity_extraction,node_torch_app toneAmber
class node_llm_server toneMint
```

## Components

### Workflow Orchestration

- [AI Orchestrator](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/n8n-workflows/A_Orchestrator.json): `n8n-workflows/A_Orchestrator.json`
- [Vision Tool](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/n8n-workflows/B_VisionTool.json): `n8n-workflows/B_VisionTool.json`
- [Text Tool](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/n8n-workflows/C_TextTool.json): `n8n-workflows/C_TextTool.json`
- [Report Writer](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/n8n-workflows/D_ReportTool.json): `n8n-workflows/D_ReportTool.json`

### Torch-Infer Analysis

- [Inference API](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/torch-infer/app/rest/apis.py): `torch-infer/app/rest/apis.py`
- [Object Detection](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/torch-infer/app/analyzers/image.py): `torch-infer/app/analyzers/image.py`
- [Text Classification](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/torch-infer/app/analyzers/text.py): `torch-infer/app/analyzers/text.py`
- [Entity Extraction](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/torch-infer/app/analyzers/text.py): `torch-infer/app/analyzers/text.py`
- [FastAPI Service](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/torch-infer/app/main.py): `torch-infer/app/main.py`

### Local LLM Serving

- [LLM Server](https://github.com/abental/n8n-multi-agent-pipeline/blob/master/llm-server/start.py): `llm-server/start.py`

### Other components

- **Client**

## Connections

- Client → AI Orchestrator: submits input (evidence: `README.md`)
- AI Orchestrator → Vision Tool: calls vision (evidence: `README.md`)
- AI Orchestrator → Text Tool: calls text (evidence: `README.md`)
- AI Orchestrator → Report Writer: calls report (evidence: `README.md`)
- AI Orchestrator → LLM Server: uses LLM (evidence: `README.md`)
- Vision Tool → Inference API: requests detection (evidence: `README.md`)
- Text Tool → Inference API: requests analysis (evidence: `README.md`)
- Report Writer → LLM Server: requests generation (evidence: `README.md`)
- FastAPI Service → Inference API: mounts router (evidence: `torch-infer/app/main.py`)
- Inference API → Object Detection: calls detection (evidence: `torch-infer/app/rest/apis.py`)
- Inference API → Text Classification: calls classification (evidence: `torch-infer/app/rest/apis.py`)
- Inference API → Entity Extraction: calls extraction (evidence: `torch-infer/app/rest/apis.py`)
- AI Orchestrator → Client: returns report (evidence: `README.md`)
