https://github.com/langchain-samples/deepagents-with-langsmith
https://github.com/langchain-samples/deepagents-with-langsmith
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/langchain-samples/deepagents-with-langsmith
- Owner: langchain-samples
- Created: 2026-04-14T17:28:55.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-04-14T18:40:42.000Z (3 months ago)
- Last Synced: 2026-04-14T19:24:50.323Z (3 months ago)
- Language: Jupyter Notebook
- Size: 249 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Deep Agents Workshop
A hands-on workshop covering Deep Agents, Deep Agents Deploy, and LangSmith evaluations.
| Part | Topic | Duration |
|------|-------|----------|
| **1** | Deep Agents: Harness, Filesystem, Tools, Subagents, Memory, Middleware, HITL, Skills | ~45 min |
| **2** | Deep Agents Deploy: Ship to LangSmith | ~10 min |
| **3** | LangSmith: Tracing, Datasets & Evaluations | ~20 min |
## Prerequisites
- Python 3.11+
- [uv](https://docs.astral.sh/uv/getting-started/installation/)
## Setup
1. Install dependencies:
```bash
uv sync
```
2. Copy `.env.example` to `.env` and fill in your API keys:
```bash
cp .env.example .env
```
You'll need:
| Key | Where to get it |
|-----|----------------|
| `OPENAI_API_KEY` | [platform.openai.com](https://platform.openai.com) |
| `LANGSMITH_API_KEY` | [smith.langchain.com](https://smith.langchain.com) |
| `TAVILY_API_KEY` | [tavily.com](https://tavily.com) |
3. Start the notebook:
```bash
uv run jupyter notebook notebooks/workshop.ipynb
```
## Switching Models
The notebook uses `init_chat_model()` which supports any provider. Change the model in the setup cell:
```python
# OpenAI (default)
model = init_chat_model("openai:gpt-4.1-mini")
# Anthropic
model = init_chat_model("anthropic:claude-sonnet-4-20250514")
# Azure OpenAI
model = init_chat_model("azure_openai:gpt-4.1-mini", azure_deployment="your-deployment")
# AWS Bedrock
model = init_chat_model("bedrock:anthropic.claude-sonnet-4-20250514-v1:0")
```
Some providers need an extra package:
```bash
uv add langchain-anthropic # Anthropic
uv add langchain-aws # AWS Bedrock
```
## Deploy (Part 2)
Part 2 deploys your agent to LangSmith. This requires the `langgraph` CLI:
```bash
uv tool install deepagents-cli
uv tool install 'langgraph-cli[inmem]'
```
Your `LANGSMITH_API_KEY` must have deployment permissions (`lsv2_sk_...` service key, not a personal token).
## Project Structure
```
workshop/
├── notebooks/
│ └── workshop.ipynb # Main workshop notebook
├── agents/
│ └── deep_agent/ # Deployable agent (used in Part 2)
│ ├── agent.py
│ ├── AGENTS.md
│ ├── deepagents.toml
│ └── skills/
│ ├── linkedin-post/
│ └── twitter-post/
├── utils/
│ └── models.py # Centralized model config
├── pyproject.toml
└── .env.example
```
**Deploy fails with 403 / permission denied**
Your LangSmith API key needs deployment permissions. Use a service key (`lsv2_sk_...`), not a personal access token (`lsv2_pt_...`).