Quickstart
Purpose and Scope
This quickstart gives you the shortest useful path from an empty Python project to a working LangChain call, then shows how that first call fits into the larger agent engineering platform. LangChain describes itself as a framework for building agents and LLM-powered applications, with interoperable components and third-party integrations that let you change providers or add capabilities without rewriting the whole application. The repository-level README starts with a minimal install and model invocation, while the current package README explains that the main langchain package is intended for quickly building agents and autonomous applications.
Sources: README.md, libs/langchain_v1/README.md
The first milestone is deliberately small: install the main package, initialize a chat model, and invoke it with a prompt. That gives you a working runtime boundary before you add tools, retrieval, persistence, streaming, or orchestration. The official quickstart material around Deep Agents and Managed Deep Agents expands this into hosted or JavaScript workflows, but the repository source points Python users to the langchain package first. Use LangGraph when your application needs lower-level control over deterministic and agentic workflow steps; basic LangChain agent usage does not require learning LangGraph up front.
Sources: README.md, libs/langchain_v1/README.md
Relevant Source Files
README.md— repository landing page that presents LangChain as the agent engineering platform and shows the minimaluv add langchainplusinit_chat_modelquickstart.libs/langchain_v1/README.md— README for the currentlangchainpackage, including the package purpose, install command, agent positioning, and relationship to LangGraph.libs/core/README.md— README forlangchain-core, the package that provides base abstractions used across model providers and the rest of the ecosystem.libs/README.md— monorepo map that explains wherecore/,langchain/,langchain_v1/,partners/,standard-tests/, andtext-splitters/live.libs/langchain/langchain_classic/document_loaders/parsers/language/javascript.py— compatibility module inlangchain-classicthat dynamically re-exportsJavaScriptSegmenterfromlangchain_communitythrough a deprecated lookup.
First Working Program
Start by adding the main package to your project. The root README and the libs/langchain_v1/README.md package README both use uv add langchain as the quick install command. After installation, initialize a chat model with init_chat_model and call invoke with a simple prompt. The model string in the README uses a provider-qualified form, openai:gpt-5.5, which demonstrates the convention of selecting a provider integration and model through a single identifier. In a real project, also set the API key required by your chosen provider before running the script.
Sources: README.md, libs/langchain_v1/README.md
uv add langchainfrom langchain.chat_models import init_chat_model
model = init_chat_model("openai:gpt-5.5")
result = model.invoke("Hello, world!")
print(result)This program proves three things at once. First, the import path comes from the user-facing langchain package rather than from a provider-specific SDK. Second, model creation is separated from invocation, which is the pattern you will reuse when you add tools, prompts, middleware, or structured output. Third, the result is produced through a standard chat model interface rather than a one-off provider call. That interface is part of the reason LangChain can advertise model interoperability: teams can experiment with providers while keeping the surrounding application structure stable.
Sources: README.md, libs/langchain_v1/README.md, libs/core/README.md
Core Primitives
The most important primitive in the first program is the chat model. A chat model is the component that receives messages or text-like input and returns an AI response. The quickstart uses init_chat_model because the current package is designed to get you connected to OpenAI, Anthropic, Google, and other providers quickly. Under the package boundary, the ecosystem depends on langchain-core, which defines base abstractions that providers can implement. That split keeps the public application code small while allowing integrations to evolve independently.
Sources: libs/langchain_v1/README.md, libs/core/README.md, libs/README.md
Agents are the next primitive to understand after a direct model call. The current package README says LangChain provides a pre-built agent architecture and model integrations for quickly incorporating LLMs into agents and applications. The root README also points new users toward Deep Agents when they want built-in planning, subagents, file-system usage, and common higher-level agent patterns. Official quickstart guidance for Deep Agents adds the practical requirements: choose a tool-calling-capable model, set provider API keys, and optionally use the LangChain Docs MCP server so an AI coding assistant can access current documentation and examples.
Sources: README.md, libs/langchain_v1/README.md
Tools, MCP, and hosted execution are complementary rather than interchangeable. Local tools are functions or integrations your agent can call inside your application process. MCP, or Model Context Protocol, is a way to connect an assistant or development environment to external capabilities such as documentation servers; the official quickstart specifically recommends the LangChain Docs MCP server for coding-assistant workflows. Managed Deep Agents, by contrast, are hosted by LangChain and can be created with a CLI or SDK, then streamed through SDKs or React clients. Keep those deployment choices separate from the first local model call.
Sources: README.md, libs/langchain_v1/README.md
System-to-Code Mapping
The monorepo layout helps explain why the first import is intentionally high level. libs/langchain_v1/ is the current langchain package and is the right starting point for new applications. libs/core/ contains the base abstractions that make provider implementations and application components interoperable. libs/partners/ contains a subset of third-party provider integrations maintained directly by the LangChain team, while many other integrations live in separate repositories. libs/langchain/ is langchain-classic, which preserves legacy chains, community re-exports, the indexing API, and deprecated functionality for existing users.
Sources: libs/README.md, libs/langchain_v1/README.md, libs/core/README.md
The requested source path, libs/langchain/langchain_classic/document_loaders/parsers/language/javascript.py, illustrates that compatibility layer. It defines a DEPRECATED_LOOKUP for JavaScriptSegmenter, creates an importer with create_importer, and implements __getattr__ so the old attribute can be resolved dynamically from langchain_community.document_loaders.parsers.language.javascript. That file is not part of the first model invocation, but it is useful context for repository readers: the monorepo contains both the modern quickstart package and classic modules that keep older import paths functioning while warning or redirecting users.
Sources: libs/langchain/langchain_classic/document_loaders/parsers/language/javascript.py
Execution Flow
A practical first session should follow a narrow sequence. Create or choose a Python project, add langchain, set the provider API key required by the model identifier you plan to use, then run the minimal script. If the call succeeds, commit that baseline before adding agent behavior. Next, decide whether your application needs only a direct model call, a LangChain agent with tools, a Deep Agents-style workflow with planning and subagents, or a LangGraph workflow with explicit state transitions and durability requirements. This keeps early debugging focused on credentials and model access rather than on orchestration design.
Sources: README.md, libs/langchain_v1/README.md
When you are ready to move beyond the first call, add one capability at a time. For an agent, start with a model that supports tool calling, then register a small tool whose inputs and outputs you can inspect. For retrieval, use document loading, splitting, embeddings, vector stores, and retrievers in a separate indexing path before wiring them into a prompt or agent. For production work, bring in LangSmith for debugging, tracing, evaluation, and monitoring; both the root README and package READMEs point to LangSmith as the companion platform for developing and operating LLM applications.
Sources: README.md, libs/langchain_v1/README.md, libs/core/README.md
Next Steps
After this quickstart, read the component architecture and language model pages to understand the contracts behind init_chat_model and invoke. Then read the agents, tools, structured output, and event streaming pages before building a user-facing agent. If you are maintaining older code, keep the langchain-classic compatibility boundary in mind and prefer the current langchain package for new work. If you are using an AI coding assistant, install the LangChain Docs MCP server recommended by the official quickstart so examples and terminology stay aligned with the current docs.
Sources: README.md, libs/langchain_v1/README.md, libs/langchain/langchain_classic/document_loaders/parsers/language/javascript.py