Learn LangChain

Purpose and Scope

This page gives a practical learning path for developers who are starting with LangChain in this repository and want to know what to study first, what to defer, and how the package READMEs connect to the official Learn section. LangChain is presented at the repository root as an agent engineering platform for building agents and LLM-powered applications from interoperable components and third-party integrations. That framing matters because the best learning route is not only API memorization; it is learning how models, tools, retrieval, tracing, and orchestration fit together into maintainable agent systems.

Sources: README.md, libs/langchain_v1/README.md

The recommended path starts with the main langchain package because it is described as the easiest way to begin building agents and LLM applications. The package README emphasizes quick agent development, pre-built agent architecture, model integrations, and provider choice across OpenAI, Anthropic, Google, and other integrations. The root README adds the minimal first-run experience with uv add langchain, init_chat_model, and a direct model invocation, which is the right first milestone before moving into agents, retrieval, or production workflows.

Sources: README.md, libs/langchain_v1/README.md

The official Learn index broadens that first milestone into a curriculum. It organizes tutorials by framework: Deep Agents for higher-level agent capabilities, LangChain for simple agent and retrieval use cases, LangGraph for fine-grained orchestration, and multi-agent tutorials for patterns that combine LangChain agents with LangGraph workflows. Use those categories as levels of control. Start with LangChain when you need quick application progress, reach for Deep Agents when common long-running agent capabilities are already part of the problem, and study LangGraph when deterministic workflow structure or deeper customization becomes the main challenge.

Sources: README.md, libs/langchain_v1/README.md

Relevant Source Files

  • README.md — Defines the repository-level positioning of LangChain as the agent engineering platform, shows the shortest Python quickstart, and points readers toward Deep Agents, LangGraph, integrations, LangSmith, and LangChain.js.
  • libs/core/README.md — Explains langchain-core as the package of base abstractions that power the ecosystem, including the reason provider implementations can work through common interfaces.
  • libs/langchain_v1/README.md — Describes the current langchain package, its quick install command, its role as the easiest path for agents and LLM applications, and its relationship to LangGraph-powered agent capabilities.

Begin by installing and invoking a model. The repository quickstart intentionally keeps the first exercise small: add the package, initialize a chat model, and call invoke. This step teaches the most important operational shape of LangChain: application code talks to a standard component interface rather than hard-coding every provider interaction. Do not skip this because later topics such as output parsing, retrieval, tool calling, tracing, and evaluation all build on the same habit of composing components and passing inputs through predictable interfaces.

Sources: README.md

uv add langchain
from langchain.chat_models import init_chat_model
 
model = init_chat_model("openai:gpt-5.5")
result = model.invoke("Hello, world!")

After the first model call, learn the current langchain package as the default application layer. Its README says LangChain provides pre-built agent architecture and model integrations so developers can quickly incorporate LLMs into agents and applications. Treat this as the phase where you build a small but real task: a semantic search application, a RAG agent, a SQL agent with review, or a voice agent. Those examples match the Learn index because they force you to combine a model with data, tools, or user interaction without requiring you to design a full orchestration runtime from scratch.

Sources: libs/langchain_v1/README.md

Next, study langchain-core so the higher-level examples do not feel magical. Core contains the base abstractions that power the ecosystem, and its README stresses modularity, stability, and provider-independent interfaces. This is where terms such as model, message, prompt, output parser, retriever, vector store, runnable, and tool become reusable building blocks instead of one-off tutorial objects. Learning Core early helps you understand why integrations can be swapped, why components compose, and why a chain or agent can often be tested, traced, evaluated, or configured through common runtime conventions.

Sources: libs/core/README.md

Once you can build a small LangChain app and recognize its components, move into agent concepts. The langchain README states that LangChain agents are built on top of LangGraph to provide durable execution, streaming, human-in-the-loop behavior, persistence, and more, while also clarifying that basic LangChain agent usage does not require learning LangGraph first. That is the key sequencing rule: use LangChain agents to learn the product-level agent authoring model, then study LangGraph when you need explicit control over graph structure, deterministic branches, latency, persistence, or custom runtime behavior.

Sources: libs/langchain_v1/README.md

Core Primitives to Learn

A model is the first primitive because it is the component that turns application inputs into generated responses. LangChain’s quickstart uses init_chat_model and invoke, while the package documentation highlights model integrations across major providers. Learn this primitive together with messages and prompts: messages represent conversational roles and content, while prompts shape the instructions and variables sent to the model. The official LangSmith runnable example also shows a common composition pattern where a prompt, model, and string output parser are connected into a runnable chain for evaluation.

Sources: README.md, libs/langchain_v1/README.md

