Tutorials and examples for building AI agents, ML pipelines, and data workflows with Flyte 2.
Durable, self-healing agents on Union, with end-to-end observability in Grafana.
A support agent in production routes tickets with an API call. An ML engineer agent, built with LangGraph, gets the request to replace that call with a model we own: it evaluates open candidates on T4s in parallel, fine-tunes the ones worth it, promotes the winner as a Union artifact, deploys it, and tests the live app. Then the data drifts, a trigger notices, and the engineer retrains without anyone clicking. Every run is a conversation and a scored experiment in Grafana Agent Observability.
Runs from Colab against a Union cluster we give you access to; the GPU work happens there. Bring a laptop and a browser. A Claude or OpenAI key only if you want to drive the agent yourself.
git clone https://github.com/unionai/workshops
cd workshops/tutorials/langgraph-grafana-agent
uv venv .venv --python 3.11 && source .venv/bin/activate
uv pip install -r requirements.txt
flyte create config --endpoint <your-endpoint> --project flytesnacks --domain development --builder remote
flyte run support_agent.py agent_handle_tickets --router llm| Example | Description |
|---|---|
| Model Factory Agent + Grafana | A LangGraph agent plays ML engineer: evaluates five candidates on T4s in parallel, fine-tunes the right ones (and discovers a 149M encoder beats the chat models), promotes it as a Union artifact, deploys it, tests the live app, and turns the factory again when the data changes; Grafana Agent Observability watches every turn |
| SkyRL SQL Agent | Multi-turn RL against a real database — write one SkyRL-Gym environment, then drive it with no model, with a 0.5B, with Claude, or with SkyRL's distributed trainer; GRPO rollouts fan out as durable Flyte tasks |
| RAG and Agentic Memory | One vector store, pointed two directions — build a RAG index, watch retrieval work with no model involved, visualize the embedding space, then let an agent write its own memories back into it |
| Code Mode — NYC Taxi analyst | Claude writes one program, the Monty sandbox runs it, and its loops fan out into durable parallel tasks over real NYC taxi data |
| LangGraph Research Pipeline | Research agent pipeline — LangGraph orchestrates planning and quality gates, Flyte fans out parallel researcher tasks |
| LangGraph ReAct Agent | Build a ReAct agent with LangGraph + OpenAI on Flyte |
| Stable Diffusion | Generate images from text prompts with SDXL Turbo on GPU |
| DuckDB ETL | Extract and transform data with DuckDB SQL |
| Fraud Detection with Feast | Real-time fraud scoring with Feast feature store + XGBoost |
| Tutorial | What you'll learn |
|---|---|
| Flyte Basics | Flyte 2 fundamentals — tasks, pipelines, error handling, TaskEnvironment, ReusePolicy, map() |
| LangGraph ReAct Agent | Build a ReAct agent with tools in a single file |
| Stable Diffusion | GPU inference with Flyte reports |
| Image Classifier | Fine-tune ResNet18 on HuggingFace dataset with PyTorch |
| DuckDB ETL | Data pipeline with DuckDB SQL and Flyte reports |
| Snowflake ETL | ETL pipeline with the Snowflake connector |
| Flyte Local Dev | Local dev features — TUI, caching, reports, tracing, serving (no cluster needed) |
| Fraud Detection with Feast | Fraud scoring pipeline with Feast feature store, XGBoost, and real-time serving |
| Tutorial | Description |
|---|---|
| Model Factory Agent + Grafana | The agent runs the model factory: parallel T4 evals, fine-tunes, artifact promotion, a deployed router app it tests and can roll back, an artifact trigger that validates every promotion, a human approval gate, and a day-two retrain; observed in Grafana Agent Observability, with a crash-and-resume that trains nothing twice |
| Code Mode — NYC Taxi analyst | The agent writes a program instead of calling tools one at a time. It runs in the Monty sandbox, and a loop in the generated code becomes a fan-out of durable, parallel query tasks over 3M+ real taxi trips |
| RAG and Agentic Memory | One Chroma store, pointed two directions — build a document index, search it with no model, answer from it with citations, see the embedding space in 2D, then let an agent write its own memories back into it |
| LangGraph Research Pipeline | Research agent pipeline — LangGraph orchestrates planning and quality gates, Flyte fans out parallel researcher tasks via Tavily web search |
| LangGraph ReAct Agent | Single-file ReAct agent with LangGraph |
| Planner Multi-Agent System | Scalable planner multi-agent system |
| ReAct Multi-Agent System | Adaptive ReAct multi-agent system |
| Debate Multi-Agent System | Multi-agent debate pattern |
| Manager Multi-Agent System | Manager-worker agent delegation |
| Sequential Multi-Agent System | Sequential agent pipeline |
| Autoresearch | Autoresearch-style self-healing agent on Flyte |
| Tutorial | Description |
|---|---|
| MCP Recipe Assistant | Build and deploy a recipe assistant MCP server on Union |
| Tutorial | Description |
|---|---|
| LoRA / QLoRA / Full | Fine-tune an LLM on text-to-SQL with LoRA, QLoRA, or full fine-tuning — live training reports, FastAPI serving, Gradio UI |
| GRPO — Code Generation | Teach a model to write Python with GRPO — reward = sandboxed test execution, MBPP dataset, live reward/pass-rate charts |
| GRPO — Distributed | Scale GRPO across the cluster — fan out sandboxed verification to a reusable pool, then disaggregate rollouts onto vLLM workers with LoRA weight sync |
| GRPO | GRPO fine-tuning on math/reasoning tasks |
| DPO | Direct Preference Optimization for alignment |
| PPO | Proximal Policy Optimization for RLHF |
| Tutorial | Description |
|---|---|
| Fraud Detection with Feast | Fraud scoring pipeline with Feast feature store, XGBoost, and real-time serving |
| Stable Diffusion | Image generation with SDXL Turbo |
| Image Classifier | Fine-tune ResNet18 on Beans dataset |
| DETR Object Detection | Fine-tune DETR for object detection with live mAP charts |
| Tutorial | Description |
|---|---|
| Genomic Variant Effect Prediction | Score DNA mutations with HuggingFace Carbon genomic foundation model — zero-shot pathogenicity prediction on BRCA2, TP53, KRAS, and more |
| DNA Sequence Generation & Analysis | Generate DNA with Carbon and compare to real genes — GC content, codon usage, ORFs, dinucleotide frequencies |
| Gene Comparison Across Species | Compare homologous genes across 6 species with Carbon scoring, phylogenetic trees, and ESMFold 3D structure comparison |
| Protein Sequence Analysis | Analyze protein properties, compute sequence similarity, run ESM-2 embeddings, and predict 3D structures with ESMFold |
| Drug Molecule Screening | Virtual drug screening — compute physicochemical properties, apply Lipinski's Rule of Five, rank candidates by drug-likeness |
| Cell Microscopy Classification | Fine-tune a Vision Transformer (ViT) to classify blood cell types from microscopy images |
| Tutorial | Description |
|---|---|
| DuckDB ETL | SQL-based data pipeline with DuckDB |
| Snowflake ETL | ETL with Snowflake connector |
| Lance Streaming for Vision | Convert a swarm of tiny per-sample image files (real CPPE-5 detection data) into one Lance dataset, benchmark per-file vs Lance streaming against real object storage, then train / evaluate / explore a Faster R-CNN streamed straight from S3 on a T4 |
# Clone the repository
git clone https://github.com/unionai/workshops
cd workshops
# Navigate to any tutorial
cd tutorials/langgraph_agent_research
# Create virtual environment and install dependencies
uv venv .venv --python 3.11
source .venv/bin/activate
uv pip install -r requirements.txtflyte create config \
--endpoint <your-endpoint> \
--auth-type headless \
--builder remote \
--domain development \
--project flytesnacksDon't have a cluster? Request access at flyte.org.
Remote:
uv run flyte run workflow.py research_pipeline --query "Compare quantum computing approaches"Local:
uv run flyte run --local workflow.py research_pipeline --query "Compare quantum computing approaches"Local with TUI:
uv run flyte run --local --tui workflow.py research_pipeline --query "Compare quantum computing approaches"Start TUI dashboard:
uv run flyte start tui