langgraph/AGENTS.md
Igor Soarez 244ca657e4
docs: add "Direction: LangGraph is a runtime" section to AGENTS.md (#9439)
## What

Adds a "Direction" section to `AGENTS.md`, placed before the library
list so it frames how the rest of the file is read. It states the
project's strategic direction for contributors — human and coding-agent
alike:

- LangGraph is consolidating as the low-level **runtime** for agents and
workflows (graph execution, checkpointing, streaming, interrupt/resume),
and is moving away from being a friendly SDK for building agents
directly.
- Agent development belongs on a harness; Deep Agents (separate repo) is
the recommended one.
- Contributions are optimized for runtime correctness, reliability,
performance, and simplicity — not for the shortest agent example.

## Why

LangGraph today is both a runtime and an agent-building SDK. As agent
harnesses have consolidated, keeping both roles blurs the contribution
criteria: "should I add this convenience helper?" and "is this the right
place for this feature?" have no written answer. `AGENTS.md` is the
first thing a coding agent reads before touching this repo; giving it an
explicit direction makes that judgment mechanical and aligns
agent-generated contributions with where the project is going.

## Notes for reviewers

- **The ratchet is stated inline, not linked.** The section embeds the
stabilization rule ("one way to do each thing, and every change leaves
fewer ways than it found") directly, because that rule currently has no
home in this repo. If the full stabilization policy lands in
`CONTRIBUTING.md`, the bullet can shrink to a link and the "deprecation
process" reference can point at it.
- **Scope is explicit.** The consolidation mandate applies to the
runtime core (`langgraph`, `checkpoint*`); the client SDKs and CLI
remain ergonomic, as thin clients.
- **`prebuilt` is marked maintenance-only**, matching its state in code
(`create_react_agent` is already `@deprecated` in favour of
`langchain.agents`). The library list itself is unchanged in this PR;
rewording the `langgraph` and `prebuilt` descriptions could be a
follow-up.
- **Removal discipline is part of the section**: breaking changes must
be a PR's stated purpose and go through deprecation — never a side
effect of an unrelated change. The intent is to prevent agents from
over-reading the direction as license for opportunistic removals.
- **Companion PR:** a matching section adapted for
langchain-ai/langgraphjs follows.

Nothing here changes code or CI; this is a documentation-only change to
contributor guidance.
2026-10-26 15:56:56 +02:00

4.1 KiB
Raw Permalink Blame History

AGENTS Instructions

This repository is a monorepo. Each library lives in a subdirectory under libs/.

Corridor security analysis

When Corridor's analyzePlan tool is available, create a plan and use the tool to analyze it before generating or modifying code. Apply the resulting security guidance before writing code.

When you modify code in any library, run the following commands in that library's directory before creating a pull request:

  • make format – run code formatters
  • make lint – run the linter
  • make test – execute the test suite

To run a particular test file or to pass additional pytest options you can specify the TEST variable:

TEST=path/to/test.py make test

Other pytest arguments can also be supplied inside the TEST variable.

Direction: LangGraph is a runtime

LangGraph is consolidating as the low-level runtime for agents and workflows: graph execution, checkpointing, streaming, and interrupt/resume. Critical production systems and agent harnesses run on it, so correctness and stability come first. It is moving away from being a friendly SDK for building agents directly; agent development belongs one layer up, on a harness — Deep Agents (github.com/langchain-ai/deepagents, a separate repo) is the recommended one.

Optimize contributions for runtime correctness, reliability, performance, and simplicity — not for the shortest agent example.

  • One way to do each thing. A change never adds a way; removals are always deliberate (see below). The number of ways only goes down. No aliases, overloads, extra accepted types, implicit defaults, or customization hooks for convenience: ergonomics alone never justify new public surface.
  • The mandate applies to everything that implements runtime behavior, in whichever repo it lives: the graph engine (langgraph, langgraph-core), the checkpointers (checkpoint*), and the server (langgraph-api). The client SDKs and CLI stay ergonomic but are thin, faithful clients, never a second implementation of runtime behavior.
  • Agent-level packages (prebuilt, langgraph-supervisor, langgraph-swarm, langgraph-cua) are maintenance-only: fix bugs, don't add agent features. New examples and docs that build agents should use Deep Agents.
  • Remove deliberately, not opportunistically. Removing or changing public behavior must be the stated purpose of the PR and go through the deprecation process — replacement in place, removal version recorded, migration note. Never drop a default or overload as a side effect of an unrelated change.
  • Behavior changes land in Python and JS together (the implementations live in separate repos; note in the PR when the other one needs a matching change).
  • If a task asks for something this section rules out, say so and propose the runtime-level or harness-level alternative instead of quietly implementing it.

Libraries

The repository contains several Python and JavaScript/TypeScript libraries. Below is a high-level overview:

  • checkpoint – base interfaces for LangGraph checkpointers.
  • checkpoint-postgres – Postgres implementation of the checkpoint saver.
  • checkpoint-sqlite – SQLite implementation of the checkpoint saver.
  • cli – official command-line interface for LangGraph.
  • langgraph – core framework for building stateful, multi-actor agents.
  • prebuilt – high-level APIs for creating and running agents and tools.
  • sdk-js – JS/TS SDK for interacting with the LangGraph REST API.
  • sdk-py – Python SDK for the LangGraph Server API.

Dependency map

The diagram below lists downstream libraries for each production dependency as declared in that library's pyproject.toml (or package.json).

checkpoint
├── checkpoint-postgres
├── checkpoint-sqlite
├── prebuilt
└── langgraph

prebuilt
└── langgraph

sdk-py
├── langgraph
└── cli

sdk-js (standalone)

Changes to a library may impact all of its dependents shown above.

  • Do NOT use Sphinx-style double backtick formatting (``code``). Use single backticks (`code`) for inline code references in docstrings and comments.