Contents

Agentic Ai

Agentic Systems

View as:

Code Labs - 03: Agentic Systems

Four complete, end-to-end production-grade agentic systems. Each system combines multiple architectural patterns from 02 - Architecture Patterns into a realistic use case, implemented across all four frameworks.

Back to Overview: Agentic AI · Back to Concepts: Agentic System Design · Evaluation & Observability


Systems Overview

01-Research-Assistant          02-Document-Processor
──────────────────────         ──────────────────────
Orchestrator-Subagent          Pipeline
+ Parallel fan-out             + Conditional Routing
+ Reflexion (quality gate)     + HITL (human approval)

↓ Use case:                    ↓ Use case:
Deep research with             Ingest, classify, extract,
multiple sub-researchers       and route documents

03-Autonomous-Task-Planner     04-Code-Review-System
──────────────────────────     ─────────────────────
Plan-and-Execute               Parallel fan-out
+ Feedback loop                + Aggregation
+ Dynamic replanning           + Reflexion

↓ Use case:                    ↓ Use case:
Break goals into plans,        Multi-perspective code
execute, and adapt             review with synthesis

System Details

01 - Research Assistant

PropertyDetail
PatternsOrchestrator-Subagent + Parallel + Reflexion
Use caseGiven a research question, spawn specialist sub-researchers in parallel, aggregate findings, reflect on quality, produce final report
ComplexityAdvanced
Files06-Agentic-AI/CodeLabs/03-Agentic-Systems/01-Research-Assistant/<Framework>/system.py

Architecture flow:

User query
    ↓
Orchestrator (plans sub-tasks)
    ├── Researcher-A (parallel) ── search + synthesize
    ├── Researcher-B (parallel) ── search + synthesize
    └── Researcher-C (parallel) ── search + synthesize
         ↓ aggregate
    Quality-Critic (Reflexion)
         ↓ revise if needed
    Final Report

02 - Document Processor

PropertyDetail
PatternsPipeline + Conditional Routing + HITL gate
Use caseIngest documents, classify by type, extract structured data, route to appropriate workflow, pause for human approval on low-confidence cases
ComplexityAdvanced
Files06-Agentic-AI/CodeLabs/03-Agentic-Systems/02-Document-Processor/<Framework>/system.py

Architecture flow:

Document input
    ↓
Stage 1: Ingestion + OCR
    ↓
Stage 2: Classification (contract / invoice / email / other)
    ↓
Stage 3: Conditional routing
    ├── High confidence → auto-process
    └── Low confidence → HITL approval gate
         ↓
Stage 4: Structured extraction
    ↓
Output store

03 - Autonomous Task Planner

PropertyDetail
PatternsPlan-and-Execute + Feedback loop + Dynamic replanning
Use caseAccept a high-level goal, decompose into an executable plan, run each step, evaluate results, and replan when steps fail or produce unexpected output
ComplexityAdvanced
Files06-Agentic-AI/CodeLabs/03-Agentic-Systems/03-Autonomous-Task-Planner/<Framework>/system.py

Architecture flow:

Goal input
    ↓
Planner (decompose into steps)
    ↓
Executor loop:
    ├── Execute step N
    ├── Evaluate output
    ├── If failed → Replanner → new sub-plan
    └── If done → next step
         ↓
Goal achieved / report

04 - Code Review System

PropertyDetail
PatternsParallel fan-out + Aggregation + Reflexion
Use caseSubmit code for review; multiple specialist reviewers (security, performance, readability, correctness) run in parallel; results aggregated; Reflexion loop ensures completeness
ComplexityAdvanced
Files06-Agentic-AI/CodeLabs/03-Agentic-Systems/04-Code-Review-System/<Framework>/system.py

Architecture flow:

Code submission
    ↓
Fan-out to reviewers (parallel):
    ├── Security-Reviewer
    ├── Performance-Reviewer
    ├── Readability-Reviewer
    └── Correctness-Reviewer
         ↓ aggregate findings
    Synthesis-Agent
         ↓ Reflexion (gap check)
    Final Review Report

Framework Implementations

All 4 systems × all 4 frameworks = 16 total implementations:

SystemLangChainLangGraphCrewAIADK
Research Assistantsystem.pysystem.pysystem.pysystem.py
Document Processorsystem.pysystem.pysystem.pysystem.py
Autonomous Task Plannersystem.pysystem.pysystem.pysystem.py
Code Review Systemsystem.pysystem.pysystem.pysystem.py

Prerequisites

These systems assume familiarity with individual patterns. Complete these first:

  1. 01 - Agent Types - at least the Complex level
  2. 02 - Architecture Patterns - at minimum: Parallel, Orchestrator-Subagent, Reflexion

Getting Started

# Start with Research Assistant in LangGraph (cleanest state model for this use case)
python 06-Agentic-AI/CodeLabs/03-Agentic-Systems/01-Research-Assistant/LangGraph/system.py

# Or Code Review System in CrewAI (role-based structure fits naturally)
python 06-Agentic-AI/CodeLabs/03-Agentic-Systems/04-Code-Review-System/CrewAI/system.py

What to Read Alongside