# babitasinha/prompt-engineering architecture

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

- Interactive diagram: https://gitdiagram.com/babitasinha/prompt-engineering
- Repository: https://github.com/babitasinha/prompt-engineering

## Overview

This repository is a collection of prompt-engineering lessons and exercises, including introductory notebooks and separate demonstrations of advanced reasoning patterns with Amazon Bedrock. The learner’s intended workflow is to study prompt techniques through the numbered lessons, then explore the focused pattern notebooks. `utils/hints.py` provides exercise hints and solutions. The README is empty, and the available source excerpts do not show notebook execution or imports, so the graph does not assert dependencies between notebooks or between notebooks and the hints module.

Main entry points: [`00_Tutorial_How-To.ipynb`](https://github.com/babitasinha/prompt-engineering/blob/master/00_Tutorial_How-To.ipynb) (Tutorial guide), [`01_Basic_Prompt_Structure.ipynb`](https://github.com/babitasinha/prompt-engineering/blob/master/01_Basic_Prompt_Structure.ipynb) (Prompt structure), [`02_Being_Clear_and_Direct.ipynb`](https://github.com/babitasinha/prompt-engineering/blob/master/02_Being_Clear_and_Direct.ipynb) (Clear instructions), [`03_Assigning_Roles_Role_Prompting.ipynb`](https://github.com/babitasinha/prompt-engineering/blob/master/03_Assigning_Roles_Role_Prompting.ipynb) (Role prompting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lessons["Prompting lessons"]
  node_tutorial["Tutorial guide"]
  node_basic["Prompt structure"]
  node_clear["Clear instructions"]
  node_roles["Role prompting"]
  node_separation["Separate content"]
  node_formatting["Output formatting"]
  node_reasoning["Stepwise thinking"]
  node_examples["Few-shot examples"]
  node_hallucinations["Avoid hallucinations"]
  node_complex["Complex prompts"]
end

subgraph group_patterns["Advanced patterns"]
  node_cot["Chain of thought"]
  node_optimization["Prompt optimization"]
  node_react["ReAct pattern"]
  node_consistency["Consistency and trees"]
end

subgraph group_support["Exercise support"]
  node_hints["Exercise hints<br/>[hints.py]"]
end

node_learner(("Learner"))

node_learner -.->|"studies"| node_tutorial
node_learner -.->|"practices"| node_basic
node_learner -.->|"practices"| node_clear
node_learner -.->|"practices"| node_roles
node_learner -.->|"practices"| node_separation
node_learner -.->|"practices"| node_formatting
node_learner -.->|"practices"| node_reasoning
node_learner -.->|"practices"| node_examples
node_learner -.->|"practices"| node_hallucinations
node_learner -.->|"practices"| node_complex
node_learner -.->|"explores"| node_cot
node_learner -.->|"explores"| node_optimization
node_learner -.->|"explores"| node_react
node_learner -.->|"explores"| node_consistency

click node_tutorial "https://github.com/babitasinha/prompt-engineering/blob/master/00_Tutorial_How-To.ipynb"
click node_basic "https://github.com/babitasinha/prompt-engineering/blob/master/01_Basic_Prompt_Structure.ipynb"
click node_clear "https://github.com/babitasinha/prompt-engineering/blob/master/02_Being_Clear_and_Direct.ipynb"
click node_roles "https://github.com/babitasinha/prompt-engineering/blob/master/03_Assigning_Roles_Role_Prompting.ipynb"
click node_separation "https://github.com/babitasinha/prompt-engineering/blob/master/04_Separating_Data_and_Instructions.ipynb"
click node_formatting "https://github.com/babitasinha/prompt-engineering/blob/master/05_Formatting_Output_and_Speaking_for_Claude.ipynb"
click node_reasoning "https://github.com/babitasinha/prompt-engineering/blob/master/06_Precognition_Thinking_Step_by_Step.ipynb"
click node_examples "https://github.com/babitasinha/prompt-engineering/blob/master/07_Using_Examples_Few-Shot_Prompting.ipynb"
click node_hallucinations "https://github.com/babitasinha/prompt-engineering/blob/master/08_Avoiding_Hallucinations.ipynb"
click node_complex "https://github.com/babitasinha/prompt-engineering/blob/master/09_Complex_Prompts_from_Scratch.ipynb"
click node_cot "https://github.com/babitasinha/prompt-engineering/blob/master/chain_of_thought_bedrock.ipynb"
click node_optimization "https://github.com/babitasinha/prompt-engineering/blob/master/prompt_optimization_bedrock.ipynb"
click node_react "https://github.com/babitasinha/prompt-engineering/blob/master/react_pattern_bedrock.ipynb"
click node_consistency "https://github.com/babitasinha/prompt-engineering/blob/master/self_consistency_and_tot.ipynb"
click node_hints "https://github.com/babitasinha/prompt-engineering/blob/master/utils/hints.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_tutorial,node_basic,node_clear,node_roles,node_separation,node_formatting,node_reasoning,node_examples,node_hallucinations,node_complex toneBlue
class node_cot,node_optimization,node_react,node_consistency toneAmber
class node_hints toneMint
class node_learner toneIndigo
```

## Components

### Prompting lessons

- [Tutorial guide](https://github.com/babitasinha/prompt-engineering/blob/master/00_Tutorial_How-To.ipynb): `00_Tutorial_How-To.ipynb`
- [Prompt structure](https://github.com/babitasinha/prompt-engineering/blob/master/01_Basic_Prompt_Structure.ipynb): `01_Basic_Prompt_Structure.ipynb`
- [Clear instructions](https://github.com/babitasinha/prompt-engineering/blob/master/02_Being_Clear_and_Direct.ipynb): `02_Being_Clear_and_Direct.ipynb`
- [Role prompting](https://github.com/babitasinha/prompt-engineering/blob/master/03_Assigning_Roles_Role_Prompting.ipynb): `03_Assigning_Roles_Role_Prompting.ipynb`
- [Separate content](https://github.com/babitasinha/prompt-engineering/blob/master/04_Separating_Data_and_Instructions.ipynb): `04_Separating_Data_and_Instructions.ipynb`
- [Output formatting](https://github.com/babitasinha/prompt-engineering/blob/master/05_Formatting_Output_and_Speaking_for_Claude.ipynb): `05_Formatting_Output_and_Speaking_for_Claude.ipynb`
- [Stepwise thinking](https://github.com/babitasinha/prompt-engineering/blob/master/06_Precognition_Thinking_Step_by_Step.ipynb): `06_Precognition_Thinking_Step_by_Step.ipynb`
- [Few-shot examples](https://github.com/babitasinha/prompt-engineering/blob/master/07_Using_Examples_Few-Shot_Prompting.ipynb): `07_Using_Examples_Few-Shot_Prompting.ipynb`
- [Avoid hallucinations](https://github.com/babitasinha/prompt-engineering/blob/master/08_Avoiding_Hallucinations.ipynb): `08_Avoiding_Hallucinations.ipynb`
- [Complex prompts](https://github.com/babitasinha/prompt-engineering/blob/master/09_Complex_Prompts_from_Scratch.ipynb): `09_Complex_Prompts_from_Scratch.ipynb`

### Advanced patterns

- [Chain of thought](https://github.com/babitasinha/prompt-engineering/blob/master/chain_of_thought_bedrock.ipynb): `chain_of_thought_bedrock.ipynb`
- [Prompt optimization](https://github.com/babitasinha/prompt-engineering/blob/master/prompt_optimization_bedrock.ipynb): `prompt_optimization_bedrock.ipynb`
- [ReAct pattern](https://github.com/babitasinha/prompt-engineering/blob/master/react_pattern_bedrock.ipynb): `react_pattern_bedrock.ipynb`
- [Consistency and trees](https://github.com/babitasinha/prompt-engineering/blob/master/self_consistency_and_tot.ipynb): `self_consistency_and_tot.ipynb`

### Exercise support

- [Exercise hints](https://github.com/babitasinha/prompt-engineering/blob/master/utils/hints.py): `utils/hints.py`

### Other components

- **Learner**

## Connections

- Learner → Tutorial guide: studies
- Learner → Prompt structure: practices
- Learner → Clear instructions: practices
- Learner → Role prompting: practices
- Learner → Separate content: practices
- Learner → Output formatting: practices
- Learner → Stepwise thinking: practices
- Learner → Few-shot examples: practices
- Learner → Avoid hallucinations: practices
- Learner → Complex prompts: practices
- Learner → Chain of thought: explores
- Learner → Prompt optimization: explores
- Learner → ReAct pattern: explores
- Learner → Consistency and trees: explores
