What is LangChain?
Lessons 1–3 covered models and websites. LangChain is the library we will use to call those models from Python. Still no coding here — just the idea, with one concrete flow.
Not a chatbot — a toolkit
LangChain is an open-source Python library (there is a JavaScript version too). It is not an LLM like ChatGPT or Claude. You install it in your project, point it at a provider's API, and write a few lines to send prompts and read replies.
Think of it as shared plumbing. Every LLM vendor has slightly different request formats, error codes, and model names. LangChain wraps those differences so you can try OpenAI first and swap later without rewriting the whole script.
An example
Say QList adds a small helper on an HTML tutorial page — next to the HTML/CSS/JS playground. A learner types a question; your Python file forwards it through LangChain to the OpenAI API using the key from Lesson 2. LangChain handles the prompt shape and the HTTP call; you print the text back to the page.
An HTML tutorial helper — one question, one answer:
Your script
html-tutorial-helper.py
"What does the <a> tag do in HTML?"
LangChain
format prompt · call model · return text
Reply
"The <a> tag creates a hyperlink. Put the URL in the href attribute, e.g. <a href='/playground/html-css-js'>Try it</a>."
Words you will see in docs
Tutorials jump straight into these terms. A quick map before we open a terminal:
Model — the connection to GPT-4o, Claude, Mistral, or a local Ollama install.
Prompt template — a string with slots, e.g. "Explain this HTML topic for a beginner: {question}".
Chain — two or more steps run in sequence: fill the template, call the model, trim the output.
Memory — optional; stores earlier messages when you need a back-and-forth chat instead of one shot.
Get started
Core components
LangChain overview
📋 Copy pageAgent = Model + Harness. LangChain provides create_agent: a minimal, highly configurable harness. The harness is everything around the model loop: the prompt, the tools, and any middleware that shapes behavior. Start with the primitives and compose exactly what your use case needs. Supports OpenAI, Anthropic, Google, and more.
LangChain vs. LangGraph vs. Deep Agents
Start with Deep Agents if you want a batteries-included agent with automatic context compression, a virtual filesystem, and subagent-spawning. Deep Agents are built on LangChain agents, which you can also use directly.
Use LangChain (create_agent) when you need a highly customizable harness tailored to your use case and data.
Do you need it?
For a single hard-coded question you could call the OpenAI HTTP API directly. LangChain starts to pay off when you have several prompts, might change provider, or want memory and tool hooks without inventing your own structure.
Source and release notes live on GitHub. Module 2 starts with an OpenAI account and API key — then we install the package and run a short script.
What's Next
Module 1 ends here. Next: create your OpenAI platform account and generate an API key.