You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A hands-on, single-notebook walkthrough that builds a production-style travel planner agent from scratch using [Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview) on top of LangChain and LangGraph.
3
+
A hands-on, single-notebook walkthrough that builds a production-style travel planner agent from scratch using [Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview) on top of LangChain and LangGraph, then evaluates it with LangSmith.
4
4
5
5
The notebook lives at `notebooks/deepagents-travel-planner.ipynb` and is designed to be worked through top-to-bottom in a guided session with a LangChain engineer.
6
6
@@ -10,28 +10,32 @@ By the end of the notebook you'll have a travel planning agent that can:
10
10
11
11
- Plan a multi-day trip from a single user request
12
12
- Delegate research to specialized subagents (`hotel-search`, `flight-search`, `activity-search`) running in parallel
13
-
- Read and write files on a virtual filesystem (or on real disk) via `read_file` / `write_file` / `edit_file`
13
+
- Read and write files on a virtual filesystem via `read_file` / `write_file` / `edit_file`
14
14
- Pause for human approval before "booking" anything
15
15
- Remember a traveler's preferences across conversations (per-user, with a shared global namespace)
16
16
- Follow a team-authored `AGENTS.md` and load on-demand `SKILL.md` files for each deliverable (itinerary, budget, packing list, travel brief)
17
17
- Emit a final itinerary and budget in your team's exact format
18
18
19
+
You'll also build a small LangSmith evaluation suite that runs the same dataset against two OpenAI models (`gpt-5.4` and `gpt-4.1-mini`), with four metrics — trajectory match, constraint check, efficiency, and LLM-as-judge response quality — so you can compare cost / latency / quality side-by-side in the LangSmith experiment comparison view.
20
+
19
21
## Notebook Outline
20
22
21
-
The notebook is split into ten parts. Each part introduces one Deep Agents concept and adds one capability to the agent:
23
+
The notebook is split into eleven parts. Each part introduces one concept and adds one capability:
| 11 | Next Steps | Where to take the agent next (real APIs, calendar, multi-leg trips, group travel) |
35
39
36
40
Each part is independently runnable — you can stop at any layer and have a working agent for that scope.
37
41
@@ -40,37 +44,70 @@ Each part is independently runnable — you can stop at any layer and have a wor
40
44
### Clone the repo
41
45
```bash
42
46
git clone <repo-url>
43
-
cd deepagents-workshop
47
+
cdtravel-planner-deepagents-workshop
44
48
```
45
49
46
50
### Configure environment variables
47
51
```bash
48
52
cp .env.example .env
49
-
# Fill inyour model + Tavily keys
53
+
# Fill in: OPENAI_API_KEY (or your provider's keys) + LANGSMITH_API_KEY for Part 10 evals
50
54
```
51
55
56
+
No Tavily key needed — discovery is handled by a deterministic offline stub so the workshop runs without external APIs.
57
+
52
58
If corporate policy blocks API keys, contact your LangChain representative and we'll find a workaround.
53
59
54
60
### Install dependencies
55
-
This project uses [`uv`](https://github.com/astral-sh/uv):
61
+
62
+
Two options — both install the exact same pinned versions (`requirements.txt` is generated from `uv.lock` and is pip-tested on Python 3.11).
63
+
64
+
**Option A: `uv`** (recommended if you have it)
56
65
```bash
57
-
# Install uv if you haven't already
58
66
pip install uv
59
-
60
-
# Install the project
61
67
uv sync
68
+
source .venv/bin/activate
69
+
```
62
70
63
-
# Activate the virtual environment
71
+
**Option B: `pip`**
72
+
```bash
73
+
python3.11 -m venv .venv
64
74
source .venv/bin/activate
75
+
pip install --upgrade pip
76
+
pip install -r requirements.txt
65
77
```
66
78
67
-
## Running the Notebook
79
+
Versions are pinned to a known-good combo (`deepagents==0.5.2`, `langgraph==1.1.6`, `langchain-core==1.2.28`) to avoid the `ToolRuntime.__init__() missing 'tools'` skew that newer `langgraph` releases trigger with `deepagents` 0.5.x.
80
+
81
+
## Running
82
+
83
+
### As a notebook
84
+
85
+
Open `notebooks/deepagents-travel-planner.ipynb` in JupyterLab, VS Code, or Cursor and select the workshop's `.venv` as the kernel.
68
86
69
-
Open `notebooks/deepagents-travel-planner.ipynb` in Jupyter, PyCharm, or VS Code, select the workshop's `.venv` as the kernel, and run cells in order.
87
+
If your editor doesn't auto-detect the venv, register it as a named Jupyter kernel:
Then pick **Travel Planner** from the kernel selector.
94
+
95
+
### As a LangGraph Studio agent
96
+
97
+
The agent in `agents/travel_planner/` is registered in `langgraph.json`. Launch it locally with:
98
+
99
+
```bash
100
+
source .venv/bin/activate
101
+
langgraph dev
102
+
```
103
+
104
+
This starts an API server at `http://localhost:2024` and prints a LangGraph Studio URL. Studio gives you a visual graph view, message-level tracing, checkpoint history, and a chat panel.
70
105
71
106
## Model Configuration
72
107
73
-
Model selection is centralized in `utils/models.py`. The default is OpenAI; the file contains commented-out blocks for Azure OpenAI, AWS Bedrock, and Google Vertex AI — uncomment the section matching your provider and fill in the relevant env vars in `.env`.
108
+
Model selection is centralized in `utils/models.py`. The default is OpenAI (`openai:gpt-5.4`); the file contains commented-out blocks for Azure OpenAI, AWS Bedrock, and Google Vertex AI — uncomment the section matching your provider and fill in the relevant env vars in `.env`.
109
+
110
+
The notebook's Part 10 evaluations call `init_chat_model()` directly to swap models for the comparison (`openai:gpt-5.4` vs `openai:gpt-4.1-mini`) and use `model` from `utils/models.py` for the LLM-as-judge. If your provider proxies OpenAI through APIM, point `OPENAI_BASE_URL` at the proxy so all three model names resolve through it.
0 commit comments