Skip to main content

LangGraph abstractions for hierarchical multi-agent systems

Project description

langgraph-hierarchies

Status: early development (0.0.x). API and scope are not stable. v0.1 will ship the keystone slice below.

Stateful, deeply-nested compiled-subgraph agent hierarchies on LangGraph — with declarative per-subchain state isolation and supervisor-controlled iteration safety.

Flat delegation (Deep Agents, supervisor handoffs) is a good starting point. This library targets the production wall past that: recursive hierarchies where subagents are real compiled subgraphs, with explicit clear/merge/discard policy across state fields — not ephemeral task-tool isolation alone.

How this relates to other libraries

langgraph-supervisor Deep Agents langgraph-hierarchies
Model Supervisor → workers (handoff tools) Harness + subagents (task / programmatic task()) Class-as-factory graphs, phased compile, SubchainPolicy
Nesting Multi-level supervisors Fan-out / data recursion (partial); not stateful deep trees Recursive compiled subgraphs + declarative state policy
Best for Quick hierarchical routing General long-horizon agents Production-grade deep hierarchies with accountability

Deep Agents already covers fan-out, parallel orchestration, and RLM-style recursion over data (programmatic subagents, June 2026). This project does not try to replace that.

Compatibility

langgraph-hierarchies langgraph
0.0.x 1.2.6 (pinned; see releases)

Regression tests gate version bumps. A pair is listed here only once the full suite is green for it.

Bumping the langgraph pin

  1. Update the langgraph constraint in pyproject.toml.
  2. Refresh the lockfile: uv sync.
  3. Run the full suite: uv run pytest.
  4. To isolate a failing story, run e.g. uv run pytest -m us04.
  5. When the suite is green, update the compatibility matrix above and cut a release.

CI runs ruff and pytest on every push/PR (Python 3.10–3.13). Tests use scripted models only — no LLM API keys required.

What's in 0.0.2

  • BaseGraph / CompiledGraph + phased compilation
  • SubchainPolicy (entry snapshot, clear/merge/discard, exit restore)
  • ReactGraph + iteration safety (per-agent limits, supervisor task_iterations, forced-exit report)
  • Root compile (compile_as_root) and unified invocation
  • Compatibility harness (per-story pytest markers, CI)
  • TodoGraph + todo toolkit; IRS hierarchy example in repo (examples/irs_reporting/)

Planner/Executor, progress tracking, HITL: follow-on after v0.1.

Install

pip install langgraph-hierarchies

Requires Python ≥3.10 (matches LangGraph).

Development

Uses uv (same toolchain as upstream LangGraph):

uv sync
uv run pytest
uv build   # sdist + wheel for PyPI

Disclaimer

This project is not affiliated with, endorsed by, or maintained by LangChain or the LangGraph team. “LangGraph” is a trademark of LangChain; this package name indicates compatibility with the LangGraph runtime, not official status.

Contact

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langgraph_hierarchies-0.0.2.tar.gz (129.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langgraph_hierarchies-0.0.2-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file langgraph_hierarchies-0.0.2.tar.gz.

File metadata

  • Download URL: langgraph_hierarchies-0.0.2.tar.gz
  • Upload date:
  • Size: 129.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for langgraph_hierarchies-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c6c03b6b1406b6557e15470ce60f510ab6bf1eb0cf36f514ebf62139cd332b5d
MD5 40730f75e6a7d02f72da256b8b387f15
BLAKE2b-256 40adce90d2600503ad9cebabb20d290b636584f034bd5694509bc362eb1f6d34

See more details on using hashes here.

File details

Details for the file langgraph_hierarchies-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: langgraph_hierarchies-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for langgraph_hierarchies-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8068c15cd953b383041a05a4a3b21fd0be683ed6a2724baafba64cf53556c1df
MD5 3553b99c9c975f49e594056cb367793b
BLAKE2b-256 40874d290881e73b4ebebf2b4cee2307a0aadf1efed72d08154f45c9abd26519

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page