# vbuyel/llm_semantic_file_system architecture

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

## Overview

Semantic FS is an event-driven file platform with a dashboard, Google OAuth, GCS/Drive operations, an AI assistant, semantic indexing, and live activity history. The main user flow is dashboard request → gateway → file or AI service; file uploads also lead to text extraction and Kafka events, which support vector indexing and event logging. The graph preserves README-documented service flows and source-visible UI and upload calls. Several service internals were not excerpted, so links based only on documented architecture cite the README; unsampled implementation details are not inferred.

Main entry points: [`src/file_ops/v1/main.py`](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/file_ops/v1/main.py) (File Operations), [`src/gateway_auth/v1/gateway_router.py`](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/gateway_auth/v1/gateway_router.py) (Gateway API), [`ui/js/api.js`](https://github.com/vbuyel/llm_semantic_file_system/blob/main/ui/js/api.js) (Dashboard API), [`src/kafka/broker.py`](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/kafka/broker.py) (Kafka Broker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard"]
  node_dashboard["Dashboard UI<br/>[app.js]"]
  node_api["Dashboard API<br/>[api.js]"]
  node_event_ui["Live Event UI<br/>[base.js]"]
end

subgraph group_gateway["Gateway and Auth"]
  node_gateway["Gateway API<br/>[gateway_router.py]"]
  node_oauth["Google OAuth<br/>[oauth_router.py]"]
end

subgraph group_files["File Management"]
  node_file_service["File Operations<br/>[main.py]"]
  node_gcs["GCS Adapter<br/>[gcs_ops.py]"]
  node_drive["Drive Adapter"]
  node_extractor["Text Extraction<br/>[text_extractor.py]"]
end

subgraph group_ai["AI and Search"]
  node_llm_service["LLM Service<br/>[main.py]"]
  node_agent["AI Agent<br/>[agent.py]"]
  node_rag["Document Search<br/>[rag_search.py]"]
  node_web["Web Search<br/>[web_search.py]"]
  node_kafka_client["LLM Kafka Adapter<br/>[kafka.py]"]
end

subgraph group_events["Events and Storage"]
  node_broker["Kafka Broker<br/>[broker.py]"]
  node_vector_service["Vector DB Service<br/>[main.py]"]
  node_vector_store[("Vector Index<br/>[database.py]")]
  node_event_service["Event DB Service<br/>[main.py]"]
  node_event_store["Event Store Adapter<br/>[database.py]"]
end

node_user(("User"))
node_storage[("Cloud File Storage")]
node_postgres[("PostgreSQL")]

node_user -->|"uses"| node_dashboard
node_dashboard -->|"requests"| node_api
node_api -->|"calls REST"| node_gateway
node_dashboard -->|"starts events"| node_event_ui
node_event_ui -->|"connects WebSocket"| node_api
node_api -->|"submits callback"| node_oauth
node_gateway -->|"routes auth"| node_oauth
node_gateway -->|"proxies file requests"| node_file_service
node_gateway -->|"proxies AI request"| node_llm_service
node_file_service -->|"dispatches storage"| node_gcs
node_file_service -->|"dispatches storage"| node_drive
node_gcs -.->|"reads and writes"| node_storage
node_drive -.->|"reads and writes"| node_storage
node_file_service -.->|"extracts text"| node_extractor
node_file_service -->|"publishes events"| node_broker
node_llm_service -->|"runs agent"| node_agent
node_agent -->|"invokes document search"| node_rag
node_agent -->|"invokes web search"| node_web
node_rag -->|"requests search"| node_kafka_client
node_kafka_client -->|"sends commands"| node_broker
node_broker -->|"delivers commands"| node_vector_service
node_vector_service -.->|"indexes and queries"| node_vector_store
node_vector_store -->|"persists vectors"| node_postgres
node_broker -->|"delivers events"| node_event_service
node_event_service -.->|"records events"| node_event_store
node_event_store -->|"persists logs"| node_postgres
node_event_service -->|"forwards live events"| node_gateway

click node_dashboard "https://github.com/vbuyel/llm_semantic_file_system/blob/main/ui/js/app.js"
click node_api "https://github.com/vbuyel/llm_semantic_file_system/blob/main/ui/js/api.js"
click node_event_ui "https://github.com/vbuyel/llm_semantic_file_system/blob/main/ui/js/components/events/base.js"
click node_gateway "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/gateway_auth/v1/gateway_router.py"
click node_oauth "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/gateway_auth/v1/oauth_router.py"
click node_file_service "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/file_ops/v1/main.py"
click node_gcs "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/file_ops/adapters/gcs_ops.py"
click node_drive "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/file_ops/adapters/google_drive_ops.py"
click node_extractor "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/file_ops/adapters/text_extractor.py"
click node_llm_service "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/llm/v1/main.py"
click node_agent "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/llm/adapters/agent.py"
click node_rag "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/llm/adapters/rag_search.py"
click node_web "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/llm/adapters/web_search.py"
click node_kafka_client "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/llm/adapters/kafka.py"
click node_broker "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/kafka/broker.py"
click node_vector_service "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/vector_db/v1/main.py"
click node_vector_store "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/vector_db/adapters/database.py"
click node_event_service "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/event_db/v1/main.py"
click node_event_store "https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/event_db/adapters/database.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_dashboard,node_api,node_event_ui,node_user toneBlue
class node_gateway,node_oauth,node_storage,node_postgres toneAmber
class node_file_service,node_gcs,node_drive,node_extractor toneMint
class node_llm_service,node_agent,node_rag,node_web,node_kafka_client toneRose
class node_broker,node_vector_service,node_vector_store,node_event_service,node_event_store toneIndigo
```

## Components

### Dashboard

- [Dashboard UI](https://github.com/vbuyel/llm_semantic_file_system/blob/main/ui/js/app.js): `ui/js/app.js`
- [Dashboard API](https://github.com/vbuyel/llm_semantic_file_system/blob/main/ui/js/api.js): `ui/js/api.js`
- [Live Event UI](https://github.com/vbuyel/llm_semantic_file_system/blob/main/ui/js/components/events/base.js): `ui/js/components/events/base.js`

### Gateway and Auth

- [Gateway API](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/gateway_auth/v1/gateway_router.py): `src/gateway_auth/v1/gateway_router.py`
- [Google OAuth](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/gateway_auth/v1/oauth_router.py): `src/gateway_auth/v1/oauth_router.py`

### File Management

- [File Operations](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/file_ops/v1/main.py): `src/file_ops/v1/main.py`
- [GCS Adapter](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/file_ops/adapters/gcs_ops.py): `src/file_ops/adapters/gcs_ops.py`
- [Drive Adapter](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/file_ops/adapters/google_drive_ops.py): `src/file_ops/adapters/google_drive_ops.py`
- [Text Extraction](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/file_ops/adapters/text_extractor.py): `src/file_ops/adapters/text_extractor.py`

### AI and Search

- [LLM Service](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/llm/v1/main.py): `src/llm/v1/main.py`
- [AI Agent](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/llm/adapters/agent.py): `src/llm/adapters/agent.py`
- [Document Search](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/llm/adapters/rag_search.py): `src/llm/adapters/rag_search.py`
- [Web Search](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/llm/adapters/web_search.py): `src/llm/adapters/web_search.py`
- [LLM Kafka Adapter](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/llm/adapters/kafka.py): `src/llm/adapters/kafka.py`

### Events and Storage

- [Kafka Broker](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/kafka/broker.py): `src/kafka/broker.py`
- [Vector DB Service](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/vector_db/v1/main.py): `src/vector_db/v1/main.py`
- [Vector Index](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/vector_db/adapters/database.py): `src/vector_db/adapters/database.py`
- [Event DB Service](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/event_db/v1/main.py): `src/event_db/v1/main.py`
- [Event Store Adapter](https://github.com/vbuyel/llm_semantic_file_system/blob/main/src/event_db/adapters/database.py): `src/event_db/adapters/database.py`

### Other components

- **User**
- **Cloud File Storage**
- **PostgreSQL**

## Connections

- User → Dashboard UI: uses
- Dashboard UI → Dashboard API: requests (evidence: `ui/js/app.js`)
- Dashboard API → Gateway API: calls REST (evidence: `ui/js/api.js`)
- Dashboard UI → Live Event UI: starts events (evidence: `ui/js/app.js`)
- Live Event UI → Dashboard API: connects WebSocket (evidence: `ui/js/components/events/base.js`)
- Dashboard API → Google OAuth: submits callback (evidence: `ui/js/api.js`)
- Gateway API → Google OAuth: routes auth (evidence: `src/gateway_auth/v1/main.py`)
- Gateway API → File Operations: proxies file requests
- Gateway API → LLM Service: proxies AI request
- File Operations → GCS Adapter: dispatches storage (evidence: `src/file_ops/v1/main.py`)
- File Operations → Drive Adapter: dispatches storage (evidence: `src/file_ops/v1/main.py`)
- GCS Adapter → Cloud File Storage: reads and writes
- Drive Adapter → Cloud File Storage: reads and writes
- File Operations → Text Extraction: extracts text
- File Operations → Kafka Broker: publishes events
- LLM Service → AI Agent: runs agent (evidence: `src/llm/v1/main.py`)
- AI Agent → Document Search: invokes document search (evidence: `src/llm/adapters/agent.py`)
- AI Agent → Web Search: invokes web search (evidence: `src/llm/adapters/agent.py`)
- Document Search → LLM Kafka Adapter: requests search (evidence: `src/llm/adapters/rag_search.py`)
- LLM Kafka Adapter → Kafka Broker: sends commands
- Kafka Broker → Vector DB Service: delivers commands
- Vector DB Service → Vector Index: indexes and queries
- Vector Index → PostgreSQL: persists vectors
- Kafka Broker → Event DB Service: delivers events
- Event DB Service → Event Store Adapter: records events (evidence: `src/event_db/v1/main.py`)
- Event Store Adapter → PostgreSQL: persists logs
- Event DB Service → Gateway API: forwards live events
