# tomdevtech/localragpipelinemodular architecture

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

- Interactive diagram: https://gitdiagram.com/tomdevtech/localragpipelinemodular
- Repository: https://github.com/tomdevtech/localragpipelinemodular

## Overview

This is a local restaurant-review RAG application: the CLI loads and indexes review CSVs, then accepts questions, retrieves relevant chunks, optionally reranks them, and supplies context to an Ollama LLM for an answer. Chunking is a configurable family of strategies; retrieval persists vectors in Chroma. The graph follows the shown CLI and pipeline calls. The README documents interactive querying and YAML configuration; unsampled strategy implementations are represented by their exact paths, without inferring their internal calls.

Main entry points: [`src/chunking/strategies.py`](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/strategies.py) (Chunker factory), [`src/pipeline.py`](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/pipeline.py) (RAG pipeline), [`src/main.py`](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/main.py) (CLI), [`src/retrieval/retriever.py`](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/retrieval/retriever.py) (Vector retriever)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Ingestion and chunking"]
  node_loader["Review CSV loader<br/>[loaders.py]"]
  node_factory["Chunker factory<br/>[strategies.py]"]
  node_chunkbase["Chunker interface<br/>[base.py]"]
  node_fixed["Fixed-size chunker<br/>[fixed_size.py]"]
  node_recursive["Recursive chunker<br/>[recursive.py]"]
  node_document["Document chunker<br/>[document.py]"]
  node_semantic["Semantic chunker<br/>[semantic.py]"]
  node_propositional["Propositional chunker<br/>[propositional.py]"]
  node_agentic["Agentic chunker<br/>[agentic.py]"]
  node_chunkutils["Sentence utilities<br/>[utils.py]"]
end

subgraph group_query["Query services"]
  node_retriever["Vector retriever<br/>[retriever.py]"]
  node_reranker["Embedding reranker<br/>[reranker.py]"]
  node_chroma[("Chroma store")]
end

subgraph group_runtime["Application runtime"]
  node_cli["CLI<br/>[main.py]"]
  node_pipeline["RAG pipeline<br/>[pipeline.py]"]
end

subgraph group_config["Configuration"]
  node_settings["Settings<br/>[settings.py]"]
end

node_user(("User"))
node_csv["Review CSV"]
node_ollamaembed["Ollama embeddings"]
node_ollamallm["Ollama LLM"]
node_answer["Generated answer"]

node_user -->|"asks question"| node_cli
node_cli -->|"loads settings"| node_settings
node_cli -->|"loads CSV"| node_loader
node_csv -->|"provides rows"| node_loader
node_cli -->|"indexes and queries"| node_pipeline
node_pipeline -->|"reads options"| node_settings
node_pipeline -->|"selects chunker"| node_factory
node_factory -->|"dispatches to"| node_fixed
node_factory -->|"dispatches to"| node_recursive
node_factory -->|"dispatches to"| node_document
node_factory -->|"dispatches to"| node_semantic
node_factory -->|"dispatches to"| node_propositional
node_factory -->|"dispatches to"| node_agentic
node_pipeline -->|"indexes chunks"| node_retriever
node_loader -->|"provides documents"| node_pipeline
node_pipeline -->|"searches query"| node_retriever
node_pipeline -->|"reranks candidates"| node_reranker
node_retriever -->|"reads and writes"| node_chroma
node_retriever -->|"embeds documents"| node_ollamaembed
node_reranker -->|"embeds candidates"| node_ollamaembed
node_semantic -->|"embeds sentences"| node_ollamaembed
node_semantic -->|"splits sentences"| node_chunkutils
node_propositional -->|"splits sentences"| node_chunkutils
node_cli -->|"generates answer"| node_ollamallm
node_cli -->|"prints answer"| node_answer

