Skip to content

langchain-ai/langsmith-agent-lifecycle-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

84 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

AI Engineering Lifecycle on LangSmith Platform

Enterprise workshop series teaching the complete AI engineering lifecycle using LangChain, LangGraph, and LangSmithβ€”centered around building a customer support agent for a fictional online technology e-commerce store called TechHub.

What You'll Build

A customer support agent system featuring:

  • Multi-agent architecture with specialized Database and Documents agents coordinated by a Supervisor
  • Human-in-the-loop (HITL) customer verification with LangGraph primitives
  • Evaluation-driven development using offline evaluation to identify and fix bottlenecks
  • Production deployment to LangSmith with online evaluation and data flywheels for continuous improvement

Quick Setup

This workshop uses uv - a fast Python package installer and resolver. If you don't have it:

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

Then set up the workshop:

# Clone repository
git clone https://github.com/langchain-ai/langsmith-agent-lifecycle-workshop.git
cd langsmith-agent-lifecycle-workshop

# Install dependencies (creates virtual environment automatically)
uv sync

# Configure API keys
cp .env.example .env
# Edit .env and add your API keys:
#   ANTHROPIC_API_KEY=sk-ant-...
#   LANGSMITH_API_KEY=lsv2_pt_...

# Build vectorstore (one-time setup, ~60 seconds)
uv run python data/data_generation/build_vectorstore.py

# Launch Jupyter
uv run jupyter lab

Workshop Outline

This workshop consists of three modules that take you from manual tool calling to production deployment:

  1. Module 1: Agent Development - Build from basics to multi-agent systems with HITL
  2. Module 2: Evaluation & Improvement - Use eval-driven development to systematically improve agents
  3. Module 3: Deployment & Continuous Improvement - Deploy to production and build a data flywheel

πŸ“š To get started, see workshop_modules/README.md

Repo Structure

langsmith-agent-lifecycle-workshop/
β”œβ”€β”€ workshop_modules/        # Interactive Jupyter notebooks
β”‚   β”œβ”€β”€ module_1/            # Agent Development (4 sections)
β”‚   β”œβ”€β”€ module_2/            # Evaluation & Improvement (2 sections)
β”‚   └── module_3/            # Deployment & Continuous Improvement (2 sections)
β”‚
β”œβ”€β”€ agents/                  # Reusable agent factory functions
β”‚   β”œβ”€β”€ db_agent.py          # Database queries (rigid tools)
β”‚   β”œβ”€β”€ sql_agent.py         # Flexible SQL generation (improved)
β”‚   β”œβ”€β”€ docs_agent.py        # RAG for product docs & policies
β”‚   β”œβ”€β”€ supervisor_agent.py  # Multi-agent coordinator
β”‚   └── supervisor_hitl_agent.py  # Full verification + routing system
β”‚
β”œβ”€β”€ tools/                   # Database & document search tools
β”‚   β”œβ”€β”€ database.py          # 6 DB tools (orders, products, SQL)
β”‚   └── documents.py         # 2 RAG tools (products, policies)
β”‚
β”œβ”€β”€ evaluators/              # Evaluation metrics
β”‚   └── evaluators.py        # Correctness & tool call counters
β”‚
β”œβ”€β”€ deployments/             # Production-ready graph configurations
β”‚   β”œβ”€β”€ db_agent_graph.py                   # Baseline database agent
β”‚   β”œβ”€β”€ docs_agent_graph.py                 # RAG documents agent
β”‚   β”œβ”€β”€ sql_agent_graph.py                  # Improved SQL agent
β”‚   β”œβ”€β”€ supervisor_agent_graph.py           # Basic supervisor
β”‚   β”œβ”€β”€ supervisor_hitl_agent_graph.py      # Supervisor with verification
β”‚   └── supervisor_hitl_sql_agent_graph.py  # Complete system (best)
β”‚
β”œβ”€β”€ data/                    # Complete dataset & generation scripts
β”‚   β”œβ”€β”€ structured/          # SQLite DB + JSON files
β”‚   β”œβ”€β”€ documents/           # Markdown docs for RAG
β”‚   β”œβ”€β”€ vector_stores/       # Pre-built vectorstore
β”‚   └── data_generation/     # Scripts to regenerate data
β”‚
β”œβ”€β”€ config.py                # Workshop-wide configuration
β”œβ”€β”€ langgraph.json           # LangGraph deployment config
└── pyproject.toml           # Dependencies

Key Concepts Covered

  • Agent Development: Tool calling, multi-agent systems, supervisor pattern, HITL with interrupts
  • Evaluation & Testing: Offline evaluation, LLM-as-judge, trace metrics, eval-driven development
  • Deployment & Production: LangSmith deployments, online evaluation, annotation queues, SDK integration
  • Best Practices: Factory functions, state management, dynamic prompts, structured outputs, streaming

See workshop_modules/README.md for detailed breakdown by module.

Dataset Overview

The TechHub dataset is a high-quality synthetic e-commerce dataset:

  • 50 customers across consumer, corporate, and home office segments
  • 25 products (laptops, monitors, keyboards, audio, accessories)
  • 250 orders spanning 2 years with realistic patterns
  • 439 order items with product affinity patterns
  • SQLite database (156 KB) with full schema and indexes
  • 30 documents (25 product specs + 5 policies) for RAG

All data is ready to use! See data/data_generation/README.md for details.

Additional Resources

Documentation

  • Data Generation Guide: data/data_generation/README.md - Complete dataset documentation
  • Database Schema: data/structured/SCHEMA.md - Full schema reference
  • RAG Documents: data/documents/DOCUMENTS_OVERVIEW.md - Document corpus guide
  • Agent Architecture: agents/README.md - Agent factory patterns

External Links

Prerequisites

Required (Complete Before Workshop)

Free courses from LangChain Academy:

Recommended (For Deeper Understanding)

Technical Requirements

  • Python 3.10+
  • API Keys:
    • LangSmith (free tier: smith.langchain.com)
    • Anthropic or OpenAI (workshop uses Claude Haiku 4.5 by default)
  • Tools: Git, Jupyter, uv (or pip)

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Educational workshop materials. Synthetic dataset free to use and distribute.


Ready to begin? Open workshop_modules/module_1/section_1_foundation.ipynb and start building! πŸš€

About

Workshop series teaching the AI Engineering Lifecycle using LangChain, LangGraph, and LangSmith

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •