# sahilbhandare89/high-performance-rag-engine architecture

> Architecture diagram of the GitHub repository sahilbhandare89/high-performance-rag-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sahilbhandare89/high-performance-rag-engine
- Repository: https://github.com/sahilbhandare89/high-performance-rag-engine

## Overview

This is a Java RAG application whose visible product areas are document ingestion, chunking, and embedding. The apparent user workflow is to submit a document, split it into chunks, and embed chunks; the tree also shows a separate chunking API. The README is empty and no source excerpts are available, so component connections and runtime call order cannot be verified. The graph therefore maps the identifiable product components without asserting unsupported calls or data transfers.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Document ingestion"]
  node_document_api["Document API"]
  node_ingestion_service["Ingestion service"]
  node_document_model["Document model<br/>[Document.java]"]
  node_chunk_api["Chunk API"]
  node_chunk_service["Chunk service"]
  node_chunker["Document chunker"]
  node_chunk_model["Document chunk<br/>[DocumentChunk.java]"]
  node_document_repository["Document repository"]
  node_memory_repository[("In-memory repository")]
  node_chunk_repository["Chunk repository"]
end

subgraph group_embedding["Embedding"]
  node_embedding_use_case["Chunk embedding use case"]
  node_embedding_service["Embedding service"]
  node_embedding_provider["Embedding provider"]
  node_local_provider["Local provider"]
  node_vector_record["Vector record<br/>[VectorRecord.java]"]
end

subgraph group_runtime["Application runtime"]
  node_application["Spring application"]
end

node_user(("API client"))

click node_document_api "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/api/DocumentController.java"
click node_ingestion_service "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/application/DefaultDocumentIngestionService.java"
click node_document_model "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/domain/document/Document.java"
click node_chunk_api "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/infrastructure/api/DocumentChunkController.java"
click node_chunk_service "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/application/chunking/ChunkDocumentService.java"
click node_chunker "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/domain/chunking/FixedSizeDocumentChunker.java"
click node_chunk_model "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/domain/document/DocumentChunk.java"
click node_document_repository "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/domain/DocumentRepository.java"
click node_memory_repository "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/infrastructure/persistence/InMemoryDocumentRepository.java"
click node_chunk_repository "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/domain/chunking/DocumentChunkRepository.java"
click node_embedding_use_case "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/embedding/application/DefaultEmbedDocumentChunkUseCase.java"
click node_embedding_service "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/embedding/application/DefaultEmbeddingService.java"
click node_embedding_provider "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/embedding/application/port/EmbeddingProvider.java"
click node_local_provider "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/embedding/infrastructure/provider/LocalEmbeddingProvider.java"
click node_vector_record "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/embedding/domain/VectorRecord.java"
click node_application "https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/RagApplication.java"

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_document_api,node_ingestion_service,node_document_model,node_chunk_api,node_chunk_service,node_chunker,node_chunk_model,node_document_repository,node_memory_repository,node_chunk_repository,node_user toneBlue
class node_embedding_use_case,node_embedding_service,node_embedding_provider,node_local_provider,node_vector_record toneAmber
class node_application toneMint
```

## Components

### Document ingestion

- [Document API](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/api/DocumentController.java): `src/main/java/com/example/rag/ingestion/api/DocumentController.java`
- [Ingestion service](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/application/DefaultDocumentIngestionService.java): `src/main/java/com/example/rag/ingestion/application/DefaultDocumentIngestionService.java`
- [Document model](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/domain/document/Document.java): `src/main/java/com/example/rag/ingestion/domain/document/Document.java`
- [Chunk API](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/infrastructure/api/DocumentChunkController.java): `src/main/java/com/example/rag/ingestion/infrastructure/api/DocumentChunkController.java`
- [Chunk service](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/application/chunking/ChunkDocumentService.java): `src/main/java/com/example/rag/ingestion/application/chunking/ChunkDocumentService.java`
- [Document chunker](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/domain/chunking/FixedSizeDocumentChunker.java): `src/main/java/com/example/rag/ingestion/domain/chunking/FixedSizeDocumentChunker.java`
- [Document chunk](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/domain/document/DocumentChunk.java): `src/main/java/com/example/rag/ingestion/domain/document/DocumentChunk.java`
- [Document repository](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/domain/DocumentRepository.java): `src/main/java/com/example/rag/ingestion/domain/DocumentRepository.java`
- [In-memory repository](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/infrastructure/persistence/InMemoryDocumentRepository.java): `src/main/java/com/example/rag/ingestion/infrastructure/persistence/InMemoryDocumentRepository.java`
- [Chunk repository](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/ingestion/domain/chunking/DocumentChunkRepository.java): `src/main/java/com/example/rag/ingestion/domain/chunking/DocumentChunkRepository.java`

### Embedding

- [Chunk embedding use case](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/embedding/application/DefaultEmbedDocumentChunkUseCase.java): `src/main/java/com/example/rag/embedding/application/DefaultEmbedDocumentChunkUseCase.java`
- [Embedding service](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/embedding/application/DefaultEmbeddingService.java): `src/main/java/com/example/rag/embedding/application/DefaultEmbeddingService.java`
- [Embedding provider](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/embedding/application/port/EmbeddingProvider.java): `src/main/java/com/example/rag/embedding/application/port/EmbeddingProvider.java`
- [Local provider](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/embedding/infrastructure/provider/LocalEmbeddingProvider.java): `src/main/java/com/example/rag/embedding/infrastructure/provider/LocalEmbeddingProvider.java`
- [Vector record](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/embedding/domain/VectorRecord.java): `src/main/java/com/example/rag/embedding/domain/VectorRecord.java`

### Application runtime

- [Spring application](https://github.com/sahilbhandare89/high-performance-rag-engine/blob/main/src/main/java/com/example/rag/RagApplication.java): `src/main/java/com/example/rag/RagApplication.java`

### Other components

- **API client**
