# rohitbopche/track-manuals-atlas architecture

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

- Interactive diagram: https://gitdiagram.com/rohitbopche/track-manuals-atlas
- Repository: https://github.com/rohitbopche/track-manuals-atlas

## Overview

Track Manuals Atlas is an offline Indian Railways manuals knowledge base, with cited chat, search, manual browsing, practice cards, and an expert graph workbench. Its user workflow starts with a question or manual-selection task and returns ranked manual passages or answers intended to cite the manual, paragraph, and page; other entry points support browsing, learning, and graph exploration. The repository also contains a substantial extraction and knowledge-graph preparation pipeline. Runtime wiring beyond the README and the shown search CLI/index builder is only partly evidenced, so uncertain links are omitted.

Main entry points: [`lib/rdso_chat.js`](https://github.com/rohitbopche/track-manuals-atlas/blob/main/lib/rdso_chat.js) (Cited chat), [`ui/expert.js`](https://github.com/rohitbopche/track-manuals-atlas/blob/main/ui/expert.js) (Graph workbench), [`scripts/search_cli.js`](https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/search_cli.js) (Search CLI), [`lib/rdso_search.js`](https://github.com/rohitbopche/track-manuals-atlas/blob/main/lib/rdso_search.js) (Manual search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_user_features["User features"]
  node_chat["Cited chat<br/>[rdso_chat.js]"]
  node_browse["Manual browser<br/>[rdso_browse.js]"]
  node_learning["Practice cards<br/>[cards.js]"]
  node_expert["Graph workbench<br/>[expert.js]"]
  node_entity_ui["Entity support<br/>[rdso_entities.js]"]
end

subgraph group_knowledge_data["Knowledge data"]
  node_graph_data["Knowledge graph data<br/>[rdso_kg_data.js]"]
  node_manual_structure["Manual structure"]
  node_content_index["Page evidence index"]
end

subgraph group_knowledge_pipeline["Knowledge pipeline"]
  node_chapter_ingestion["Chapter ingestion"]
  node_clause_parser["Clause parser<br/>[clause_parser.py]"]
  node_canonical_graph["Canonical graph generation"]
  node_hierarchy["Manual hierarchy"]
  node_evidence_render["Evidence rendering<br/>[render_evidence.py]"]
  node_review_packet["Human review packet"]
end

subgraph group_search_runtime["Search runtime"]
  node_search["Manual search<br/>[rdso_search.js]"]
  node_search_cli["Search CLI<br/>[search_cli.js]"]
  node_search_index["Search index<br/>[search_index.js]"]
  node_search_index_builder["Index builder"]
end

node_manual_user(("Manual user"))

node_manual_user -->|"asks questions"| node_chat
node_manual_user -->|"browses manuals"| node_browse
node_manual_user -->|"practices with"| node_learning
node_manual_user -->|"explores graph"| node_expert
node_manual_user -->|"runs query"| node_search_cli
node_search_cli -->|"loads"| node_search_index
node_search_cli -->|"queries"| node_search
node_search_index_builder -->|"uses tokenization"| node_search
node_search_index_builder -->|"writes"| node_search_index
node_chapter_ingestion -->|"imports parser"| node_clause_parser
node_canonical_graph -->|"references"| node_hierarchy
node_review_packet -->|"renders evidence"| node_evidence_render
node_expert -.->|"uses entity support"| node_entity_ui
node_expert -.->|"explores graph data"| node_graph_data
node_browse -.->|"browses structure"| node_manual_structure
node_chat -.->|"retrieves passages"| node_search
node_chat -.->|"supports citations"| node_content_index

click node_chat "https://github.com/rohitbopche/track-manuals-atlas/blob/main/lib/rdso_chat.js"
click node_search "https://github.com/rohitbopche/track-manuals-atlas/blob/main/lib/rdso_search.js"
click node_search_cli "https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/search_cli.js"
click node_browse "https://github.com/rohitbopche/track-manuals-atlas/blob/main/lib/rdso_browse.js"
click node_learning "https://github.com/rohitbopche/track-manuals-atlas/blob/main/data/learning/cards.js"
click node_expert "https://github.com/rohitbopche/track-manuals-atlas/blob/main/ui/expert.js"
click node_entity_ui "https://github.com/rohitbopche/track-manuals-atlas/blob/main/lib/rdso_entities.js"
click node_graph_data "https://github.com/rohitbopche/track-manuals-atlas/blob/main/data/rdso_kg_data.js"
click node_manual_structure "https://github.com/rohitbopche/track-manuals-atlas/blob/main/data/manual_structure.js"
click node_content_index "https://github.com/rohitbopche/track-manuals-atlas/blob/main/data/manual_content_index.js"
click node_search_index "https://github.com/rohitbopche/track-manuals-atlas/blob/main/data/search/search_index.js"
click node_search_index_builder "https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/build_search_index.js"
click node_chapter_ingestion "https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/ingest_all_manual_chapters.py"
click node_clause_parser "https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/clause_parser.py"
click node_canonical_graph "https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/generate_canonical_kg.py"
click node_hierarchy "https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/resolve_manual_hierarchy.py"
click node_evidence_render "https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/render_evidence.py"
click node_review_packet "https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/make_review_packet.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_chat,node_browse,node_learning,node_expert,node_entity_ui,node_manual_user toneBlue
class node_graph_data,node_manual_structure,node_content_index toneAmber
class node_chapter_ingestion,node_clause_parser,node_canonical_graph,node_hierarchy,node_evidence_render,node_review_packet toneMint
class node_search,node_search_cli,node_search_index,node_search_index_builder toneRose
```

## Components

### User features

- [Cited chat](https://github.com/rohitbopche/track-manuals-atlas/blob/main/lib/rdso_chat.js): `lib/rdso_chat.js`
- [Manual browser](https://github.com/rohitbopche/track-manuals-atlas/blob/main/lib/rdso_browse.js): `lib/rdso_browse.js`
- [Practice cards](https://github.com/rohitbopche/track-manuals-atlas/blob/main/data/learning/cards.js): `data/learning/cards.js`
- [Graph workbench](https://github.com/rohitbopche/track-manuals-atlas/blob/main/ui/expert.js): `ui/expert.js`
- [Entity support](https://github.com/rohitbopche/track-manuals-atlas/blob/main/lib/rdso_entities.js): `lib/rdso_entities.js`

### Knowledge data

- [Knowledge graph data](https://github.com/rohitbopche/track-manuals-atlas/blob/main/data/rdso_kg_data.js): `data/rdso_kg_data.js`
- [Manual structure](https://github.com/rohitbopche/track-manuals-atlas/blob/main/data/manual_structure.js): `data/manual_structure.js`
- [Page evidence index](https://github.com/rohitbopche/track-manuals-atlas/blob/main/data/manual_content_index.js): `data/manual_content_index.js`

### Knowledge pipeline

- [Chapter ingestion](https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/ingest_all_manual_chapters.py): `scripts/ingest_all_manual_chapters.py`
- [Clause parser](https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/clause_parser.py): `scripts/clause_parser.py`
- [Canonical graph generation](https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/generate_canonical_kg.py): `scripts/generate_canonical_kg.py`
- [Manual hierarchy](https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/resolve_manual_hierarchy.py): `scripts/resolve_manual_hierarchy.py`
- [Evidence rendering](https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/render_evidence.py): `scripts/render_evidence.py`
- [Human review packet](https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/make_review_packet.py): `scripts/make_review_packet.py`

### Search runtime

- [Manual search](https://github.com/rohitbopche/track-manuals-atlas/blob/main/lib/rdso_search.js): `lib/rdso_search.js`
- [Search CLI](https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/search_cli.js): `scripts/search_cli.js`
- [Search index](https://github.com/rohitbopche/track-manuals-atlas/blob/main/data/search/search_index.js): `data/search/search_index.js`
- [Index builder](https://github.com/rohitbopche/track-manuals-atlas/blob/main/scripts/build_search_index.js): `scripts/build_search_index.js`

### Other components

- **Manual user**

## Connections

- Manual user → Cited chat: asks questions (evidence: `README.md`)
- Manual user → Manual browser: browses manuals (evidence: `README.md`)
- Manual user → Practice cards: practices with (evidence: `README.md`)
- Manual user → Graph workbench: explores graph (evidence: `README.md`)
- Manual user → Search CLI: runs query (evidence: `README.md`)
- Search CLI → Search index: loads (evidence: `scripts/search_cli.js`)
- Search CLI → Manual search: queries (evidence: `scripts/search_cli.js`)
- Index builder → Manual search: uses tokenization (evidence: `scripts/build_search_index.js`)
- Index builder → Search index: writes (evidence: `scripts/build_search_index.js`)
- Chapter ingestion → Clause parser: imports parser (evidence: `scripts/ingest_all_manual_chapters.py`)
- Canonical graph generation → Manual hierarchy: references (evidence: `scripts/generate_canonical_kg.py`)
- Human review packet → Evidence rendering: renders evidence (evidence: `scripts/make_review_packet.py`)
- Graph workbench → Entity support: uses entity support
- Graph workbench → Knowledge graph data: explores graph data
- Manual browser → Manual structure: browses structure
- Cited chat → Manual search: retrieves passages
- Cited chat → Page evidence index: supports citations