click node_cli "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/main.py"
click node_loader "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/loaders.py"
click node_csv "https://github.com/tomdevtech/localragpipelinemodular/blob/main/data/realistic_restaurent_reviews.csv"
click node_pipeline "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/pipeline.py"
click node_settings "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/config/settings.py"
click node_factory "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/strategies.py"
click node_chunkbase "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/base.py"
click node_fixed "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/fixed_size.py"
click node_recursive "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/recursive.py"
click node_document "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/document.py"
click node_semantic "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/semantic.py"
click node_propositional "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/propositional.py"
click node_agentic "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/agentic.py"
click node_chunkutils "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/utils.py"
click node_retriever "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/retrieval/retriever.py"
click node_reranker "https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/reranking/reranker.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_loader,node_factory,node_chunkbase,node_fixed,node_recursive,node_document,node_semantic,node_propositional,node_agentic,node_chunkutils,node_user,node_csv toneBlue
class node_retriever,node_reranker,node_chroma toneAmber
class node_cli,node_pipeline toneMint
class node_settings toneRose
class node_ollamaembed,node_ollamallm,node_answer toneIndigo
```

## Components

### Ingestion and chunking

- [Review CSV loader](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/loaders.py): `src/loaders.py`
- [Chunker factory](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/strategies.py): `src/chunking/strategies.py`
- [Chunker interface](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/base.py): `src/chunking/base.py`
- [Fixed-size chunker](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/fixed_size.py): `src/chunking/fixed_size.py`
- [Recursive chunker](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/recursive.py): `src/chunking/recursive.py`
- [Document chunker](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/document.py): `src/chunking/document.py`
- [Semantic chunker](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/semantic.py): `src/chunking/semantic.py`
- [Propositional chunker](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/propositional.py): `src/chunking/propositional.py`
- [Agentic chunker](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/agentic.py): `src/chunking/agentic.py`
- [Sentence utilities](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/chunking/utils.py): `src/chunking/utils.py`

### Query services

- [Vector retriever](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/retrieval/retriever.py): `src/retrieval/retriever.py`
- [Embedding reranker](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/reranking/reranker.py): `src/reranking/reranker.py`
- **Chroma store**

### Application runtime

- [CLI](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/main.py): `src/main.py`
- [RAG pipeline](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/pipeline.py): `src/pipeline.py`

### Configuration

- [Settings](https://github.com/tomdevtech/localragpipelinemodular/blob/main/src/config/settings.py): `src/config/settings.py`

### Other components

- **User**
- [Review CSV](https://github.com/tomdevtech/localragpipelinemodular/blob/main/data/realistic_restaurent_reviews.csv): `data/realistic_restaurent_reviews.csv`
- **Ollama embeddings**
- **Ollama LLM**
- **Generated answer**

## Connections

- User → CLI: asks question (evidence: `README.md`)
- CLI → Settings: loads settings (evidence: `src/main.py`)
- CLI → Review CSV loader: loads CSV (evidence: `src/main.py`)
- Review CSV → Review CSV loader: provides rows (evidence: `src/loaders.py`)
- CLI → RAG pipeline: indexes and queries (evidence: `src/main.py`)
- RAG pipeline → Settings: reads options (evidence: `src/pipeline.py`)
- RAG pipeline → Chunker factory: selects chunker (evidence: `src/pipeline.py`)
- Chunker factory → Fixed-size chunker: dispatches to (evidence: `src/chunking/strategies.py`)
- Chunker factory → Recursive chunker: dispatches to (evidence: `src/chunking/strategies.py`)
- Chunker factory → Document chunker: dispatches to (evidence: `src/chunking/strategies.py`)
- Chunker factory → Semantic chunker: dispatches to (evidence: `src/chunking/strategies.py`)
- Chunker factory → Propositional chunker: dispatches to (evidence: `src/chunking/strategies.py`)
- Chunker factory → Agentic chunker: dispatches to (evidence: `src/chunking/strategies.py`)
- RAG pipeline → Vector retriever: indexes chunks (evidence: `src/pipeline.py`)
- Review CSV loader → RAG pipeline: provides documents (evidence: `src/main.py`)
- RAG pipeline → Vector retriever: searches query (evidence: `src/pipeline.py`)
- RAG pipeline → Embedding reranker: reranks candidates (evidence: `src/pipeline.py`)
- Vector retriever → Chroma store: reads and writes (evidence: `src/retrieval/retriever.py`)
- Vector retriever → Ollama embeddings: embeds documents (evidence: `src/retrieval/retriever.py`)
- Embedding reranker → Ollama embeddings: embeds candidates (evidence: `src/reranking/reranker.py`)
- Semantic chunker → Ollama embeddings: embeds sentences (evidence: `src/chunking/semantic.py`)
- Semantic chunker → Sentence utilities: splits sentences (evidence: `src/chunking/semantic.py`)
- Propositional chunker → Sentence utilities: splits sentences (evidence: `src/chunking/propositional.py`)
- CLI → Ollama LLM: generates answer (evidence: `src/main.py`)
- CLI → Generated answer: prints answer (evidence: `src/main.py`)
