LangChain Tutorial for Beginners: Messages, Roles and LangSmith Setup @KGPTalkie
LangChain Tutorial for Beginners: Messages, Roles and LangSmith Setup  @KGPTalkie
Uploaded August 2026 | Updated September 2026, 2 weeks ago
๐Ÿš€ The LangChain 10 Days FREE Bootcamp is live: 10 lessons, free AI models only, from your first API call to a production grade RAG agent. Start with Day 0 for the roadmap and setup.

๐Ÿ“บ Full playlist: youtube.com/watch?v=KJ3_NExk7-Q&list=PLW4pPr9JCovI&index=1

----------

Day 2 of the free LangChain 10 Days Bootcamp. This lesson covers the three message types every LangChain app is built on (SystemMessage, HumanMessage, AIMessage) and a free LangSmith setup so you can see exactly what your model is doing on every call.

We start with how LLM roles map to LangChain classes, then wire up LangSmith tracing so each call is logged with its full input, output, and token usage. After that we run the same question through different system prompts (pirate, calm support agent, rhyming couplets) and hit a case where the model flat out refuses to take the role. We also measure what a long system prompt actually costs you in input tokens, and close with a prompt injection attempt against a strict no-refund support agent. Everything here is self-contained, so you can follow along even if you're new to LangChain.

๐Ÿ“บ Full playlist (LangChain 10 Days Bootcamp): youtube.com/playlist?list=PLW4pPr9JCovI

โฑ Chapters:
0:00 Intro and Day 1 Recap
0:45 The Three LLM Roles: System, Human, AI
1:31 How model.invoke Maps to Human and AI Messages
2:36 Why the System Message Matters
3:49 Same Question, Three Different System Prompts
5:26 LangSmith Setup for LLM Observability
6:54 Creating Your LangSmith API Key
7:36 Adding LangSmith Keys to Your .env File
9:11 Loading the Model and Environment in the Notebook
10:51 Your First Call with System + Human Messages
12:07 Viewing the Trace Inside LangSmith
13:52 Pirate Role Test: When the LLM Ignores Your Prompt
15:49 Calm Support Agent Role
17:01 Rhyming Couplets Role
17:45 How Many Tokens Does a System Prompt Cost?
19:47 Strict System Prompt: The No-Refund Agent
20:13 Prompt Injection and Jailbreaking the LLM
22:16 Formatting Messages with pretty_print
23:45 Wrap-Up and What's Next

๐Ÿ”— Resources:
Code + slides (GitHub): github.com/laxmimerit/Langchain-10-Days-Bootcamp
LangSmith (free signup): smith.langchain.com
Free model used (Ling 3.0 Tiny): openrouter.ai/inclusionai/ling-3.0-tiny:free
LangChain install docs: docs.langchain.com/oss/python/langchain/install

๐Ÿ“บ Watch first (Day 1: Free AI API Setup with OpenRouter):
youtu.be/EMRRGr-uYkU

๐ŸŽ“ Level up with my Udemy course:
Master LangChain v1 and Ollama - Chatbot, RAG and AI Agents: kgptalkie.com/langchain

If this cleared up how messages and roles work, leave a like and tell me in the comments which system prompt gave you trouble. Subscribe so you catch the rest of the bootcamp.

#LangChain #LangSmith #GenerativeAI #PromptEngineering #LLM
LangChain Tutorial for Beginners: Messages, Roles and LangSmith SetupBuild Finance RAG in Less than 10 Minutes with OpenAI Agent BuilderWhat is Memory Engineering? Agentic AI Engineering Explained (2026)MCP Tutorial 1 - Control Web Browser with Playwright MCP Server and AIHermes vs OpenClaw: Which AI Agent Is Better?AWS CLI Tutorial 1- How to Install AWS CLI and AWS CLI AutocompleteConnect Hermes Agent to Discord: Control Your AI Agent From Your Phone (2026)GGPlot Tutorial 1- Introduction to GGPLOT2 Part 1/20Hermes Agent Lead Generation Automation - Unlimited Leads/DayNLP Projects 3 - Twitter Sentiment Analysis with Random Forest and Streamlit App20 Common words removal | Text Preprocessing and Mining for NLP | KGP Talkie07 Gen AI Interview Preparation: What is Tokenization in LLM  #ai #genai #generativeai #interview
KGP Talkie |

LangChain Tutorial for Beginners: Messages, Roles and LangSmith Setup

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER