Qwen, Ollama and LangGraph: build a local planning agent

Learn to build a financial planning agent with Qwen 3 8B, Ollama and four LangGraph nodes, using custom tools and hypothetical news data.

Player not loading? Watch on YouTube

This tutorial builds a local AI agent for financial research with Qwen, Ollama and LangGraph. The workflow separates planning, tool execution, replanning and report writing into four nodes. The executor calls tools directly without an LLM, while the replanner decides whether to revise the remaining steps.

The example uses Qwen 3 8B through Ollama with a context window of about 16K tokens. The speaker also reports that Qwen 3.5 9B works with the agent and names vLLM as an alternative inference provider. The walkthrough takes place in Cursor.

Custom tools retrieve stock metrics, look up news headlines and compare companies. A registry groups tools by agent name, while Pydantic models define structured plans and replanning output. A shared scratchpad records tool arguments, results and execution status for the final reporter. Limits on steps and replans route the workflow to a report when execution reaches its bounds.

Two example queries cover technology and healthcare stocks. The data covers only a handful of companies, and the speaker explicitly describes the news headlines as hypothetical. The resulting investment conclusions are demonstration outputs from that limited dataset. The speaker describes the workflow as running entirely locally; the tutorial focuses on its implementation rather than hardware requirements or performance measurements.