# karthik-56/2-wheeler_guide architecture

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

- Interactive diagram: https://gitdiagram.com/karthik-56/2-wheeler_guide
- Repository: https://github.com/karthik-56/2-wheeler_guide

## Overview

BikeGenie is a small Python two-wheeler advice prototype. Its implemented path loads local guide text, chunks and indexes it, retrieves context for a hardcoded question, routes that question to a prompt chain, and prints the answer. The README describes interactive user input and Streamlit, but the shown UI code is commented out. Bike-site pages are loaded but are not connected to the index or answer chain in the excerpt. The graph reflects these limits rather than implying they contribute to recommendations.

Main entry points: [`guide.py`](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py) (Retrieval chain), [`guide.txt`](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.txt) (Local guide text)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sources["Knowledge sources"]
  node_localguide["Local guide text<br/>[guide.txt]"]
  node_textloader["Text loader<br/>[guide.py]"]
  node_bikepages["Bike listing pages"]
  node_webloaders["Web loaders<br/>[guide.py]"]
end

subgraph group_retrieval["Context retrieval"]
  node_chunking["Text chunking<br/>[guide.py]"]
  node_embeddings["Text embeddings<br/>[guide.py]"]
  node_vectorstore[("Chroma index<br/>[guide.py]")]
  node_retriever["Context retriever<br/>[guide.py]"]
end

subgraph group_generation["Answer generation"]
  node_entry["Question invocation<br/>[guide.py]"]
  node_router["Prompt router<br/>[guide.py]"]
  node_bikeprompts["Bike advice prompts<br/>[guide.py]"]
  node_llmchain["Prompt chains<br/>[guide.py]"]
  node_ollama["Llama 3 model"]
  node_retrievalchain["Retrieval chain<br/>[guide.py]"]
  node_output["Printed answer<br/>[guide.py]"]
end

node_user(("Guide user"))

node_user -.->|"asks question"| node_entry
node_localguide -->|"loads text"| node_textloader
node_bikepages -->|"loads listings"| node_webloaders
node_textloader -->|"splits documents"| node_chunking
node_chunking -->|"embeds chunks"| node_embeddings
node_embeddings -->|"indexes chunks"| node_vectorstore
node_vectorstore -->|"provides search"| node_retriever
node_entry -->|"invokes query"| node_retrievalchain
node_retrievalchain -->|"retrieves context"| node_retriever
node_retrievalchain -->|"routes query"| node_router
node_router -->|"selects prompt"| node_bikeprompts
node_bikeprompts -->|"configures chain"| node_llmchain
node_llmchain -->|"generates response"| node_ollama
node_retrievalchain -->|"prints answer"| node_output

click node_entry "https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py"
click node_localguide "https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.txt"
click node_textloader "https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py"
click node_webloaders "https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py"
click node_chunking "https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py"
click node_embeddings "https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py"
click node_vectorstore "https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py"
click node_retriever "https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py"
click node_router "https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py"
click node_bikeprompts "https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py"
click node_llmchain "https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py"
click node_retrievalchain "https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py"
click node_output "https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.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_localguide,node_textloader,node_bikepages,node_webloaders,node_user toneBlue
class node_chunking,node_embeddings,node_vectorstore,node_retriever toneAmber
class node_entry,node_router,node_bikeprompts,node_llmchain,node_ollama,node_retrievalchain,node_output toneMint
```

## Components

### Knowledge sources

- [Local guide text](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.txt): `guide.txt`
- [Text loader](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py): `guide.py`
- **Bike listing pages**
- [Web loaders](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py): `guide.py`

### Context retrieval

- [Text chunking](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py): `guide.py`
- [Text embeddings](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py): `guide.py`
- [Chroma index](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py): `guide.py`
- [Context retriever](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py): `guide.py`

### Answer generation

- [Question invocation](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py): `guide.py`
- [Prompt router](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py): `guide.py`
- [Bike advice prompts](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py): `guide.py`
- [Prompt chains](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py): `guide.py`
- **Llama 3 model**
- [Retrieval chain](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py): `guide.py`
- [Printed answer](https://github.com/karthik-56/2-wheeler_guide/blob/main/guide.py): `guide.py`

### Other components

- **Guide user**

## Connections

- Guide user → Question invocation: asks question (evidence: `README.md`)
- Local guide text → Text loader: loads text (evidence: `guide.py`)
- Bike listing pages → Web loaders: loads listings (evidence: `guide.py`)
- Text loader → Text chunking: splits documents (evidence: `guide.py`)
- Text chunking → Text embeddings: embeds chunks (evidence: `guide.py`)
- Text embeddings → Chroma index: indexes chunks (evidence: `guide.py`)
- Chroma index → Context retriever: provides search (evidence: `guide.py`)
- Question invocation → Retrieval chain: invokes query (evidence: `guide.py`)
- Retrieval chain → Context retriever: retrieves context (evidence: `guide.py`)
- Retrieval chain → Prompt router: routes query (evidence: `guide.py`)
- Prompt router → Bike advice prompts: selects prompt (evidence: `guide.py`)
- Bike advice prompts → Prompt chains: configures chain (evidence: `guide.py`)
- Prompt chains → Llama 3 model: generates response (evidence: `guide.py`)
- Retrieval chain → Printed answer: prints answer (evidence: `guide.py`)
