# deleciagonsalves/rbi-policy-brief-llm architecture

> Architecture diagram of the GitHub repository deleciagonsalves/rbi-policy-brief-llm, 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/deleciagonsalves/rbi-policy-brief-llm
- Repository: https://github.com/deleciagonsalves/rbi-policy-brief-llm

## Overview

This notebook implements a policy-brief workflow: a user supplies an RBI PDF, its text is chunked, and an open instruction-tuned model produces a map-reduce brief. It also compares basic and structured prompts, then checks numbers in the outputs against the source text. The README documents these relationships; no notebook source excerpts were provided, so the graph does not claim details beyond that documentation.

Main entry points: [`RBI_Policy_Brief_LLM_Generator (1).ipynb`](https://github.com/deleciagonsalves/rbi-policy-brief-llm/blob/main/RBI_Policy_Brief_LLM_Generator%20(1).ipynb) (Map-reduce brief)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_document_prep["Document preparation"]
  node_pdf_chunking["PDF text chunking"]
end

subgraph group_briefing["LLM briefing"]
  node_llm["Qwen2.5 model"]
  node_map_reduce["Map-reduce brief"]
  node_prompt_comparison["Prompt comparison"]
end

subgraph group_verification["Output verification"]
  node_number_check["Number hallucination check"]
end

node_user(("User"))
node_policy_pdf["RBI policy PDF"]

node_user -->|"uploads"| node_policy_pdf
node_policy_pdf -->|"extracts and chunks"| node_pdf_chunking
node_pdf_chunking -->|"summarizes chunks"| node_map_reduce
node_llm -->|"generates notes"| node_map_reduce
node_llm -->|"answers prompts"| node_prompt_comparison
node_policy_pdf -->|"provides source text"| node_number_check
node_map_reduce -->|"checks brief numbers"| node_number_check
node_prompt_comparison -->|"checks answer numbers"| node_number_check

click node_pdf_chunking "https://github.com/deleciagonsalves/rbi-policy-brief-llm/blob/main/RBI_Policy_Brief_LLM_Generator%20(1).ipynb"
click node_map_reduce "https://github.com/deleciagonsalves/rbi-policy-brief-llm/blob/main/RBI_Policy_Brief_LLM_Generator%20(1).ipynb"
click node_prompt_comparison "https://github.com/deleciagonsalves/rbi-policy-brief-llm/blob/main/RBI_Policy_Brief_LLM_Generator%20(1).ipynb"
click node_number_check "https://github.com/deleciagonsalves/rbi-policy-brief-llm/blob/main/RBI_Policy_Brief_LLM_Generator%20(1).ipynb"

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_pdf_chunking,node_user toneBlue
class node_llm,node_map_reduce,node_prompt_comparison toneAmber
class node_number_check toneMint
class node_policy_pdf toneIndigo
```

## Components

### Document preparation

- [PDF text chunking](https://github.com/deleciagonsalves/rbi-policy-brief-llm/blob/main/RBI_Policy_Brief_LLM_Generator%20(1).ipynb): `RBI_Policy_Brief_LLM_Generator (1).ipynb`

### LLM briefing

- **Qwen2.5 model**
- [Map-reduce brief](https://github.com/deleciagonsalves/rbi-policy-brief-llm/blob/main/RBI_Policy_Brief_LLM_Generator%20(1).ipynb): `RBI_Policy_Brief_LLM_Generator (1).ipynb`
- [Prompt comparison](https://github.com/deleciagonsalves/rbi-policy-brief-llm/blob/main/RBI_Policy_Brief_LLM_Generator%20(1).ipynb): `RBI_Policy_Brief_LLM_Generator (1).ipynb`

### Output verification

- [Number hallucination check](https://github.com/deleciagonsalves/rbi-policy-brief-llm/blob/main/RBI_Policy_Brief_LLM_Generator%20(1).ipynb): `RBI_Policy_Brief_LLM_Generator (1).ipynb`

### Other components

- **User**
- **RBI policy PDF**

## Connections

- User → RBI policy PDF: uploads (evidence: `README.md`)
- RBI policy PDF → PDF text chunking: extracts and chunks (evidence: `README.md`)
- PDF text chunking → Map-reduce brief: summarizes chunks (evidence: `README.md`)
- Qwen2.5 model → Map-reduce brief: generates notes (evidence: `README.md`)
- Qwen2.5 model → Prompt comparison: answers prompts (evidence: `README.md`)
- RBI policy PDF → Number hallucination check: provides source text (evidence: `README.md`)
- Map-reduce brief → Number hallucination check: checks brief numbers (evidence: `README.md`)
- Prompt comparison → Number hallucination check: checks answer numbers (evidence: `README.md`)
