
Course Introduction!!
Get code files here
https://github.com/laxmimerit/LangGraph-and-Ollama
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.
Calculate VRAM requirements for Qwen3.5, Nemotron, and Mixtrel on Ollama (2026), including 4-bit quantization, tokenizer and metadata overhead, vision memory, and dense versus mixture-of-experts architectures.
Explore dense transformers, sparse mixture of experts, and mamba architectures, focusing on routers, selective activation, and kvcache versus ssm state compression.
Evaluate dense, sparse, and hybrid transformer models for LeetCode hard problems locally with Ullama, focusing on Nemotron 3 nano 4B and QIN 3.59B/3.535B models.
Benchmark the Nemotron 3 nano 30B on LeetCode hard problems using the Ulama desktop workflow, showcasing problem ingestion, solution generation, and test-case validation at high speed.
Explore loop engineering with the react agent, detailing how input prompts trigger action, observation, and tool use, plus a two-model, memory-sharing loop for self-prompting improvement.
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.
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.
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.
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.
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.
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.
Learn to stream agent output with LangChain, maintain memory across chats, and debug streaming chunks from agent and tools using thread IDs and messages.
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 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.
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.
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.
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