# pasittum/rag_ai architecture

> Architecture diagram of the GitHub repository pasittum/rag_ai, 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/pasittum/rag_ai
- Repository: https://github.com/pasittum/rag_ai

## Overview

Self-hosted AI Package is a Docker Compose template for running a local AI and low-code environment. The main user workflow is to start the selected service profile, then chat through Open WebUI; the included n8n Pipe sends the latest message to an n8n webhook and returns its response. The repository also includes RAG and agent workflow assets, search, vector storage, and supporting services. The README documents the broader stack, but most service definitions and workflow JSON were not sampled, so their internal connections are not inferred.

Main entry points: [`docker-compose.yml`](https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml) (Compose stack), [`n8n_pipe.py`](https://github.com/pasittum/rag_ai/blob/main/n8n_pipe.py) (n8n Pipe), [`start_services.py`](https://github.com/pasittum/rag_ai/blob/main/start_services.py) (Profile launcher), [`flowise/Web Search + n8n Agent Chatflow.json`](https://github.com/pasittum/rag_ai/blob/main/flowise/Web%20Search%20%2B%20n8n%20Agent%20Chatflow.json) (Flowise chatflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup"]
  node_launcher["Profile launcher<br/>[start_services.py]"]
  node_compose["Compose stack<br/>[docker-compose.yml]"]
end

subgraph group_chat["Chat and agents"]
  node_webui["Open WebUI<br/>[docker-compose.yml]"]
  node_pipe["n8n Pipe<br/>[n8n_pipe.py]"]
  node_n8n["n8n automation<br/>[docker-compose.yml]"]
  node_rag_workflows["RAG workflows"]
  node_rag_agent["RAG agent workflow<br/>[RAG.json]"]
  node_flowise["Flowise chatflow"]
  node_ollama["Ollama models<br/>[docker-compose.yml]"]
end

subgraph group_data["Data and retrieval"]
  node_supabase[("Supabase")]
  node_qdrant[("Qdrant vector store<br/>[docker-compose.yml]")]
end

subgraph group_support["Supporting services"]
  node_searxng["SearXNG search<br/>[settings-base.yml]"]
  node_neo4j[("Neo4j<br/>[docker-compose.yml]")]
  node_langfuse["Langfuse<br/>[docker-compose.yml]"]
  node_caddy["Caddy proxy"]
end

node_user(("User"))

node_user -->|"chats in"| node_webui
node_launcher -->|"starts profile"| node_compose
node_compose -->|"runs service"| node_webui
node_compose -->|"runs service"| node_n8n
node_compose -->|"runs service"| node_ollama
node_compose -->|"runs service"| node_supabase
node_compose -->|"runs service"| node_qdrant
node_compose -->|"runs service"| node_neo4j
node_compose -->|"runs service"| node_langfuse
node_compose -->|"runs service"| node_searxng
node_compose -->|"runs service"| node_caddy
node_webui -.->|"invokes pipe"| node_pipe
node_pipe -->|"posts webhook"| node_n8n
node_n8n -.->|"runs workflows"| node_rag_workflows
node_n8n -.->|"runs workflow"| node_rag_agent
node_flowise -.->|"uses agent"| node_n8n

click node_launcher "https://github.com/pasittum/rag_ai/blob/main/start_services.py"
click node_compose "https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml"
click node_webui "https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml"
click node_pipe "https://github.com/pasittum/rag_ai/blob/main/n8n_pipe.py"
click node_n8n "https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml"
click node_rag_workflows "https://github.com/pasittum/rag_ai/tree/main/n8n/backup/workflows"
click node_rag_agent "https://github.com/pasittum/rag_ai/blob/main/RAG.json"
click node_flowise "https://github.com/pasittum/rag_ai/blob/main/flowise/Web%20Search%20%2B%20n8n%20Agent%20Chatflow.json"
click node_supabase "https://github.com/pasittum/rag_ai/tree/main/supabase"
click node_qdrant "https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml"
click node_ollama "https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml"
click node_searxng "https://github.com/pasittum/rag_ai/blob/main/searxng/settings-base.yml"
click node_neo4j "https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml"
click node_langfuse "https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml"
click node_caddy "https://github.com/pasittum/rag_ai/blob/main/Caddyfile"

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_launcher,node_compose,node_user toneBlue
class node_webui,node_pipe,node_n8n,node_rag_workflows,node_rag_agent,node_flowise,node_ollama toneAmber
class node_supabase,node_qdrant toneMint
class node_searxng,node_neo4j,node_langfuse,node_caddy toneRose
```

## Components

### Startup

- [Profile launcher](https://github.com/pasittum/rag_ai/blob/main/start_services.py): `start_services.py`
- [Compose stack](https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml): `docker-compose.yml`

### Chat and agents

- [Open WebUI](https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml): `docker-compose.yml`
- [n8n Pipe](https://github.com/pasittum/rag_ai/blob/main/n8n_pipe.py): `n8n_pipe.py`
- [n8n automation](https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml): `docker-compose.yml`
- [RAG workflows](https://github.com/pasittum/rag_ai/tree/main/n8n/backup/workflows): `n8n/backup/workflows`
- [RAG agent workflow](https://github.com/pasittum/rag_ai/blob/main/RAG.json): `RAG.json`
- [Flowise chatflow](https://github.com/pasittum/rag_ai/blob/main/flowise/Web%20Search%20%2B%20n8n%20Agent%20Chatflow.json): `flowise/Web Search + n8n Agent Chatflow.json`
- [Ollama models](https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml): `docker-compose.yml`

### Data and retrieval

- [Supabase](https://github.com/pasittum/rag_ai/tree/main/supabase): `supabase`
- [Qdrant vector store](https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml): `docker-compose.yml`

### Supporting services

- [SearXNG search](https://github.com/pasittum/rag_ai/blob/main/searxng/settings-base.yml): `searxng/settings-base.yml`
- [Neo4j](https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml): `docker-compose.yml`
- [Langfuse](https://github.com/pasittum/rag_ai/blob/main/docker-compose.yml): `docker-compose.yml`
- [Caddy proxy](https://github.com/pasittum/rag_ai/blob/main/Caddyfile): `Caddyfile`

### Other components

- **User**

## Connections

- User → Open WebUI: chats in (evidence: `README.md`)
- Profile launcher → Compose stack: starts profile (evidence: `start_services.py`)
- Compose stack → Open WebUI: runs service (evidence: `README.md`)
- Compose stack → n8n automation: runs service (evidence: `README.md`)
- Compose stack → Ollama models: runs service (evidence: `README.md`)
- Compose stack → Supabase: runs service (evidence: `README.md`)
- Compose stack → Qdrant vector store: runs service (evidence: `README.md`)
- Compose stack → Neo4j: runs service (evidence: `README.md`)
- Compose stack → Langfuse: runs service (evidence: `README.md`)
- Compose stack → SearXNG search: runs service (evidence: `README.md`)
- Compose stack → Caddy proxy: runs service (evidence: `README.md`)
- Open WebUI → n8n Pipe: invokes pipe
- n8n Pipe → n8n automation: posts webhook (evidence: `n8n_pipe.py`)
- n8n automation → RAG workflows: runs workflows
- n8n automation → RAG agent workflow: runs workflow
- Flowise chatflow → n8n automation: uses agent
