# redhat-community-ai-tools/unifai architecture

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

- Interactive diagram: https://gitdiagram.com/redhat-community-ai-tools/unifai
- Repository: https://github.com/redhat-community-ai-tools/unifai

## Overview

UnifAI combines a visual and API-driven multi-agent workflow platform with an enterprise-knowledge ingestion and retrieval system. The main user path is to compose a blueprint, submit a session, execute its graph locally or through Temporal, and stream node results; agents can retrieve indexed document and Slack content. The graph preserves major README capabilities, including templates, the element catalog, collaboration, and asynchronous ingestion. Some subsystem links are documented rather than shown in sampled implementation; those edges cite the README, and unsampled details are not inferred.

Main entry points: [`ui/client/src/App.tsx`](https://github.com/redhat-community-ai-tools/unifai/blob/main/ui/client/src/App.tsx) (Web UI), [`multi-agent/lib/mas/session/management/user_session_manager.py`](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/lib/mas/session/management/user_session_manager.py) (Session Manager), [`multi-agent/adapters/inbound/flask/flask_app.py`](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/inbound/flask/flask_app.py) (Flask API), [`multi-agent/adapters/outbound/temporal/session_engine.py`](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/outbound/temporal/session_engine.py) (Distributed Execution)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_web["Web UI<br/>[App.tsx]"]
  node_cli["CLI<br/>[main.py]"]
  node_api["Flask API<br/>[flask_app.py]"]
end

subgraph group_mas["Multi-Agent Workflows"]
  node_blueprints["Blueprints<br/>[service.py]"]
  node_catalog["Element Catalog<br/>[service.py]"]
  node_templates["Workflow Templates<br/>[builtin_service.py]"]
  node_sessions["Session Manager"]
  node_graph["Graph State<br/>[graph_state.py]"]
  node_localexec["Local Execution<br/>[executor.py]"]
  node_temporal["Distributed Execution<br/>[session_engine.py]"]
  node_stream["Result Streaming"]
  node_collab["Session Collaboration<br/>[service.py]"]
end

subgraph group_rag["Knowledge Ingestion"]
  node_ragapi["RAG API<br/>[pipelines.py]"]
  node_dispatch["Pipeline Dispatcher"]
  node_dochingest["Document Ingestion"]
  node_slackingest["Slack Ingestion"]
  node_vector["Vector Search<br/>[service.py]"]
end

subgraph group_runtime["Runtime Infrastructure"]
  node_sessiondb[("Session Repository")]
  node_ragstore[("RAG Metadata Store")]
  node_celery["Celery Workers<br/>[pipeline_tasks.py]"]
  node_knowledge[("Vector Database<br/>[model.py]")]
  node_temporalservice["Temporal Service<br/>[client.py]"]
end

node_user(("Workflow User"))
node_queue["RabbitMQ"]

node_user -->|"composes workflows"| node_web
node_user -->|"runs workflows"| node_cli
node_web -->|"submits requests"| node_api
node_cli -.->|"calls API"| node_api
node_api -->|"uses blueprints"| node_blueprints
node_blueprints -->|"resolves elements"| node_catalog
node_web -->|"browses elements"| node_catalog
node_web -->|"instantiates templates"| node_templates
node_api -->|"manages sessions"| node_sessions
node_sessions -->|"loads blueprint"| node_blueprints
node_sessions -->|"persists sessions"| node_sessiondb
node_sessions -->|"builds execution"| node_localexec
node_sessions -->|"submits background run"| node_temporal
node_temporal -->|"starts workflow"| node_temporalservice
node_localexec -.->|"updates state"| node_graph
node_temporal -->|"executes graph state"| node_graph
node_graph -->|"streams progress"| node_stream
node_api -->|"supports collaboration"| node_collab
node_user -->|"uploads sources"| node_ragapi
node_ragapi -->|"dispatches ingestion"| node_dispatch
node_dispatch -->|"sends tasks"| node_queue
node_queue -->|"delivers tasks"| node_celery
node_celery -->|"runs document pipeline"| node_dochingest
node_celery -->|"runs Slack pipeline"| node_slackingest
node_dochingest -->|"embeds chunks"| node_knowledge
node_slackingest -->|"embeds chunks"| node_knowledge
node_dochingest -.->|"tracks pipeline"| node_ragstore
node_slackingest -.->|"tracks pipeline"| node_ragstore
node_web -->|"queries dashboard"| node_vector
node_vector -->|"searches vectors"| node_knowledge
node_localexec -->|"retrieves knowledge"| node_vector
node_temporalservice -->|"runs workflows"| node_temporal

click node_web "https://github.com/redhat-community-ai-tools/unifai/blob/main/ui/client/src/App.tsx"
click node_cli "https://github.com/redhat-community-ai-tools/unifai/blob/main/cli/unifai_cli/main.py"
click node_api "https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/inbound/flask/flask_app.py"
click node_blueprints "https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/lib/mas/blueprints/service.py"
click node_catalog "https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/lib/mas/catalog/service.py"
click node_templates "https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/lib/mas/resources/builtin_service.py"
click node_sessions "https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/lib/mas/session/management/user_session_manager.py"
click node_graph "https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/lib/mas/graph/state/graph_state.py"
click node_localexec "https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/outbound/langgraph/executor.py"
click node_temporal "https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/outbound/temporal/session_engine.py"
click node_stream "https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/inbound/flask/streaming/heartbeat_stream.py"
click node_collab "https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/lib/mas/collaboration/service.py"
click node_sessiondb "https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/outbound/mongo/session_repository.py"
click node_ragapi "https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/infrastructure/http/pipelines.py"
click node_dispatch "https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/infrastructure/celery/pipeline_dispatcher.py"
click node_dochingest "https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/core/data_sources/types/document/pipeline_handler.py"
click node_slackingest "https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/core/data_sources/types/slack/pipeline_handler.py"
click node_vector "https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/core/retrieval/service.py"
click node_ragstore "https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/infrastructure/mongo/pipeline_repository.py"
click node_celery "https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/infrastructure/celery/workers/pipeline_tasks.py"
click node_knowledge "https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/core/vector/domain/model.py"
click node_temporalservice "https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/temporal/client.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_cli,node_api,node_user toneBlue
class node_blueprints,node_catalog,node_templates,node_sessions,node_graph,node_localexec,node_temporal,node_stream,node_collab toneAmber
class node_ragapi,node_dispatch,node_dochingest,node_slackingest,node_vector toneMint
class node_sessiondb,node_ragstore,node_celery,node_knowledge,node_temporalservice toneRose
class node_queue toneIndigo
```

## Components

### User Interfaces

- [Web UI](https://github.com/redhat-community-ai-tools/unifai/blob/main/ui/client/src/App.tsx): `ui/client/src/App.tsx`
- [CLI](https://github.com/redhat-community-ai-tools/unifai/blob/main/cli/unifai_cli/main.py): `cli/unifai_cli/main.py`
- [Flask API](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/inbound/flask/flask_app.py): `multi-agent/adapters/inbound/flask/flask_app.py`

### Multi-Agent Workflows

- [Blueprints](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/lib/mas/blueprints/service.py): `multi-agent/lib/mas/blueprints/service.py`
- [Element Catalog](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/lib/mas/catalog/service.py): `multi-agent/lib/mas/catalog/service.py`
- [Workflow Templates](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/lib/mas/resources/builtin_service.py): `multi-agent/lib/mas/resources/builtin_service.py`
- [Session Manager](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/lib/mas/session/management/user_session_manager.py): `multi-agent/lib/mas/session/management/user_session_manager.py`
- [Graph State](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/lib/mas/graph/state/graph_state.py): `multi-agent/lib/mas/graph/state/graph_state.py`
- [Local Execution](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/outbound/langgraph/executor.py): `multi-agent/adapters/outbound/langgraph/executor.py`
- [Distributed Execution](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/outbound/temporal/session_engine.py): `multi-agent/adapters/outbound/temporal/session_engine.py`
- [Result Streaming](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/inbound/flask/streaming/heartbeat_stream.py): `multi-agent/adapters/inbound/flask/streaming/heartbeat_stream.py`
- [Session Collaboration](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/lib/mas/collaboration/service.py): `multi-agent/lib/mas/collaboration/service.py`

### Knowledge Ingestion

- [RAG API](https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/infrastructure/http/pipelines.py): `rag/infrastructure/http/pipelines.py`
- [Pipeline Dispatcher](https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/infrastructure/celery/pipeline_dispatcher.py): `rag/infrastructure/celery/pipeline_dispatcher.py`
- [Document Ingestion](https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/core/data_sources/types/document/pipeline_handler.py): `rag/core/data_sources/types/document/pipeline_handler.py`
- [Slack Ingestion](https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/core/data_sources/types/slack/pipeline_handler.py): `rag/core/data_sources/types/slack/pipeline_handler.py`
- [Vector Search](https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/core/retrieval/service.py): `rag/core/retrieval/service.py`

### Runtime Infrastructure

- [Session Repository](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/outbound/mongo/session_repository.py): `multi-agent/adapters/outbound/mongo/session_repository.py`
- [RAG Metadata Store](https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/infrastructure/mongo/pipeline_repository.py): `rag/infrastructure/mongo/pipeline_repository.py`
- [Celery Workers](https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/infrastructure/celery/workers/pipeline_tasks.py): `rag/infrastructure/celery/workers/pipeline_tasks.py`
- [Vector Database](https://github.com/redhat-community-ai-tools/unifai/blob/main/rag/core/vector/domain/model.py): `rag/core/vector/domain/model.py`
- [Temporal Service](https://github.com/redhat-community-ai-tools/unifai/blob/main/multi-agent/adapters/temporal/client.py): `multi-agent/adapters/temporal/client.py`

### Other components

- **Workflow User**
- **RabbitMQ**

## Connections

- Workflow User → Web UI: composes workflows (evidence: `README.md`)
- Workflow User → CLI: runs workflows (evidence: `README.md`)
- Web UI → Flask API: submits requests (evidence: `README.md`)
- CLI → Flask API: calls API
- Flask API → Blueprints: uses blueprints (evidence: `README.md`)
- Blueprints → Element Catalog: resolves elements (evidence: `README.md`)
- Web UI → Element Catalog: browses elements (evidence: `README.md`)
- Web UI → Workflow Templates: instantiates templates (evidence: `README.md`)
- Flask API → Session Manager: manages sessions (evidence: `multi-agent/lib/mas/session/management/user_session_manager.py`)
- Session Manager → Blueprints: loads blueprint (evidence: `multi-agent/lib/mas/session/management/user_session_manager.py`)
- Session Manager → Session Repository: persists sessions (evidence: `multi-agent/lib/mas/session/management/user_session_manager.py`)
- Session Manager → Local Execution: builds execution (evidence: `multi-agent/lib/mas/session/management/user_session_manager.py`)
- Session Manager → Distributed Execution: submits background run (evidence: `multi-agent/adapters/outbound/temporal/session_engine.py`)
- Distributed Execution → Temporal Service: starts workflow (evidence: `multi-agent/adapters/outbound/temporal/session_engine.py`)
- Local Execution → Graph State: updates state
- Distributed Execution → Graph State: executes graph state (evidence: `multi-agent/adapters/outbound/temporal/session_engine.py`)
- Graph State → Result Streaming: streams progress (evidence: `README.md`)
- Flask API → Session Collaboration: supports collaboration (evidence: `README.md`)
- Workflow User → RAG API: uploads sources (evidence: `README.md`)
- RAG API → Pipeline Dispatcher: dispatches ingestion (evidence: `README.md`)
- Pipeline Dispatcher → RabbitMQ: sends tasks (evidence: `rag/infrastructure/celery/pipeline_dispatcher.py`)
- RabbitMQ → Celery Workers: delivers tasks
- Celery Workers → Document Ingestion: runs document pipeline (evidence: `rag/infrastructure/celery/workers/pipeline_tasks.py`)
- Celery Workers → Slack Ingestion: runs Slack pipeline (evidence: `rag/infrastructure/celery/workers/pipeline_tasks.py`)
- Document Ingestion → Vector Database: embeds chunks (evidence: `rag/core/data_sources/types/document/pipeline_handler.py`)
- Slack Ingestion → Vector Database: embeds chunks (evidence: `rag/core/data_sources/types/slack/pipeline_handler.py`)
- Document Ingestion → RAG Metadata Store: tracks pipeline
- Slack Ingestion → RAG Metadata Store: tracks pipeline
- Web UI → Vector Search: queries dashboard (evidence: `README.md`)
- Vector Search → Vector Database: searches vectors (evidence: `README.md`)
- Local Execution → Vector Search: retrieves knowledge (evidence: `README.md`)
- Temporal Service → Distributed Execution: runs workflows (evidence: `multi-agent/adapters/outbound/temporal/session_engine.py`)
