Getting Started with LangChain: Understanding Agents, Models, and Tools
June 1, 2026
Getting Started with LangChain: Understanding Agents, Models, and Tools
Introduction
When developers first hear about AI agents, they often imagine complex autonomous systems that can think, plan, and act independently. In reality, most modern AI agents are built using a simple but powerful idea:
Agent = Model + Harness
This concept sits at the heart of LangChain.
In this article, we'll learn what LangChain is, why it exists, and how agents use tools to interact with the outside world.
Why LangChain Exists
Every LLM provider exposes a different SDK, API structure, authentication mechanism, and feature set.
Without LangChain, switching from one provider to another often requires rewriting large portions of your application.
LangChain provides a standardized abstraction layer over multiple providers, allowing developers to focus on building applications rather than managing provider-specific code.
Understanding the Agent = Model + Harness Concept
An agent is not just an LLM.
Think of an agent as:
Agent = Model + Harness
The Model is the LLM itself.
The Harness is everything around the model that enables it to perform useful work:
- Tools
- Memory
- State
- Prompt management
- Execution logic
Architecture
Installing LangChain
npm install langchain @langchain/core
npm install @langchain/openai
Creating a Simple Agent
import { createAgent } from 'langchain';
const agent = createAgent({
model: 'gpt-5.4'
});
The createAgent() function acts as a minimal and highly configurable harness around your model.
How Agent Execution Works
- User sends a request.
- Agent forwards the request to the model.
- Model determines whether tools are required.
- Agent executes tools if necessary.
- Results are returned to the model.
- Final answer is generated.