# calmrocks/ai-engineer-notebooks architecture

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

- Interactive diagram: https://gitdiagram.com/calmrocks/ai-engineer-notebooks
- Repository: https://github.com/calmrocks/ai-engineer-notebooks

## Overview

This repository is a hands-on AI-engineering curriculum: learners progress through runnable notebooks, building understanding of model APIs, retrieval, agents, evaluation, and production concerns, then apply those skills in case studies. The shared `aien` package only centralizes Groq credential loading and client setup. The README documents the learning order and major topics; notebook internals were not sampled, so the graph represents documented curriculum progression rather than unverified runtime calls.

Main entry points: [`00-setup/00-environment.ipynb`](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/00-setup/00-environment.ipynb) (Environment setup), [`01-model-apis/00-prompting-basics.ipynb`](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/01-model-apis/00-prompting-basics.ipynb) (Prompting), [`01-model-apis/01-structured-output.ipynb`](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/01-model-apis/01-structured-output.ipynb) (Structured output), [`01-model-apis/02-tool-calling.ipynb`](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/01-model-apis/02-tool-calling.ipynb) (Tool calling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundations["Foundations"]
  node_setup["Environment setup"]
  node_shared_setup["Groq setup helper<br/>[__init__.py]"]
  node_prompting["Prompting"]
  node_structured["Structured output"]
  node_tools["Tool calling"]
  node_streaming["Streaming<br/>[03-streaming.ipynb]"]
  node_context["Context and caching"]
end

subgraph group_rag["Retrieval"]
  node_rag_intro["RAG fundamentals"]
  node_retrieval["Embedding retrieval"]
  node_hybrid["Hybrid retrieval"]
  node_chunking["Chunking<br/>[03-chunking.ipynb]"]
  node_rag_failure["RAG diagnosis"]
end

subgraph group_evals["Evaluation"]
  node_eval_basics["Output measurement"]
  node_golden["Golden sets"]
  node_judge["LLM judge"]
  node_regression["Regression evaluation"]
end

subgraph group_agents["Agents"]
  node_agent_loop["Agent loop"]
  node_agent_tools["Agent tool design"]
  node_guardrails["Guardrails and budgets"]
  node_mcp["MCP ecosystem"]
  node_skills["Skills disclosure"]
  node_harness["Harness engineering"]
end

subgraph group_production["Production Practice"]
  node_adaptation["Model adaptation"]
  node_security["Prompt-injection security"]
  node_operations["Observability and reliability"]
  node_serving["Serving and inference"]
  node_system_design["Inference system design"]
  node_customer_craft["Customer discovery"]
  node_case_studies["Applied case studies"]
end

node_learner(("Learner"))

node_learner -->|"starts with"| node_setup
node_setup -->|"continues to"| node_prompting
node_prompting -->|"continues to"| node_structured
node_structured -->|"continues to"| node_tools
node_tools -->|"continues to"| node_streaming
node_streaming -->|"continues to"| node_context
node_context -->|"continues to"| node_eval_basics
node_eval_basics -->|"continues to"| node_rag_intro
node_rag_intro -->|"continues to"| node_retrieval
node_retrieval -->|"continues to"| node_hybrid
node_hybrid -->|"continues to"| node_chunking
node_chunking -->|"continues to"| node_rag_failure
node_rag_failure -->|"continues to"| node_golden
node_golden -->|"continues to"| node_judge
node_judge -->|"continues to"| node_regression
node_regression -->|"continues to"| node_agent_loop
node_agent_loop -->|"continues to"| node_agent_tools
node_agent_tools -->|"continues to"| node_guardrails
node_guardrails -->|"continues to"| node_mcp
node_mcp -->|"continues to"| node_skills
node_skills -->|"continues to"| node_harness
node_harness -->|"continues to"| node_adaptation
node_adaptation -->|"continues to"| node_security
node_security -->|"continues to"| node_operations
node_operations -->|"continues to"| node_serving
node_serving -->|"continues to"| node_system_design
node_system_design -->|"continues to"| node_customer_craft
node_customer_craft -->|"applies skills"| node_case_studies

click node_setup "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/00-setup/00-environment.ipynb"
click node_shared_setup "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/aien/__init__.py"
click node_prompting "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/01-model-apis/00-prompting-basics.ipynb"
click node_structured "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/01-model-apis/01-structured-output.ipynb"
click node_tools "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/01-model-apis/02-tool-calling.ipynb"
click node_streaming "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/01-model-apis/03-streaming.ipynb"
click node_context "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/01-model-apis/04-context-and-caching.ipynb"
click node_rag_intro "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/03-rag/00-what-is-rag.ipynb"
click node_retrieval "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/03-rag/01-embeddings-retrieval.ipynb"
click node_hybrid "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/03-rag/02-hybrid-and-reranking.ipynb"
click node_chunking "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/03-rag/03-chunking.ipynb"
click node_rag_failure "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/03-rag/04-why-rag-fails.ipynb"
click node_eval_basics "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/02-evals-basics/01-measuring-outputs.ipynb"
click node_golden "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/04-evals/01-golden-sets.ipynb"
click node_judge "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/04-evals/02-llm-as-judge.ipynb"
click node_regression "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/04-evals/03-regression-evals.ipynb"
click node_agent_loop "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/05-agents/01-agent-loop-from-scratch.ipynb"
click node_agent_tools "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/05-agents/02-tool-design.ipynb"
click node_guardrails "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/05-agents/03-guardrails-and-budgets.ipynb"
click node_mcp "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/05-agents/04-mcp-and-the-tool-ecosystem.ipynb"
click node_skills "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/05-agents/05-skills-and-progressive-disclosure.ipynb"
click node_harness "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/05-agents/06-harness-engineering.ipynb"
click node_adaptation "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/06-adaptation/01-fine-tune-vs-rag-vs-prompt.ipynb"
click node_security "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/07-security/01-prompt-injection-and-trust.ipynb"
click node_operations "https://github.com/calmrocks/ai-engineer-notebooks/tree/main/08-operations"
click node_serving "https://github.com/calmrocks/ai-engineer-notebooks/tree/main/09-serving-inference"
click node_system_design "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/10-ml-system-design/01-designing-an-inference-service.ipynb"
click node_customer_craft "https://github.com/calmrocks/ai-engineer-notebooks/blob/main/11-customer-craft/01-scoping-and-discovery.ipynb"
click node_case_studies "https://github.com/calmrocks/ai-engineer-notebooks/tree/main/12-case-studies-and-capstone"

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_setup,node_shared_setup,node_prompting,node_structured,node_tools,node_streaming,node_context toneBlue
class node_rag_intro,node_retrieval,node_hybrid,node_chunking,node_rag_failure toneAmber
class node_eval_basics,node_golden,node_judge,node_regression toneMint
class node_agent_loop,node_agent_tools,node_guardrails,node_mcp,node_skills,node_harness toneRose
class node_adaptation,node_security,node_operations,node_serving,node_system_design,node_customer_craft,node_case_studies,node_learner toneIndigo
```

## Components

### Foundations

- [Environment setup](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/00-setup/00-environment.ipynb): `00-setup/00-environment.ipynb`
- [Groq setup helper](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/aien/__init__.py): `aien/__init__.py`
- [Prompting](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/01-model-apis/00-prompting-basics.ipynb): `01-model-apis/00-prompting-basics.ipynb`
- [Structured output](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/01-model-apis/01-structured-output.ipynb): `01-model-apis/01-structured-output.ipynb`
- [Tool calling](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/01-model-apis/02-tool-calling.ipynb): `01-model-apis/02-tool-calling.ipynb`
- [Streaming](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/01-model-apis/03-streaming.ipynb): `01-model-apis/03-streaming.ipynb`
- [Context and caching](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/01-model-apis/04-context-and-caching.ipynb): `01-model-apis/04-context-and-caching.ipynb`

### Retrieval

- [RAG fundamentals](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/03-rag/00-what-is-rag.ipynb): `03-rag/00-what-is-rag.ipynb`
- [Embedding retrieval](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/03-rag/01-embeddings-retrieval.ipynb): `03-rag/01-embeddings-retrieval.ipynb`
- [Hybrid retrieval](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/03-rag/02-hybrid-and-reranking.ipynb): `03-rag/02-hybrid-and-reranking.ipynb`
- [Chunking](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/03-rag/03-chunking.ipynb): `03-rag/03-chunking.ipynb`
- [RAG diagnosis](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/03-rag/04-why-rag-fails.ipynb): `03-rag/04-why-rag-fails.ipynb`

### Evaluation

- [Output measurement](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/02-evals-basics/01-measuring-outputs.ipynb): `02-evals-basics/01-measuring-outputs.ipynb`
- [Golden sets](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/04-evals/01-golden-sets.ipynb): `04-evals/01-golden-sets.ipynb`
- [LLM judge](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/04-evals/02-llm-as-judge.ipynb): `04-evals/02-llm-as-judge.ipynb`
- [Regression evaluation](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/04-evals/03-regression-evals.ipynb): `04-evals/03-regression-evals.ipynb`

### Agents

- [Agent loop](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/05-agents/01-agent-loop-from-scratch.ipynb): `05-agents/01-agent-loop-from-scratch.ipynb`
- [Agent tool design](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/05-agents/02-tool-design.ipynb): `05-agents/02-tool-design.ipynb`
- [Guardrails and budgets](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/05-agents/03-guardrails-and-budgets.ipynb): `05-agents/03-guardrails-and-budgets.ipynb`
- [MCP ecosystem](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/05-agents/04-mcp-and-the-tool-ecosystem.ipynb): `05-agents/04-mcp-and-the-tool-ecosystem.ipynb`
- [Skills disclosure](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/05-agents/05-skills-and-progressive-disclosure.ipynb): `05-agents/05-skills-and-progressive-disclosure.ipynb`
- [Harness engineering](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/05-agents/06-harness-engineering.ipynb): `05-agents/06-harness-engineering.ipynb`

### Production Practice

- [Model adaptation](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/06-adaptation/01-fine-tune-vs-rag-vs-prompt.ipynb): `06-adaptation/01-fine-tune-vs-rag-vs-prompt.ipynb`
- [Prompt-injection security](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/07-security/01-prompt-injection-and-trust.ipynb): `07-security/01-prompt-injection-and-trust.ipynb`
- [Observability and reliability](https://github.com/calmrocks/ai-engineer-notebooks/tree/main/08-operations): `08-operations`
- [Serving and inference](https://github.com/calmrocks/ai-engineer-notebooks/tree/main/09-serving-inference): `09-serving-inference`
- [Inference system design](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/10-ml-system-design/01-designing-an-inference-service.ipynb): `10-ml-system-design/01-designing-an-inference-service.ipynb`
- [Customer discovery](https://github.com/calmrocks/ai-engineer-notebooks/blob/main/11-customer-craft/01-scoping-and-discovery.ipynb): `11-customer-craft/01-scoping-and-discovery.ipynb`
- [Applied case studies](https://github.com/calmrocks/ai-engineer-notebooks/tree/main/12-case-studies-and-capstone): `12-case-studies-and-capstone`

### Other components

- **Learner**

## Connections

- Learner → Environment setup: starts with (evidence: `README.md`)
- Environment setup → Prompting: continues to (evidence: `README.md`)
- Prompting → Structured output: continues to (evidence: `README.md`)
- Structured output → Tool calling: continues to (evidence: `README.md`)
- Tool calling → Streaming: continues to (evidence: `README.md`)
- Streaming → Context and caching: continues to (evidence: `README.md`)
- Context and caching → Output measurement: continues to (evidence: `README.md`)
- Output measurement → RAG fundamentals: continues to (evidence: `README.md`)
- RAG fundamentals → Embedding retrieval: continues to (evidence: `README.md`)
- Embedding retrieval → Hybrid retrieval: continues to (evidence: `README.md`)
- Hybrid retrieval → Chunking: continues to (evidence: `README.md`)
- Chunking → RAG diagnosis: continues to (evidence: `README.md`)
- RAG diagnosis → Golden sets: continues to (evidence: `README.md`)
- Golden sets → LLM judge: continues to (evidence: `README.md`)
- LLM judge → Regression evaluation: continues to (evidence: `README.md`)
- Regression evaluation → Agent loop: continues to (evidence: `README.md`)
- Agent loop → Agent tool design: continues to (evidence: `README.md`)
- Agent tool design → Guardrails and budgets: continues to (evidence: `README.md`)
- Guardrails and budgets → MCP ecosystem: continues to (evidence: `README.md`)
- MCP ecosystem → Skills disclosure: continues to (evidence: `README.md`)
- Skills disclosure → Harness engineering: continues to (evidence: `README.md`)
- Harness engineering → Model adaptation: continues to (evidence: `README.md`)
- Model adaptation → Prompt-injection security: continues to (evidence: `README.md`)
- Prompt-injection security → Observability and reliability: continues to (evidence: `README.md`)
- Observability and reliability → Serving and inference: continues to (evidence: `README.md`)
- Serving and inference → Inference system design: continues to (evidence: `README.md`)
- Inference system design → Customer discovery: continues to (evidence: `README.md`)
- Customer discovery → Applied case studies: applies skills (evidence: `README.md`)
