# LangChain-WS **Repository Path**: ailearning1/lang-chain-ws ## Basic Information - **Project Name**: LangChain-WS - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-25 - **Last Updated**: 2025-12-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LangChain Workshop - AI Engineering Lifecycle Enterprise workshop teaching the complete AI engineering lifecycle using LangChain, LangGraph, and LangSmith—centered around building a customer support agent for TechHub (fictional e-commerce store). ## 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 ## Quick Setup This workshop uses [uv](https://docs.astral.sh/uv/) - a fast Python package installer and resolver. ```bash # Install uv (if not already installed) curl -LsSf https://astral.sh/uv/install.sh | sh # Install dependencies uv sync # Configure environment cp .env.example .env # Edit .env with your API keys (see labs/README.md for details) # Launch Jupyter uv run jupyter lab ``` For detailed setup instructions, see [labs/README.md](labs/README.md). ## Workshop Structure ### Labs | Lab | Topic | Description | |-----|-------|-------------| | **Lab 1** | Agent Foundations | Tool calling, single agents, database & document tools | | **Lab 2** | Multi-Agent Systems | Supervisor pattern, agent coordination, state management | | **Lab 3** | Human-in-the-Loop | Customer verification, interrupts, state persistence | | **Lab 4** | Deploy & Evaluate | LangSmith deployments, SDK, online evaluation, data flywheel | ### Slides Workshop slides are available in the `slides/` directory: ```bash cd slides pnpm install pnpm dev # Visit http://localhost:3030 ``` ## Repository Structure ``` langchain-workshop-porsche/ ├── workshop/ │ ├── labs/ # Interactive Jupyter notebooks │ │ ├── lab_1.ipynb # Agent Foundations │ │ ├── lab_2.ipynb # Multi-Agent Systems │ │ ├── lab_3.ipynb # Human-in-the-Loop │ │ ├── lab_4.ipynb # Deploy & Evaluate │ │ └── *_solution.ipynb # Solution notebooks │ │ │ ├── agents/ # Reusable agent factory functions │ │ ├── db_agent.py # Database queries (rigid tools) │ │ ├── sql_agent.py # Flexible SQL generation │ │ ├── docs_agent.py # RAG for product docs & policies │ │ ├── supervisor_agent.py # Multi-agent coordinator │ │ └── supervisor_hitl_agent.py # Verification + routing system │ │ │ ├── tools/ # Database & document search tools │ │ ├── database.py # DB tools (orders, products, SQL) │ │ └── documents.py # RAG tools (products, policies) │ │ │ ├── evaluators/ # Evaluation metrics │ │ └── evaluators.py # Correctness & tool call counters │ │ │ ├── deployments/ # Production-ready graph configurations │ │ └── *_graph.py # LangSmith deployment exports │ │ │ ├── data/ # Dataset & generation scripts │ │ ├── structured/ # SQLite DB + JSON files │ │ ├── documents/ # Markdown docs for RAG │ │ └── vector_stores/ # Pre-built vectorstore │ │ │ ├── config.py # Workshop configuration │ └── langgraph.json # LangGraph deployment config │ └── slides/ # Slidev presentation ├── slides.md # Presentation source └── slides.pdf # Exported PDF ``` ## Configuration The workshop uses SiliconFlow API (OpenAI-compatible) with DeepSeek models by default: | Setting | Default Value | |---------|---------------| | Model | `openai:deepseek-ai/DeepSeek-V3.2` | | Embedding | `openai:Qwen/Qwen3-Embedding-0.6B` | | API Base | `https://api.siliconflow.cn/v1` | Configure via environment variables in `.env`: - `WORKSHOP_MODEL` - LLM for agents - `WORKSHOP_EMBEDDING_MODEL` - Embedding model for RAG - `OPENAI_API_KEY` - SiliconFlow API key - `LANGSMITH_API_KEY` - LangSmith API key ## Dataset Overview The **TechHub dataset** includes: - **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** with full schema - **30 documents** (25 product specs + 5 policies) for RAG ## 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 ## Prerequisites ### Required Knowledge Free courses from [LangChain Academy](https://academy.langchain.com): - [LangChain Essentials - Python](https://academy.langchain.com/courses/langchain-essentials-python) (30 min) - [LangGraph Essentials - Python](https://academy.langchain.com/courses/langgraph-essentials-python) (1 hour) - [LangSmith Essentials](https://academy.langchain.com/courses/quickstart-langsmith-essentials) (30 min) ### Technical Requirements - Python 3.10+ - API Keys: LangSmith + SiliconFlow (or other model provider) - Tools: Git, uv ## Resources - [LangChain Python Docs](https://python.langchain.com) - [LangGraph Python Docs](https://langchain-ai.github.io/langgraph) - [LangSmith Platform](https://smith.langchain.com) - [LangChain Academy](https://academy.langchain.com)