
Course Introduction!
Follow the prescribed learning path from Python fundamentals to lang chain, then lang graph, then private agentic RAG and deep agent multi-RAG for AI agent mastery.
Get code files here
https://github.com/laxmimerit/LangGraph-and-Ollama
Use Gemma3 on Ollama to perform quick document analysis with the lama UI in rag mode, handling images and PDFs via drag-and-drop or copy-paste, and integrate with LangChain workflows.
Test benchmark questions locally with Qwen3 to compare its reasoning on physics and algebra problems against GPT-5, using live coding and a ChatGPT evaluator.
Start ollama serve, explore models via the UI and terminal, and manage models with pull, show, and rm commands.
Learn to copy models using the Ollama cp command and track them with the Ollama ps. Name copies, adjust parameters, and monitor CPU, GPU usage and context windows across runs.
Explore Ollama message commands and the message mode to view model details, parameters, and licenses. Learn to manage llama 3.2 models and Seldon models.
Learn to use Ollama raw API requests for generating completions and chat completions, including streaming options, model creation, and JSON output.
Learn to download a GGUF model from Hugging Face and load an uncensored wizard LM model into Ullama for local LLM experimentation, including file paths, system prompts, and UI checks.
Compare Qwen 3.8 27B token generation benchmarks on MacBook Pro M5 Max and RTX 5090, analyzing 8k context, memory usage, and the n=3 sweet spot for speed.
Learn to set up LangSmith for tracing and debugging AI apps, generate API keys, configure a dot env, and enable tracing across LangChain projects in EU or US regions.
Set up and configure a local llama-based model with Gemma3, including environment variables, base URL, and stable Python version considerations to control temperature and token limits.
Master generating responses with Gemma3, tracing in Langsmith, and coordinating system, human, and AI messages to support LangGraph and LangChain workflows.
Reuse prompts efficiently by using the chat prompt template to set system and human message placeholders and replace them at runtime with audience, subject, and topic parameters.
Create a single-line LangChain chain by binding a prompt to an LM, invoke with inputs like subject, audience, and topic, and observe the populated prompt and final output.
Format ai messages by applying the str output parser to convert chain outputs into string data, and explore other output parsers like json, markdown, and xml.
Stream real time output from the LLM using a structured Pydantic model and an output parser to reveal sentiment and reasoning.
Explore flow engineering and finite state machines to build LangGraph with state, node, and edge. Design start and end nodes, custom and pre-built nodes, and maintain message history within LangGraph.
Define a custom state in LangGraph by extending type dict, using a state graph canvas to hold nodes and edges, and modeling input and output text with typed fields.
Build your first LangGraph by creating a state graph canvas, adding a simple state with input and output text, connecting nodes, and compiling the graph for visualization.
Explore conditional routing in LangGraph by integrating an LM into line graph nodes, building a sentiment analyzer with positive and negative sentiment nodes for tailored responses.
Define a custom state for a tweet and perform sentiment analysis in a LangGraph node. Generate a warm positive response using a system and human message flow.
Develop a negative sentiment node and a sentiment router to direct to positive or negative responses based on sentiment state and confidence, using system messages.
Design and implement a LangGraph for sentiment analysis and tweet replies, including router logic, analyze node, positive and negative response nodes, edge wiring, and compile.
Explore chain of thought and tree of thought design patterns for building a react agent, and compare their multi-path reasoning with conditional routing in agent design.
Explore chain of thought and tree of thought, and how prompts empower an LLM to think step by step and act with tools in a react agent pattern.
Manage state in agents by modeling a messages history—human, system, AI, and tool messages in LangGraph—and append outputs without overwriting using annotated typing.
Learn to implement an agent state with an annotated reducer to maintain message history, attach a tool node, and configure a practical Python workflow for state updates.
Create and attach a get weather tool and a math tool to the language model, using decorators, docstrings, and type hints to enable real-time weather queries.
Explore using wttr.in for real-time weather updates and build a simple curl-based weather tool, then design a math tool with LangChain runnable tools to evaluate expressions.
Import and invoke weather and calculate tools, pass inputs like Mumbai, and verify outputs; then design a line-graph workflow with an agent, tool nodes, and a start-to-end flow.
Debug the agent node to test tool calls, verify the calculate tool invocation via proper docstrings, and observe how responses are returned as message lists within a LangGraph line graph.
Implement a router named should continue that inspects the latest agent state message, routes tool calls through the tool node, and ends the process to produce the final answer.
Define the create agent method to build a LangGraph agent with an agent node and a tool node, connected by conditional edges.
See how an agent manages states and executes multiple tool calls in parallel, generating a final answer. Leverage line chain and line graph concepts to produce structured output.
Discover how agentic memory enhances LangGraph and LangChain by attaching a memory layer to recall prior conversations, with RAM or external databases like SQLite, MySQL, and PostgreSQL.
Set up notebook memory for an agent, enabling RAM or SQLite storage across sessions and integrating tools to support customer issues, a personal assistant, tutoring, and coding tasks.
Import the tools by modifying the system path, create the agent state and agent node, and configure a memory enabled friendly assistant that uses weather and calculator tools.
Create a ReAct agent using a MemorySaver checkpointer, wire a memory checkpoint into the graph, and store conversational history in RAM while exploring Postgres and SQLite memory options.
Test a react agent with memory saver, using thread IDs to maintain per-conversation histories and preserve state across sessions.
Learn to stream agent output with LangChain, maintain memory across chats, and debug streaming chunks from agent and tools using thread IDs and messages.
Test stream agent output behavior, focusing on tool calls, AI vs tool messages, and how memory and weather queries like Mumbai and New Delhi shape responses.
Maintain separate state per thread id to recall names and summarize chat histories into a markdown report, using tool calls like get weather and deliberate prompt design to guide outputs.
Learn to design production ready memory for LM apps, using short term memory for thread IDs and long term memory for user IDs, with episodic, semantic, and procedural memories.
Manage short term memory through the agent state and thread id, while long term memory stores episodic, semantic, and procedural memories with databases like SQLite and PostgreSQL.
Explore managing short-term working memory and chat history for agentic RAG, capturing user queries and model outputs, and storing memory in SQLite or PostgreSQL.
Leverage a persistence memory notebook to build a LangGraph and LangChain agent, importing tooling, managing agent state and messages, and adding SQLite or Postgres memory persistence for persistent chats.
Persist agent memories with sqlite by creating checkpoints.db, linking a sqlite saver, and storing chat history for each thread id.
Persist short term memory in PostgreSQL by setting up a free Neon database, connecting via a URL loaded from .env, and restarting to load the environment variable for LangChain.
Persist the agent's memory to a remote PostgreSQL database using LangChain, by configuring the memory store, automatically creating tables, and storing chat histories as encoded blobs.
Explore connecting to PostgreSQL using from connection string in Lightchain, with a memory-backed checkpoint, and an agent that stores and recalls questions across sessions.
Persist long term memory across sessions and across user IDs using episodic and semantic memory, a vector store, and a rag-based retrieval-augmented approach.
Set up Postgres memory storage for long-term and short-term memory, configure Olama embedding with a base URL, and create separate checkpoint and store connections for setup.
Explore long-term memory management with PostgreSQL using put, get, search, and delete tools. Learn how namespaces and user IDs organize memory keys like preferences for cross-thread access and semantic retrieval.
Store, retrieve, and delete long-term memory in PostgreSQL using a memory namespace, with put, get, and delete operations to manage keys like color, work, and role for a user.
Define the agent state with a user_id and messages, and implement a save user memory tool to store category information as a dictionary under the user namespace.
Learn to build an agent node by attaching tools, integrating memory with semantic search, and enabling save and retrieval of user memory using a defined namespace and user id.
Build a memory context from user preferences using key and value data, and enable the agent with save and get memory tools for personalized answers via semantic search.
Create an agent node with memory tools and a long-term memory in PostgreSQL, guided by a detailed system prompt for a tool-enabled LM.
Create a LangGraph agent by building a routing node, a graph, and tool nodes with conditional edges. Use the short-term memory checkpoint and semantic memory search to guide execution.
Explore how an agent uses long-term and short-term memory, plus memory tools, to retrieve user context and preserve memory across thread IDs for personalized outputs.
**Brand New 2026 Version**
This course has been re-designed, re-recorded, and rebuilt from the ground up to support
**LangChain v1+, LangGraph v1+, latest frameworks, and modern agentic workflows.**
Master LangGraph v1 and Ollama – Build Gen AI Agents is a complete and beginner-friendly course for anyone who wants to build real AI agents using LangGraph, LangChain, Ollama, and open source LLMs like GPT-OSS, Qwen3 and Gemma3.
This course starts from the basics. You will understand every concept step by step and build fully working AI agent systems with real tools, memory, routing, and database integration.
By the end of the course, you will be able to build production-ready AI agents that can search the web, call tools, interact with databases, store memories, follow human approval steps, and solve real-world tasks.
Every lecture includes a live demo and a working example to help you learn through hands-on experience.
What You Will Learn
Ollama and Open Source LLMs
Install and set up Ollama with the latest LangChain v1 updates
Work with models like Qwen3 and Gemma3
Test context handling and realtime search settings
Do quick document analysis
Inspect and benchmark models
Understand how to select the right model for a project
Use all important Ollama commands
Create custom Ollama models
Use Ollama message commands
Make raw API requests
Load uncensored GGUF models for educational research
LangChain v1 Fundamentals
Set up LangSmith for debugging and tracing
Understand open source tracing tools like LangFuse and Opik
Use ChatOllama with Gemma3
Produce responses and trace them in LangSmith
Reuse prompts with ChatPromptTemplate
Chain multiple runnables
Format messages with StrOutputParser
Create structured output with Pydantic
LangGraph Beginner to Advanced
Understand flow engineering and finite state machines
Create custom states and nodes
Learn how LangGraph updates states
Execute nested nodes
Build and visualize LangGraph workflows
Invoke graphs and watch state changes happen
Conditional Routing
Build sentiment analysis workflows
Create Pydantic models for classification
Route outputs to different nodes
Generate positive and negative responses using LangGraph
Build a complete sentiment analysis graph
ReAct Agent with LangGraph
Learn Chain of Thoughts and Tree of Thoughts patterns
Understand ReAct agent design
Manage agent state
Create tools for weather and calculations
Build agent nodes and enable debugging
Create conditional tool execution
Build a complete ReAct agent
Test tool calls, internal states, and parallel execution
Agent Memory and Streaming
Understand how agent memory works
Set up memory notebooks
Build agents with MemorySaver
Stream agent output
Recall chat history
Short Term Memory
Learn the idea of persistence
Separate long term and short term memory
Save agent memory to SQLite
Create a free PostgreSQL database online
Store and retrieve memory from PostgreSQL
Long Term Memory
Build long term memory storage
Use store namespace and put functions
Save, fetch, and delete long term memory items
Create semantic search for memories
Build tools to save and retrieve user memory
Build long term and short term memory agents
Interrupt and Human in the Loop
Understand human approval workflows
Add guardrails to protect PII
Build interruptible tools like money transfer
Create HITL nodes and routers
Build SQLite persistence for agent state
Execute workflows that need user approval
Stress test guardrail and approval flows
Reflection Agent
Build a researcher agent with critique feedback
Add free web search tools
Build routing logic for self evaluation
Combine agents into a reflection loop
Evaluate and test reflection workflows
MySQL ReAct Agent
Connect LangGraph with a MySQL database
Extract database schema
Generate SQL queries using LangChain tools
Validate queries and fix errors automatically
Execute complex queries using agents
Compare Qwen3 with GPT OSS models for database tasks
Search Hotels with Airbnb MCP Servers
Understand the Model Context Protocol
Use the Airbnb MCP server
Build LangGraph MCP client workflows
Run MCP based agents in Jupyter
Who This Course Is For
Beginners who want to learn AI agents
Developers working with LangChain or open source LLMs
Students and professionals entering Gen AI development
Python programmers exploring agent systems
Anyone who wants to build complete production ready AI agents
No advanced experience is required. Only basic Python knowledge is enough.
Why This Course Is Different
Beginner friendly language
Covers everything end to end: LLMs, LangChain, LangGraph, Agents
Live coding with practical examples
Includes latest updates for LangChain v1 and Ollama
Focuses on production ready workflows
Uses open source models so there is no API cost
By the End of This Course You Will Be Able To
Build complete AI agents using LangGraph
Use tools, databases, and APIs inside agents
Add short term and long term memory
Add human approval and guardrails
Use Ollama to run powerful LLMs locally
Create stateful and fully working Gen AI applications