# lexxani-dev/vitrivr-engine architecture

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

- Interactive diagram: https://gitdiagram.com/lexxani-dev/vitrivr-engine
- Repository: https://github.com/lexxani-dev/vitrivr-engine

## Overview

vitrivr-engine is a modular multimedia ingestion and retrieval engine. Its principal workflow accepts media for configured ingestion, extracts and persists retrievable content and descriptors, then accepts a query and returns matching results through the server. The graph also preserves documented database backends, optional external feature extraction, and multimedia processing capabilities. Several subsystem links are based on the README or SOURCE INDEX rather than inspected implementation, so those edges are limited to relationships explicitly documented or referenced there.

Main entry points: [`vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/retrievable/Retrievable.kt`](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/retrievable/Retrievable.kt) (Retrievable Records), [`vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/metamodel/SchemaManager.kt`](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/metamodel/SchemaManager.kt) (Schema Manager), [`vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/parsing/QueryParser.kt`](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/parsing/QueryParser.kt) (Query Parser), [`vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/Main.kt`](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/Main.kt) (Engine Server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Server API"]
  node_server["Engine Server<br/>[Main.kt]"]
  node_routes["REST Routes<br/>[Routes.kt]"]
  node_query_handler["Query Handler<br/>[Query.kt]"]
end

subgraph group_workflow["Ingestion and Retrieval"]
  node_schema_manager["Schema Manager<br/>[SchemaManager.kt]"]
  node_schema["Schema and Fields<br/>[Schema.kt]"]
  node_ingest_config["Ingestion Config<br/>[IngestionConfig.kt]"]
  node_ingest_builder["Ingestion Builder"]
  node_execution["Pipeline Execution<br/>[ExecutionServer.kt]"]
  node_operators["Pipeline Operators<br/>[Operator.kt]"]
  node_query_parser["Query Parser<br/>[QueryParser.kt]"]
  node_query_pipeline["Retrieval Pipeline"]
  node_query_result["Query Results<br/>[QueryResult.kt]"]
end

subgraph group_domain["Data Model"]
  node_context["Execution Context<br/>[Context.kt]"]
  node_retrievable["Retrievable Records<br/>[Retrievable.kt]"]
  node_content["Media Content<br/>[ContentElement.kt]"]
  node_descriptor["Feature Descriptors<br/>[Descriptor.kt]"]
end

subgraph group_storage["Storage Backends"]
  node_database[("Configured Database")]
  node_pgvector["pgvector Backend"]
  node_cottontail["Cottontail Backend"]
  node_jsonl["JSONL Backend"]
end

subgraph group_media["Media Capabilities"]
  node_features["Feature Extractors"]
  node_video["Video Processing"]
  node_segmenter["Shot Segmentation"]
  node_exporter["Preview Export"]
  node_external_features{{"Feature Service"}}
end

node_user(("Client"))

node_user -->|"uses"| node_server
node_server -->|"starts"| node_execution
node_server -->|"configures"| node_routes
node_routes -->|"uses"| node_schema_manager
node_query_handler -.->|"parses queries"| node_query_parser
node_schema_manager -->|"creates"| node_schema
node_schema_manager -->|"opens connection"| node_database
node_schema_manager -->|"loads pipeline"| node_ingest_config
node_ingest_config -->|"builds from"| node_ingest_builder
node_ingest_builder -->|"assembles"| node_operators
node_ingest_builder -->|"uses"| node_context
node_query_parser -->|"creates"| node_operators
node_query_parser -->|"creates"| node_context
node_query_parser -->|"uses fields"| node_schema
node_execution -->|"runs"| node_query_pipeline
node_operators -.->|"processes"| node_retrievable
node_retrievable -->|"holds"| node_content
node_retrievable -->|"holds"| node_descriptor
node_schema -->|"provides extractors"| node_features
node_features -.->|"produces"| node_descriptor
node_database -->|"selects backend"| node_pgvector
node_database -->|"selects backend"| node_cottontail
node_database -.->|"optional backend"| node_jsonl
node_pgvector -.->|"reads and writes"| node_retrievable
node_cottontail -.->|"reads and writes"| node_retrievable
node_video -.->|"supports processing"| node_segmenter
node_video -.->|"supports previews"| node_exporter
node_features -.->|"calls optionally"| node_external_features
node_query_pipeline -.->|"returns"| node_query_result
node_query_handler -.->|"responds with"| node_query_result

click node_server "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/Main.kt"
click node_routes "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/api/rest/Routes.kt"
click node_query_handler "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/api/rest/handlers/Query.kt"
click node_schema_manager "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/metamodel/SchemaManager.kt"
click node_schema "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/metamodel/Schema.kt"
click node_ingest_config "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/ingest/IngestionConfig.kt"
click node_ingest_builder "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/ingest/IngestionPipelineBuilder.kt"
click node_execution "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/pipeline/execution/ExecutionServer.kt"
click node_operators "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/operators/Operator.kt"
click node_query_parser "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/parsing/QueryParser.kt"
click node_query_pipeline "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/pipeline/execution/RetrievalPipeline.kt"
click node_query_result "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/model/api/result/QueryResult.kt"
click node_context "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/context/Context.kt"
click node_retrievable "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/retrievable/Retrievable.kt"
click node_content "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/content/element/ContentElement.kt"
click node_descriptor "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/descriptor/Descriptor.kt"
click node_pgvector "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-module-pgvector/src/main/kotlin/org/vitrivr/engine/database/pgvector/retrievable/PgRetrievableReader.kt"
click node_cottontail "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-module-cottontaildb/src/main/kotlin/org/vitrivr/engine/plugin/cottontaildb/retrievable/RetrievableReader.kt"
click node_jsonl "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-module-jsonl/src/main/kotlin/org/vitrivr/engine/database/jsonl/retrievable/JsonlRetrievableReader.kt"
click node_features "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/features/AbstractExtractor.kt"
click node_video "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-index/src/main/kotlin/org/vitrivr/engine/index/decode/FFmpegVideoDecoder.kt"
click node_segmenter "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-index/src/main/kotlin/org/vitrivr/engine/index/segment/ShotBoundarySegmenter.kt"
click node_exporter "https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-index/src/main/kotlin/org/vitrivr/engine/index/exporters/VideoPreviewExporter.kt"

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_server,node_routes,node_query_handler,node_user toneBlue
class node_schema_manager,node_schema,node_ingest_config,node_ingest_builder,node_execution,node_operators,node_query_parser,node_query_pipeline,node_query_result toneAmber
class node_context,node_retrievable,node_content,node_descriptor toneMint
class node_database,node_pgvector,node_cottontail,node_jsonl toneRose
class node_features,node_video,node_segmenter,node_exporter,node_external_features toneIndigo
```

## Components

### Server API

- [Engine Server](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/Main.kt): `vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/Main.kt`
- [REST Routes](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/api/rest/Routes.kt): `vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/api/rest/Routes.kt`
- [Query Handler](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/api/rest/handlers/Query.kt): `vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/api/rest/handlers/Query.kt`

### Ingestion and Retrieval

- [Schema Manager](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/metamodel/SchemaManager.kt): `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/metamodel/SchemaManager.kt`
- [Schema and Fields](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/metamodel/Schema.kt): `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/metamodel/Schema.kt`
- [Ingestion Config](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/ingest/IngestionConfig.kt): `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/ingest/IngestionConfig.kt`
- [Ingestion Builder](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/ingest/IngestionPipelineBuilder.kt): `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/ingest/IngestionPipelineBuilder.kt`
- [Pipeline Execution](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/pipeline/execution/ExecutionServer.kt): `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/pipeline/execution/ExecutionServer.kt`
- [Pipeline Operators](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/operators/Operator.kt): `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/operators/Operator.kt`
- [Query Parser](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/parsing/QueryParser.kt): `vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/parsing/QueryParser.kt`
- [Retrieval Pipeline](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/pipeline/execution/RetrievalPipeline.kt): `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/pipeline/execution/RetrievalPipeline.kt`
- [Query Results](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/model/api/result/QueryResult.kt): `vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/model/api/result/QueryResult.kt`

### Data Model

- [Execution Context](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/context/Context.kt): `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/context/Context.kt`
- [Retrievable Records](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/retrievable/Retrievable.kt): `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/retrievable/Retrievable.kt`
- [Media Content](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/content/element/ContentElement.kt): `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/content/element/ContentElement.kt`
- [Feature Descriptors](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/descriptor/Descriptor.kt): `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/descriptor/Descriptor.kt`

### Storage Backends

- **Configured Database**
- [pgvector Backend](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-module-pgvector/src/main/kotlin/org/vitrivr/engine/database/pgvector/retrievable/PgRetrievableReader.kt): `vitrivr-engine-module-pgvector/src/main/kotlin/org/vitrivr/engine/database/pgvector/retrievable/PgRetrievableReader.kt`
- [Cottontail Backend](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-module-cottontaildb/src/main/kotlin/org/vitrivr/engine/plugin/cottontaildb/retrievable/RetrievableReader.kt): `vitrivr-engine-module-cottontaildb/src/main/kotlin/org/vitrivr/engine/plugin/cottontaildb/retrievable/RetrievableReader.kt`
- [JSONL Backend](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-module-jsonl/src/main/kotlin/org/vitrivr/engine/database/jsonl/retrievable/JsonlRetrievableReader.kt): `vitrivr-engine-module-jsonl/src/main/kotlin/org/vitrivr/engine/database/jsonl/retrievable/JsonlRetrievableReader.kt`

### Media Capabilities

- [Feature Extractors](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/features/AbstractExtractor.kt): `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/features/AbstractExtractor.kt`
- [Video Processing](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-index/src/main/kotlin/org/vitrivr/engine/index/decode/FFmpegVideoDecoder.kt): `vitrivr-engine-index/src/main/kotlin/org/vitrivr/engine/index/decode/FFmpegVideoDecoder.kt`
- [Shot Segmentation](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-index/src/main/kotlin/org/vitrivr/engine/index/segment/ShotBoundarySegmenter.kt): `vitrivr-engine-index/src/main/kotlin/org/vitrivr/engine/index/segment/ShotBoundarySegmenter.kt`
- [Preview Export](https://github.com/lexxani-dev/vitrivr-engine/blob/main/vitrivr-engine-index/src/main/kotlin/org/vitrivr/engine/index/exporters/VideoPreviewExporter.kt): `vitrivr-engine-index/src/main/kotlin/org/vitrivr/engine/index/exporters/VideoPreviewExporter.kt`
- **Feature Service**

### Other components

- **Client**

## Connections

- Client → Engine Server: uses
- Engine Server → Pipeline Execution: starts (evidence: `vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/Main.kt`)
- Engine Server → REST Routes: configures (evidence: `vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/api/rest/Routes.kt`)
- REST Routes → Schema Manager: uses (evidence: `vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/api/rest/Routes.kt`)
- Query Handler → Query Parser: parses queries (evidence: `vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/api/rest/handlers/Query.kt`)
- Schema Manager → Schema and Fields: creates (evidence: `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/metamodel/SchemaManager.kt`)
- Schema Manager → Configured Database: opens connection (evidence: `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/metamodel/SchemaManager.kt`)
- Schema Manager → Ingestion Config: loads pipeline (evidence: `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/metamodel/SchemaManager.kt`)
- Ingestion Config → Ingestion Builder: builds from (evidence: `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/ingest/IngestionPipelineBuilder.kt`)
- Ingestion Builder → Pipeline Operators: assembles (evidence: `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/ingest/IngestionPipelineBuilder.kt`)
- Ingestion Builder → Execution Context: uses (evidence: `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/ingest/IngestionPipelineBuilder.kt`)
- Query Parser → Pipeline Operators: creates (evidence: `vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/parsing/QueryParser.kt`)
- Query Parser → Execution Context: creates (evidence: `vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/parsing/QueryParser.kt`)
- Query Parser → Schema and Fields: uses fields (evidence: `vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/parsing/QueryParser.kt`)
- Pipeline Execution → Retrieval Pipeline: runs (evidence: `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/config/pipeline/execution/RetrievalPipeline.kt`)
- Pipeline Operators → Retrievable Records: processes
- Retrievable Records → Media Content: holds (evidence: `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/retrievable/Retrievable.kt`)
- Retrievable Records → Feature Descriptors: holds (evidence: `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/retrievable/Retrievable.kt`)
- Schema and Fields → Feature Extractors: provides extractors (evidence: `vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/metamodel/Schema.kt`)
- Feature Extractors → Feature Descriptors: produces
- Configured Database → pgvector Backend: selects backend
- Configured Database → Cottontail Backend: selects backend
- Configured Database → JSONL Backend: optional backend
- pgvector Backend → Retrievable Records: reads and writes
- Cottontail Backend → Retrievable Records: reads and writes (evidence: `vitrivr-engine-module-cottontaildb/src/main/kotlin/org/vitrivr/engine/plugin/cottontaildb/retrievable/RetrievableReader.kt`)
- Video Processing → Shot Segmentation: supports processing
- Video Processing → Preview Export: supports previews
- Feature Extractors → Feature Service: calls optionally
- Retrieval Pipeline → Query Results: returns
- Query Handler → Query Results: responds with (evidence: `vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/api/rest/handlers/Query.kt`)
