# harshilkatharva/genai-engineer-journey architecture

> Architecture diagram of the GitHub repository harshilkatharva/genai-engineer-journey, 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/harshilkatharva/genai-engineer-journey
- Repository: https://github.com/harshilkatharva/genai-engineer-journey

## Overview

This repository is a staged Python curriculum for building LLM applications, rather than one single runtime product. Its later modules culminate in a RAG application with indexing, retrieval, generation, and LangChain-oriented structured-output features. The tree supports these capability areas, but the README is empty and sampled implementation is limited to embedding and query management; other connections are intentionally left unspecified.

Main entry points: [`module-10-langchain/src/rag_app/query/query_manager.py`](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/query/query_manager.py) (Query manager), [`module-10-langchain/src/rag_app/embedding/embedding_manager.py`](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/embedding/embedding_manager.py) (Embedding manager), [`module-10-langchain/src/rag_app/api/app.py`](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/api/app.py) (API application), [`module-10-langchain/src/rag_app/query/techniques/query_expansion.py`](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/query/techniques/query_expansion.py) (Query expansion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_rag["RAG application"]
  node_app["API application<br/>[app.py]"]
  node_ragroute["RAG route<br/>[rag.py]"]
  node_indexroute["Index route<br/>[index.py]"]
  node_upsertroute["Upsert route<br/>[upsert.py]"]
  node_retrieveroute["Retrieve route<br/>[retrive.py]"]
  node_evalroute["Evaluation route<br/>[evalution.py]"]
end

subgraph group_index["Indexing"]
  node_indexsvc["Index services<br/>[index_services.py]"]
  node_upsertsvc["Upsert services<br/>[upsert_services.py]"]
  node_chunking["Chunking"]
  node_embeddings["Embedding manager"]
  node_vectordb[("Vector database<br/>[index_db.py]")]
end

subgraph group_retrieval["Query and retrieval"]
  node_retrievalsvc["Retrieval services"]
  node_querymgr["Query manager<br/>[query_manager.py]"]
  node_expansion["Query expansion<br/>[query_expansion.py]"]
  node_hyde["HyDE query<br/>[query_hyde.py]"]
  node_retriever["Retriever manager"]
  node_candidates["Candidate search<br/>[hybrid_search.py]"]
  node_reranker["Cross-encoder reranker"]
end

subgraph group_generation["Generation features"]
  node_ragchat["RAG chat<br/>[rag_chat.py]"]
  node_langchainchat["LangChain chat"]
  node_classification["Classification"]
  node_extraction["Extraction<br/>[rag_extraction.py]"]
  node_llmservices["LLM services<br/>[llm_services.py]"]
  node_providers["LLM providers<br/>[llm_provider.py]"]
end

subgraph group_operations["Operations"]
  node_evaluation["Evaluation reports<br/>[report.py]"]
  node_history["Redis history<br/>[redis_history.py]"]
  node_observability["Observability<br/>[metrics.py]"]
end

node_user(("API caller"))
node_embedmodel["SentenceTransformer"]

node_user -->|"sends requests"| node_app
node_querymgr -->|"dispatches query"| node_expansion
node_querymgr -->|"dispatches query"| node_hyde
node_embeddings -->|"encodes text"| node_embedmodel

click node_app "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/api/app.py"
click node_ragroute "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/api/routes/rag.py"
click node_indexroute "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/api/routes/index.py"
click node_upsertroute "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/api/routes/upsert.py"
click node_retrieveroute "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/api/routes/retrive.py"
click node_evalroute "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/api/routes/evalution.py"
click node_indexsvc "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/services/index_services.py"
click node_upsertsvc "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/services/upsert_services.py"
click node_chunking "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/chunking/chunking_manager.py"
click node_embeddings "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/embedding/embedding_manager.py"
click node_vectordb "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/db/index_db.py"
click node_retrievalsvc "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/services/retrive_services.py"
click node_querymgr "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/query/query_manager.py"
click node_expansion "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/query/techniques/query_expansion.py"
click node_hyde "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/query/techniques/query_hyde.py"
click node_retriever "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/retrieval/retriver_manager.py"
click node_candidates "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/retrieval/candidate/hybrid_search.py"
click node_reranker "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/retrieval/re_ranker/cross_encoder_reranker.py"
click node_ragchat "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/features/rag_chat.py"
click node_langchainchat "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/features/rag_chat_langchain.py"
click node_classification "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/features/rag_classification.py"
click node_extraction "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/features/rag_extraction.py"
click node_llmservices "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/services/llm_services.py"
click node_providers "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/providers/llm_provider.py"
click node_evaluation "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/evalution/report.py"
click node_history "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/services/redis_history.py"
click node_observability "https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/observability/metrics.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_app,node_ragroute,node_indexroute,node_upsertroute,node_retrieveroute,node_evalroute toneBlue
class node_indexsvc,node_upsertsvc,node_chunking,node_embeddings,node_vectordb toneAmber
class node_retrievalsvc,node_querymgr,node_expansion,node_hyde,node_retriever,node_candidates,node_reranker,node_user toneMint
class node_ragchat,node_langchainchat,node_classification,node_extraction,node_llmservices,node_providers toneRose
class node_evaluation,node_history,node_observability,node_embedmodel toneIndigo
```

## Components

### RAG application

- [API application](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/api/app.py): `module-10-langchain/src/rag_app/api/app.py`
- [RAG route](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/api/routes/rag.py): `module-10-langchain/src/rag_app/api/routes/rag.py`
- [Index route](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/api/routes/index.py): `module-10-langchain/src/rag_app/api/routes/index.py`
- [Upsert route](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/api/routes/upsert.py): `module-10-langchain/src/rag_app/api/routes/upsert.py`
- [Retrieve route](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/api/routes/retrive.py): `module-10-langchain/src/rag_app/api/routes/retrive.py`
- [Evaluation route](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/api/routes/evalution.py): `module-10-langchain/src/rag_app/api/routes/evalution.py`

### Indexing

- [Index services](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/services/index_services.py): `module-10-langchain/src/rag_app/services/index_services.py`
- [Upsert services](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/services/upsert_services.py): `module-10-langchain/src/rag_app/services/upsert_services.py`
- [Chunking](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/chunking/chunking_manager.py): `module-10-langchain/src/rag_app/chunking/chunking_manager.py`
- [Embedding manager](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/embedding/embedding_manager.py): `module-10-langchain/src/rag_app/embedding/embedding_manager.py`
- [Vector database](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/db/index_db.py): `module-10-langchain/src/rag_app/db/index_db.py`

### Query and retrieval

- [Retrieval services](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/services/retrive_services.py): `module-10-langchain/src/rag_app/services/retrive_services.py`
- [Query manager](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/query/query_manager.py): `module-10-langchain/src/rag_app/query/query_manager.py`
- [Query expansion](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/query/techniques/query_expansion.py): `module-10-langchain/src/rag_app/query/techniques/query_expansion.py`
- [HyDE query](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/query/techniques/query_hyde.py): `module-10-langchain/src/rag_app/query/techniques/query_hyde.py`
- [Retriever manager](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/retrieval/retriver_manager.py): `module-10-langchain/src/rag_app/retrieval/retriver_manager.py`
- [Candidate search](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/retrieval/candidate/hybrid_search.py): `module-10-langchain/src/rag_app/retrieval/candidate/hybrid_search.py`
- [Cross-encoder reranker](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/retrieval/re_ranker/cross_encoder_reranker.py): `module-10-langchain/src/rag_app/retrieval/re_ranker/cross_encoder_reranker.py`

### Generation features

- [RAG chat](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/features/rag_chat.py): `module-10-langchain/src/rag_app/features/rag_chat.py`
- [LangChain chat](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/features/rag_chat_langchain.py): `module-10-langchain/src/rag_app/features/rag_chat_langchain.py`
- [Classification](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/features/rag_classification.py): `module-10-langchain/src/rag_app/features/rag_classification.py`
- [Extraction](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/features/rag_extraction.py): `module-10-langchain/src/rag_app/features/rag_extraction.py`
- [LLM services](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/services/llm_services.py): `module-10-langchain/src/rag_app/services/llm_services.py`
- [LLM providers](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/providers/llm_provider.py): `module-10-langchain/src/rag_app/providers/llm_provider.py`

### Operations

- [Evaluation reports](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/evalution/report.py): `module-10-langchain/src/rag_app/evalution/report.py`
- [Redis history](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/services/redis_history.py): `module-10-langchain/src/rag_app/services/redis_history.py`
- [Observability](https://github.com/harshilkatharva/genai-engineer-journey/blob/main/module-10-langchain/src/rag_app/observability/metrics.py): `module-10-langchain/src/rag_app/observability/metrics.py`

### Other components

- **API caller**
- **SentenceTransformer**

## Connections

- API caller → API application: sends requests
- Query manager → Query expansion: dispatches query
- Query manager → HyDE query: dispatches query
- Embedding manager → SentenceTransformer: encodes text
