Installation and setup
Deep Agents installs from PyPI as the deepagents package, which brings LangChain and LangGraph with it; a model provider package and one API key complete the setup.
Last updated: 29 Sep, 2026 · Deep Agents 0.7
Installing deepagents with pip, uv or Colab
The video starts from an empty folder. uv init turns it into a project, uv venv creates the virtual environment, and after activating it the libraries go into a requirements.txt: deepagents, langchain, langchain-openai, langchain-groq and ipykernel, installed with uv add -r requirements.txt. Installing deepagents also installs LangGraph, which the library is built on.
Pick the tab that fits how you work. pip is the plain way, uv follows the video, and Colab needs nothing on your machine. Unlike the video, the tabs pin each version, the ones every lesson was run with. You need Python 3.11 or later.
pip install "deepagents==0.7.19" "langchain-groq==1.1.3" "python-dotenv==1.2.3"Checking the installed versions
deepagents pulls in langchain and langgraph. Print what Python finds:
from importlib.metadata import version
for package in ["deepagents", "langchain", "langgraph", "langchain-groq"]:
print(f"{package:<15} {version(package)}")deepagents 0.7.19 langchain 1.4.3 langgraph 1.2.12 langchain-groq 1.1.3
Getting a free Groq keyRecommended
The video adds tavily-python for web search and puts four keys in a .env file: OpenAI, Groq, Google and Tavily. It signs up at tavily.com, where the key appears on the dashboard. On these pages every lesson runs on Groq's free openai/gpt-oss-120b model, so the Groq key is the one every lesson needs. The trip planner the course builds searches a small travel catalog and runs on that key alone. The video's web search runs too, with the optional Tavily key at the end of this page.
| Provider | Key | Variable | Package and model string |
|---|---|---|---|
| Groq | Free, console.groq.com/keys | GROQ_API_KEY | langchain-groq, "groq:openai/gpt-oss-120b" |
| Gemini | Free, aistudio.google.com/apikey | GOOGLE_API_KEY | langchain-google-genai (installed with deepagents), "google_genai:gemini-2.5-flash" |
| OpenRouter | Free models end in :free, openrouter.ai/keys | OPENROUTER_API_KEY | langchain-openrouter, "openrouter:google/gemma-4-31b-it:free" |
| OpenAI | Paid, platform.openai.com/api-keys | OPENAI_API_KEY | langchain-openai, "openai:gpt-5.5" |
The clips were recorded with the models of the time, such as groq:qwen/qwen3-32b and OpenAI's gpt-5.4. Groq has since retired qwen3-32b, so on these pages every example runs on openai/gpt-oss-120b. Any model string in the table works in its place, as long as the model can call tools.
Set the key for the terminal you work in:
export GROQ_API_KEY=gsk_...Keeping the key in a .env file
export sets the key for one terminal window. To keep it, save it in a file named .env in your project folder, the way the video does:
GROQ_API_KEY=gsk_...The file alone does nothing until python-dotenv loads it. The examples in later lessons assume the key is already set, as export or Colab's Secrets set it, so they leave these two lines out. If you keep your key in .env, add them at the top of each file, before any model is created. Add .env to .gitignore so the key never reaches a Git repository.
from dotenv import load_dotenv
load_dotenv() # copies the keys in .env into the environmentChecking the key with a real call
One call to Groq proves the key works. max_retries=6 is there for the free tier, which has a small per-minute token budget (see console.groq.com/settings/limits): a deep agent makes several model calls per task, and when a minute's budget runs out Groq answers "try again in a few seconds". With retries the client waits and tries again instead of failing. Every lesson creates its model this way.
from langchain.chat_models import init_chat_model
model = init_chat_model("groq:openai/gpt-oss-120b", temperature=0, max_retries=6)
print(model.invoke("In one sentence, what is Paris famous for?").text)Paris is famous for its iconic landmarks like the Eiffel Tower, world‑renowned art museums such as the Louvre, and its reputation as a global center of fashion, cuisine, and romance.
tokens per day in the error, wait, or switch the model string to Gemini.A Tavily key for web searchOptional
Tavily is a search API made for agents: one call returns the title, URL and a short extract of each page it finds. The video's web_search tool calls it, and the examples from the video that search the web need tavily-python and a TAVILY_API_KEY. The free plan needs no card. Tools: a travel search the agent can call installs the package and sets up the key, where web search first appears. Every other example runs with the Groq key alone.
Related
- Previous: Deep Agents overview
- Next: Tools: a travel search the agent can call
- Reference: Deep Agents quickstart
- Run the version check and confirm
deepagentsis 0.7.19. - Change the question in the key check to one about Rome and run it again.
- Print
model.max_retriesto confirm the setting reached the model.
Little by little, you're building something great.