← Back to home

Educational implementation

LangGraph Reference Architectures

Educational implementations of modern agentic design patterns, written with backend instincts around state, side effects, tools, retries, and evaluation.

LangGraph · Python · LLMs · notebooks 2025 GitHub repo ↗

SUMMARY

Twelve LangGraph notebooks implementing agentic LLM architecture patterns with consistent build, run, inspect, and evaluation structure.

Problem

Agentic LLM examples are often scattered, making it hard to compare architecture patterns under one mental model.

What I built

I built twelve Jupyter notebooks tiered from foundational to advanced, each following the same build, run, inspect, and evaluate rhythm.

Architecture / system design

The notebooks explore routing, memory, tool use, parallel calls, recovery, evaluator loops, and dual-model cost/performance tradeoffs.

Failure modes / what broke

The useful failure mode is educational drift: if every pattern is presented differently, learners cannot see the architecture tradeoffs.

Proof / metrics / tests

The original field notes preserve the twelve-pattern list and diagram.

Lessons learned

Reference implementations work best when structure is boring and comparison is easy.

field notes

Expanded field notes

READ THIS WITH BACKEND INSTINCTS

An educational implementation of agent architectures, but written with backend instincts: every notebook asks what state is being passed around, what nodes own which side effects, where retries and tool errors land, and whether a given pattern actually earns its complexity over a single tool call.

Twelve hands-on Jupyter notebooks walking through modern agentic design patterns end-to-end — each built on LangGraph, each running a realistic scenario, each scored at the end. No toy examples; every notebook tells you what the architecture solves, builds it node by node, and measures the result.

The collection spans the full spectrum: foundational patterns like self-critique and ReAct from scratch, intermediate systems like plan-and-execute and supervisor multi-agent, and advanced structures like tree-of-thoughts, hierarchical agents, and LLM-as-a-judge evaluation. Two model tiers underneath: DeepSeek-V3 handles the heavy reasoning, Gemma 2 handles the cheaper steps that don't need a frontier model — both served via Nebius AI Studio.

DESIGN NOTE

Every notebook follows the same six-section format — problem → graph → build → live scenario → eval → when-to-use. That structure isn't decorative; it forces every architecture to confront whether it actually earns its complexity, or whether a single tool call would have been enough.

A typical run, distilled from notebook 03 (ReAct from scratch):

ReAct trace · notebook 03
question: what's the GDP per capita of egypt vs nigeria in 2024?

thought:  i need current GDP/capita figures for both — search.
action:   tavily_search("egypt GDP per capita 2024")
obs:      ~$3,457 USD (world bank, 2024 est.)
thought:  now nigeria.
action:   tavily_search("nigeria GDP per capita 2024")
obs:      ~$1,621 USD (world bank, 2024 est.)
thought:  i have both — compute ratio and answer.
final:    egypt: ~$3,457 · nigeria: ~$1,621
          egypt is ~2.13× higher per capita in 2024.

observability: every step traced in LangSmith
            
Agentic LLM architectures tiered by complexity FOUNDATIONAL self-critique reflection loop gemma 2 tool use parallel calls + recovery deepseek ReAct from scratch deepseek INTERMEDIATE plan & execute decoupled agents deepseek supervisor multi-agent specialist routing deepseek episodic memory vector store (chroma) gemma 2 ADVANCED tree of thoughts branch · score · prune deepseek hierarchical 3-tier control graph deepseek llm-as-judge automated scoring deepseek langgraph · deepseek-v3 · gemma 2 · chroma · tavily · langsmith
fig. 7 — twelve notebooks tiered by complexity, all riding the same LangGraph + dual-model stack.

hover or tab through any tier for what it covers

contact

Open to backend systems, AI infrastructure, and product engineering roles.