Tools and integrations are the next primitive group because agents become useful when they can act outside the model call. The repository README names integrations as chat and embedding models, tools and toolkits, vector stores, retrievers, and more. In learning terms, local tools are Python functions or objects your app exposes to an agent, while provider integrations connect LangChain interfaces to external model, search, database, or storage services. The Learn index’s RAG, SQL, and semantic search tutorials are good exercises because they make that distinction concrete.

Sources: README.md

Retrieval primitives deserve their own pass after you understand tools. Retrieval-augmented generation uses documents, embeddings, vector stores, and retrievers to connect models to real-time or application-specific data. The root README lists real-time data augmentation as a reason to use LangChain, emphasizing connections to diverse data sources, external systems, vector stores, and retrievers. A good learning milestone is to build semantic search over a PDF, then turn the same retrieval path into a RAG agent that can decide when to consult the retriever.

Sources: README.md

Runtime and operations primitives come after application composition. The repository README points developers to LangSmith for developing, debugging, and deploying AI agents and LLM applications, and the package READMEs describe LangSmith as a unified platform for building, testing, and monitoring LLM applications. The official tracing guide says LangSmith can trace LangChain code without extra application logic once the environment is configured, and the runnable evaluation guide shows passing LangChain runnables directly to evaluation functions. Learn tracing and evals before a prototype becomes production-critical.

Sources: README.md, libs/core/README.md, libs/langchain_v1/README.md

Connections, MCP, and OpenAPI fit into the learning path as connectivity topics rather than replacements for local tools. Official docs mention connecting documentation to development environments through MCP for real-time answers, and the broader LangChain documentation treats external connectivity as part of building useful agents. In practice, learn local tool calling first, then study MCP when tools or context are provided by an external protocol server, and study OpenAPI-style connectivity when the agent needs to call HTTP APIs described by a schema. Those topics are best approached after core tool semantics are clear.

Sources: README.md

System-to-Code Mapping

The root README is the top-level orientation layer. It names the platform, explains why LangChain exists, and shows the smallest executable model example. It also maps the ecosystem around the repository: Deep Agents for higher-level agent patterns, LangGraph for controllable agent workflows, integrations for provider and external-system connectivity, LangSmith for evals and observability, and LangSmith Deployment for long-running stateful workflows. When you are learning, return to this file to decide whether your next problem is application composition, orchestration, integration, observability, or deployment.

Sources: README.md

The libs/langchain_v1/README.md file is the package-level map for the current langchain distribution. It is the source to consult when your immediate goal is building agents quickly with the main package. Its guidance draws a boundary between LangChain and LangGraph: LangChain is recommended for quick autonomous applications, while LangGraph is recommended for advanced needs involving deterministic and agentic workflows, heavy customization, and carefully controlled latency. That distinction prevents over-engineering early tutorials while still giving a path to deeper runtime control.

Sources: libs/langchain_v1/README.md

The libs/core/README.md file is the abstraction map. It explains that langchain-core is intentionally modular and not tied to any provider, so implementations can satisfy required interfaces and work throughout the ecosystem. For learning, this means you should not treat provider-specific packages as the conceptual center of LangChain. Instead, learn the shared contract first, then plug in providers. This also makes code easier to evaluate and trace, because chains, chat models, retrievers, and other components can participate in common runnable-style workflows.

Sources: libs/core/README.md

Practical Study Plan

A practical first week can be organized around four outcomes. First, run the quickstart and swap the model identifier or provider package only after the basic invocation works. Second, build one tutorial-sized app from the official Learn list, preferably semantic search or a RAG agent, so you experience data augmentation. Third, read the Core README and map each object in your app to a primitive such as model, prompt, retriever, vector store, tool, or parser. Fourth, enable LangSmith tracing and inspect the run structure before adding more features.

Sources: README.md, libs/core/README.md, libs/langchain_v1/README.md

For the second week, choose a specialization based on the application you are actually building. If the app needs reliable multi-step execution, learn LangGraph after understanding that LangChain agents already use LangGraph capabilities under the hood. If the app needs user review, study human-in-the-loop workflows through the agent documentation. If it needs reusable external actions, study tools, MCP, and OpenAPI connectivity. If the app is moving toward production, prioritize tracing, evaluation, rate limiting, and deployment topics before broadening into many provider integrations.

Sources: README.md, libs/langchain_v1/README.md

Next Steps

Continue with the quickstart page when you want a first working agent path, then read component-architecture to understand how components compose across packages. Follow with runnables-lcel, tools, retrievers, and callbacks-observability as your application grows from a model call into a production workflow. If your use case requires deeper control than the pre-built agent path, read the LangGraph-oriented material after the LangChain agent basics; the package README explicitly positions LangGraph as the lower-level orchestration framework for advanced customization.

Sources: libs/langchain_v1/README.md