LangGraph research agent: Python setup and tutorial

Build a LangGraph research workflow with analyst review, parallel interviews, Tavily web search, and a cited Markdown report.

Player not loading? Watch on YouTube

This tutorial builds a Python research assistant with LangGraph, LangChain, OpenAI, and Tavily. A research topic becomes a set of generated analyst personas. The workflow pauses for a user to approve them or request revisions before each analyst starts a separate interview with an LLM acting as an expert.

The implementation covers graph state, nodes, conditional edges, and Pydantic structured outputs. An interview subgraph generates questions, prepares search queries, retrieves web context, and uses that context to answer. A configurable turn limit ends the conversation, after which the graph saves the interview transcript and writes a report section. LangGraph's Send API dispatches analyst interviews in parallel; the final nodes combine their sections with an introduction and conclusion into a cited Markdown report.

Setup uses VS Code and uv, with API keys for OpenAI, Tavily, and LangSmith tracing. The speaker recommends Python 3.11 through 3.13, while the description lists Python 3.12+. The walkthrough also includes import errors and graph configuration fixes before testing the assembled AI agent. It runs a development server, but the demonstrated model calls and live search depend on external services. It does not demonstrate offline inference or a local LLM.