
Build and test ai agents, rags, and chatbots with LangChain and Olama using local llms. Learn LangChain architecture, components, and Lang Smith for debugging, testing, and monitoring.
LangChain standardizes interfaces for diverse language models, enabling easy switch between providers, observability, tool calls, structured outputs, async and streaming, with monitoring via Lang Smith.
Explore the LangChain ecosystem, including the LangChain library, LangSmith for evaluation and tracing, and LangGraph for stateful multi-agent workflows, with observability for production-ready LLM apps.
Install dependencies for the build and test ai agents course using the requirements.txt with LangChain v1.0.3, create and activate a Python virtual environment, then pip install -r requirements.txt.
Install Ollama to run local large language models on macOS, Linux, or Windows. Avoid OpenAI API fees while exploring models with embedding, vision, and tool support for building local applications.
Explore how to run local LLMs in Ollama across parameter sizes from 7b to 671b, understand quantization, headcount, and the hardware needs for efficient inference.
Learn to run local LLMs with Ollama by listing, downloading, and launching models in a terminal, compare smaller versus deep sea 8b models, and generate code offline.
Demonstrates building a gui-based local-machine interface for Ollama models, using Misty.app and gpt for all to run local models with documents, images, and vision support.
Explore the ollama command line to manage local llms—list, show, and delete models, inspect architecture, context length, and quantization, and learn to use ollama with Lang chain.
run olama serve to expose an api server for communicating with a large language model, using port 11434, the generate endpoint, and llama 3.2.
Learn to build and test ai agents and chatbots using a link chain with ollama and local lms, set up a python venv, and work in vscode with lang chain.
Learn to write first LangChain code to chat with a local LLM via Ollama, configuring base URL, model, temperature, max tokens, and invoke chat interactions.
Set up Lang Smith for observability, debugging, and testing of LangChain code, view metrics in a GUI, load the env file and API key, and verify project settings.
Explore how to use LangChain prompt templates to build structured prompts, pass input variables, and invoke a local LLM via Ollama, creating streamlined chat interactions.
Learn to assign a role to a large language model with a chat prompt template, using system and user messages to drive tailored responses in local LLM workflows.
Learn to use message placeholders in a chat prompt template, including system, user, and human messages, and switch from invoke to streaming output for real-time LLM generation.
Explore Lange chain runnables, chaining, and how runnables execute actions like invoke with prompt templates and language models. Learn to connect runnable inputs and outputs to perform streaming, asynchronous operations.
Master the long chain expression language to declaratively build runnable chains from runnables for optimized runtime execution in LangChain, and learn to chain prompt templates with LM objects.
Learn to parse large language model outputs with a string output parser, chain parsers in a pipeline, and apply to JSON or CSV using LangChain core output parsers.
Demonstrate chaining multiple chains by passing outputs between runnables using templates, chat prompts, and input variables, then extract bullet point headings with a summary chain.
Explore runnable parallel to run multiple chains in parallel using two large language models, comparing true parallel execution with dependent chains, and leveraging local and cloud machines for faster results.
Use runnable lambdas to conditionally select a large language model in a chain, based on simple criteria, implemented with Python on a local LLM setup.
Discover how to implement a custom chain with the @Chain decorator by turning a method into a runnable for a chat bot workflow, including LM selection and memory-aware execution.
Discover how message history in LangChain preserves context for follow-up questions, and learn to implement chat history using session IDs, the runnable with history, and by installing langchain_community.
Use the message history runnable to manage and update conversation history across runnables, invoking history with a session ID and exploring three flavors: memory, SQL, and stream history storage.
Create a session ID and pass prompts and config to manage chat history in LangChain. Leverage the session history to answer with context for follow-up questions and multi-step conversations.
Store chat histories in a SQLite database using the SQL chat message history library, and retrieve them with get_session_history to validate persistent session data.
Explore building chatbots with local large language models and Ollama, using chat history and long chain context, implemented in Streamlit to run a session-based, question-answering workflow with dynamic prompts.
Build a streamlit-based UI for a chatbot, install and import streamlit, load the env, initialize the LM, and create a simple chat input to interact with the LM.
Create and manage chat session history in a Streamlit app by capturing user prompts and assistant responses, initializing session state, and rendering chat messages with markdown.
Maintain chat history in a Streamlit UI by preserving session state, preventing message overrides, and managing session IDs to enable multi-turn conversations.
Learn to manage chatbot sessions by starting new conversations and clearing session history. Integrate streamlit UI with LangChain prompts for local LLMs.
Learn to implement streaming chat responses in a Streamlit app using LangChain Stream, switching from chunked to real-time yields, and manage chat history for dynamic, live conversations.
Demonstrate cosmetic UI improvements for a chat bot, adding a sidebar with logo and user level inputs, while keeping chat history and system prompts intact on a local llm.
Upgrade to LangChain v1.0 and explore new features like simplified namespace, content block property, reasoning models, and context engineering for agents and messages, while noting breaking changes and migration guidance.
Explore building retrieval augmented generation apps using external data sources like PDFs, embedding into vectors, and storing in a vector database such as chroma to empower local LLM chatbots.
Explore the breaking changes in LangChain v1.0, including updates to code prompts imports and the chat prompt template. Compare with the older 0.3.0 version and follow the upgrade path.
Learn to extract multiple pdf files using the py pdf loader in a langchain workflow, creating a documents array for indexing in a vector database and previewing content.
Split a 253-page document into 1000-character chunks with 200-character overlap using the recursive character text splitter from long chain, preparing the data for embedding.
Learn to embed text into vectors with Ollama using the Llama 3.2 model, splitting data into chunks and generating comparable vectors for storage and retrieval with an LLM.
Learn how to store embedded vectors in a chroma vector database for retrieval-augmented generation, configure persistence, and set up LangChain chroma to power local RAG.
Learn how to index document chunks into a chroma vector store with LangChain, using embeddings and the from_documents method, then persist the data for retrieval with LLMs.
Retrieve data from vector stores using cosine-based similarity search and embeddings, surfacing documents and metadata as context for later generation by the large language model.
Learn how retrievers serve as a universal interface to fetch documents from any vector store, enabling seamless, similarity-based retrieval across backends and future data stores.
Combine manual retrieval from vector stores with LangChain prompts to create a merged context from retrieved documents and query an llm for accurate answers.
Address breaking changes in long chain v1.0, migrate to langchain_core.prompts.chat_prompts, and switch to the dot invoke method for document retrieval from vector stores.
Discover how to reuse third-party prompts from LangChain Hub, download a popular prompt, and load it with a single line of code. Explore text-to-SQL prompts and prepare for retrieval QA.
Learn to migrate from the deprecated LangChain hub import to LangChainHub with a client, pull prompts via hub.pull, and deserialize the JSON into a prompt dictionary.
Learn how to use RetrievalQA with LangChain to query vector stores and LLMs, returning source documents from PDFs in a RAG workflow.
Explore why retrieval QA is obsolete in LangChain v1.0 and learn to build a custom runnable QA chain with system prompts, chat prompt templates, and a retriever-based rag workflow.
Explore how tooling extends large language models by binding external tools and libraries. See how LangChain tool bindings and tools like Wikipedia, Bing, Brave, and DuckDuckGo search enable AI agents.
Extend local llms with agents using LangChain, RAG, and external documents, and explore community driven tools like Wikipedia and custom tools in a Jupyter notebook with Ollama.
Learn to build custom tools in LangChain by creating functions, runnables, or subclass tools with a name, description, arg, schema, and return, then invoke tools to empower AI agents.
Bind custom and community tools, including the Wikipedia tool, to a local llm with LangChain, and test how the model intelligently selects and invokes the right tool.
Bind custom tools to a local llm and create a prompt that combines user queries, ai messages, and tool execution logic to select and run the right tool.
Learn to invoke tools from a large language model, bind custom and Wikipedia tools, and run code blocks to retrieve answers and perform calculations with a local large language model.
Build & Test AI Agents, Chatbots, and RAG with Ollama & Local LLMs
This course is designed for complete beginners—even if you have zero knowledge of LangChain, you’ll learn step by step how to build LLM-based applications using local Large Language Models (LLMs).
The course is fully updated with LangChain v1.0.3
We’ll go beyond development and dive into evaluating and testing AI agents, RAG applications, and chatbots using RAGAs to ensure they deliver accurate and reliable results, following key industry metrics for AI performance.
What You’ll Learn:
Fundamentals of LangChain & LangSmith
Chat Message History in LangChain for storing conversation data
Running Parallel & Multiple Chains (RunnableParallels, etc.)
Building Chatbots with LangChain & Streamlit (with message history)
Understanding Tools and Tool chains in LLM
Building Tools and Custom Tools for LLM
Creating AI Agents using LangChain
Implementing RAG with vector stores & local LLM embeddings
Using AI Agents and RAG with Tooling while building LLM Apps
Optimizing & Debugging AI applications with LangSmith
Evaluating & Testing LLM applications with RAGAs
Real-world projects & hands-on testing strategies
Assessing RAG & AI Agents with RAGAs
This entire course is taught inside Jupyter Notebook with Visual Studio, providing an interactive, guided experience where you can run the code seamlessly and follow along effortlessly.
By the end of this course, you’ll be able to build, test, and optimize AI-powered applications with confidence!