Deep AgentsDeep Agents 0.7 · Python 3.11+
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
28 small wins to finish your pathNext lesson →

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

Creating the project and installing deepagents · from the Complete Deep Agents Course With LangChain · 16:55 to 21:30

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:

Example
from importlib.metadata import version

for package in ["deepagents", "langchain", "langgraph", "langchain-groq"]:
    print(f"{package:<15} {version(package)}")
The Tavily package and the API keys · from the Complete Deep Agents Course With LangChain · 22:19 to 26:40

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.

ProviderKeyVariablePackage and model string
GroqFree, console.groq.com/keysGROQ_API_KEYlangchain-groq, "groq:openai/gpt-oss-120b"
GeminiFree, aistudio.google.com/apikeyGOOGLE_API_KEYlangchain-google-genai (installed with deepagents), "google_genai:gemini-2.5-flash"
OpenRouterFree models end in :free, openrouter.ai/keysOPENROUTER_API_KEYlangchain-openrouter, "openrouter:google/gemma-4-31b-it:free"
OpenAIPaid, platform.openai.com/api-keysOPENAI_API_KEYlangchain-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:

bash
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.

python
from dotenv import load_dotenv

load_dotenv()   # copies the keys in .env into the environment

Checking 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.

ExampleAPI key
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)
Watch out. Groq's free tier also has a daily token limit per model. The longer lessons, such as the trip planner, use a large share of it in one run. If a run stops with tokens per day in the error, wait, or switch the model string to Gemini.

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.

Try it yourself
  • Run the version check and confirm deepagents is 0.7.19.
  • Change the question in the key check to one about Rome and run it again.
  • Print model.max_retries to confirm the setting reached the model.

Little by little, you're building something great.