# onyx-dot-app/onyx architecture

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

- Interactive diagram: https://gitdiagram.com/onyx-dot-app/onyx
- Repository: https://github.com/onyx-dot-app/onyx

## Overview

Onyx is a team knowledge and AI-assistant platform: it ingests connected-source content and permissions into an internal representation, then retrieves relevant context for chat, agents, and other clients. The graph includes the documented agent, web-search, action, sandbox, and artifact capabilities, but their implementation paths are not established by the sampled sources. Indexing and shared storage links are grounded in the source index and excerpts; other feature relationships are documented at the README level.

Main entry points: [`backend/ee/onyx/server/query_and_chat/query_backend.py`](https://github.com/onyx-dot-app/onyx/blob/main/backend/ee/onyx/server/query_and_chat/query_backend.py) (Query and chat), [`backend/onyx/agents/runtime.py`](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/agents/runtime.py) (Custom agents), [`backend/onyx/indexing/indexing_pipeline.py`](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/indexing/indexing_pipeline.py) (Indexing pipeline), [`backend/onyx/file_store/document_batch_storage.py`](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/file_store/document_batch_storage.py) (Document batches)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Knowledge ingestion"]
  node_connectors["Source connectors<br/>[models.py]"]
  node_indexing["Indexing pipeline"]
  node_batch["Document batches"]
  node_files["File store<br/>[file_store.py]"]
  node_knowledge[("Knowledge index<br/>[document.py]")]
end

subgraph group_retrieval["Query and retrieval"]
  node_query["Query and chat<br/>[query_backend.py]"]
  node_search["Search processing"]
  node_search_pipeline["Search pipeline<br/>[pipeline.py]"]
  node_permissions["Access controls<br/>[access.py]"]
end

subgraph group_assistants["AI capabilities"]
  node_agents["Custom agents<br/>[runtime.py]"]
  node_research["Deep research"]
  node_web["Web search<br/>[tools.py]"]
  node_actions["External actions<br/>[tool_execution.py]"]
  node_sandbox["Secure sandbox<br/>[main.go]"]
  node_artifacts["Artifacts<br/>[runtime.py]"]
  node_llm["LLM providers<br/>[llm_configs.py]"]
end

subgraph group_platform["Shared platform"]
  node_model_server["Model inference<br/>[main.py]"]
  node_database[("SQL database<br/>[sql_engine.py]")]
  node_settings["Runtime configuration<br/>[app_configs.py]"]
  node_cache["Cache interface<br/>[interface.py]"]
end

node_user(("User"))
node_clients["Product clients"]

node_user -->|"asks through"| node_clients
node_clients -->|"submits queries"| node_query
node_connectors -->|"provides documents"| node_indexing
node_indexing -->|"stores batches"| node_batch
node_batch -->|"uses storage"| node_files
node_indexing -->|"indexes documents"| node_knowledge
node_query -->|"processes queries"| node_search
node_query -->|"retrieves context"| node_search_pipeline
node_search -->|"searches knowledge"| node_knowledge
node_query -->|"enforces access"| node_permissions
node_query -->|"runs agents"| node_agents
node_agents -->|"coordinates research"| node_research
node_agents -->|"uses web search"| node_web
node_agents -->|"takes actions"| node_actions
node_agents -->|"executes code"| node_sandbox
node_agents -->|"generates artifacts"| node_artifacts
node_query -->|"requests generation"| node_llm
node_llm -.->|"uses inference"| node_model_server
node_indexing -->|"persists metadata"| node_database
node_query -.->|"reads records"| node_database
node_indexing -->|"uses configuration"| node_settings
node_query -.->|"uses configuration"| node_settings
node_files -->|"uses cache"| node_cache

click node_connectors "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/connectors/models.py"
click node_indexing "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/indexing/indexing_pipeline.py"
click node_batch "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/file_store/document_batch_storage.py"
click node_files "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/file_store/file_store.py"
click node_knowledge "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/db/document.py"
click node_query "https://github.com/onyx-dot-app/onyx/blob/main/backend/ee/onyx/server/query_and_chat/query_backend.py"
click node_search "https://github.com/onyx-dot-app/onyx/blob/main/backend/ee/onyx/search/process_search_query.py"
click node_search_pipeline "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/context/search/pipeline.py"
click node_permissions "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/access/access.py"
click node_agents "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/agents/runtime.py"
click node_research "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/agents/agent_coordination.py"
click node_web "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/agents/tools.py"
click node_actions "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/agents/tool_execution.py"
click node_sandbox "https://github.com/onyx-dot-app/onyx/blob/main/microvm/cmd/host-agent/main.go"
click node_artifacts "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/agents/runtime.py"
click node_llm "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/configs/llm_configs.py"
click node_model_server "https://github.com/onyx-dot-app/onyx/blob/main/backend/model_server/main.py"
click node_database "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/db/engine/sql_engine.py"
click node_settings "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/configs/app_configs.py"
click node_cache "https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/cache/interface.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_connectors,node_indexing,node_batch,node_files,node_knowledge,node_user,node_clients toneBlue
class node_query,node_search,node_search_pipeline,node_permissions toneAmber
class node_agents,node_research,node_web,node_actions,node_sandbox,node_artifacts,node_llm toneMint
class node_model_server,node_database,node_settings,node_cache toneRose
```

## Components

### Knowledge ingestion

- [Source connectors](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/connectors/models.py): `backend/onyx/connectors/models.py`
- [Indexing pipeline](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/indexing/indexing_pipeline.py): `backend/onyx/indexing/indexing_pipeline.py`
- [Document batches](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/file_store/document_batch_storage.py): `backend/onyx/file_store/document_batch_storage.py`
- [File store](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/file_store/file_store.py): `backend/onyx/file_store/file_store.py`
- [Knowledge index](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/db/document.py): `backend/onyx/db/document.py`

### Query and retrieval

- [Query and chat](https://github.com/onyx-dot-app/onyx/blob/main/backend/ee/onyx/server/query_and_chat/query_backend.py): `backend/ee/onyx/server/query_and_chat/query_backend.py`
- [Search processing](https://github.com/onyx-dot-app/onyx/blob/main/backend/ee/onyx/search/process_search_query.py): `backend/ee/onyx/search/process_search_query.py`
- [Search pipeline](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/context/search/pipeline.py): `backend/onyx/context/search/pipeline.py`
- [Access controls](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/access/access.py): `backend/onyx/access/access.py`

### AI capabilities

- [Custom agents](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/agents/runtime.py): `backend/onyx/agents/runtime.py`
- [Deep research](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/agents/agent_coordination.py): `backend/onyx/agents/agent_coordination.py`
- [Web search](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/agents/tools.py): `backend/onyx/agents/tools.py`
- [External actions](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/agents/tool_execution.py): `backend/onyx/agents/tool_execution.py`
- [Secure sandbox](https://github.com/onyx-dot-app/onyx/blob/main/microvm/cmd/host-agent/main.go): `microvm/cmd/host-agent/main.go`
- [Artifacts](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/agents/runtime.py): `backend/onyx/agents/runtime.py`
- [LLM providers](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/configs/llm_configs.py): `backend/onyx/configs/llm_configs.py`

### Shared platform

- [Model inference](https://github.com/onyx-dot-app/onyx/blob/main/backend/model_server/main.py): `backend/model_server/main.py`
- [SQL database](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/db/engine/sql_engine.py): `backend/onyx/db/engine/sql_engine.py`
- [Runtime configuration](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/configs/app_configs.py): `backend/onyx/configs/app_configs.py`
- [Cache interface](https://github.com/onyx-dot-app/onyx/blob/main/backend/onyx/cache/interface.py): `backend/onyx/cache/interface.py`

### Other components

- **User**
- **Product clients**

## Connections

- User → Product clients: asks through
- Product clients → Query and chat: submits queries
- Source connectors → Indexing pipeline: provides documents (evidence: `backend/onyx/indexing/indexing_pipeline.py`)
- Indexing pipeline → Document batches: stores batches (evidence: `backend/onyx/indexing/indexing_pipeline.py`)
- Document batches → File store: uses storage (evidence: `backend/onyx/file_store/document_batch_storage.py`)
- Indexing pipeline → Knowledge index: indexes documents (evidence: `backend/onyx/indexing/indexing_pipeline.py`)
- Query and chat → Search processing: processes queries
- Query and chat → Search pipeline: retrieves context
- Search processing → Knowledge index: searches knowledge
- Query and chat → Access controls: enforces access
- Query and chat → Custom agents: runs agents
- Custom agents → Deep research: coordinates research
- Custom agents → Web search: uses web search
- Custom agents → External actions: takes actions
- Custom agents → Secure sandbox: executes code
- Custom agents → Artifacts: generates artifacts
- Query and chat → LLM providers: requests generation
- LLM providers → Model inference: uses inference
- Indexing pipeline → SQL database: persists metadata (evidence: `backend/onyx/indexing/indexing_pipeline.py`)
- Query and chat → SQL database: reads records
- Indexing pipeline → Runtime configuration: uses configuration (evidence: `backend/onyx/indexing/indexing_pipeline.py`)
- Query and chat → Runtime configuration: uses configuration
- File store → Cache interface: uses cache (evidence: `backend/onyx/file_store/file_store.py`)
