LangGraph PHP Alternatives and How to Choose the Right One

If you want stateful, cyclical, resumable agent workflows in PHP like LangGraph, you have several options. PHP now has native implementations, Laravel packages, and a direct PHP SDK port. They all aim to keep agent orchestration inside the PHP stack. Compared with Python LangGraph, PHP options win on stack consistency and business system integration, and trail on ecosystem maturity and advanced state management.

Can You Run LangGraph in PHP?

No, you cannot run the Python version of LangGraph directly in PHP. The PHP ecosystem reimplements or adapts graph orchestration inside PHP.

Python LangGraph installs with:

pip install -U langgraph

PHP options use their own package management. This article compares capabilities and trade-offs. The LangGraph-like capabilities include multi-agent collaboration, human-in-the-loop, state persistence, RAG, toolkits, cyclic graphs, database- and queue-driven execution, and checkpointing.

Six PHP Alternatives and How to Pick by Stack and Task

If you are on Laravel, start with LaraGraph. If you need cross-framework support and full agent capabilities, start with Neuron AI. The other four cover direct porting, graph workflows, minimal learning, and Pest style.

Option Type Core Features Best For
Neuron AI Framework-agnostic full Agentic framework The most complete LangGraph alternative in the PHP ecosystem. It provides multi-agent collaboration, human-in-the-loop, state persistence, RAG, and built-in toolkits. Teams building complex production agent systems across frameworks such as Laravel, Symfony, or plain PHP.
LaraGraph Native Laravel package Designed for Laravel. It adapts LangGraph-style cyclic graphs to PHP’s stateless architecture and runs entirely on database and queue execution. Projects already using Laravel that want deep integration with Eloquent, queues, and native Laravel features.
langgraph/langgraph-php Direct PHP SDK port A direct PHP implementation of Python LangGraph concepts, including StateGraph, nodes, edges, and checkpointing. Developers familiar with LangGraph concepts who want a similar API experience in PHP.
Nexus AI Workflows Graph workflow orchestration engine Provides a fluent WorkflowBuilder API and supports eight node types, including condition, loop, parallel, and sub-workflow. It also offers resumable execution, middleware, and observability. Complex flows that need fine-grained workflow control, middleware, and event systems.
PocketFlow PHP Minimalist graph framework About 400 lines of pure PHP. Framework-agnostic, zero bloat, and focused on core graph execution, node, and flow abstractions. Developers who want extreme lightweight control and want to manage dependencies and extensions themselves.
Pagent Pest-style agent framework Provides a fluent agent configuration API, automatic tool calling, multi-agent workflows, evaluation, and OpenTelemetry tracing. Teams that prefer a Pest-style declarative API and need built-in evaluation and tracing.

Neuron AI

Neuron AI is best for enterprise-grade complex agent systems. It has the broadest capability coverage in the PHP ecosystem, works across frameworks, and can run alongside an existing PHP application. It can access local ORM and Redis directly, which avoids cross-service latency. Its feature set includes multi-agent collaboration, human-in-the-loop, state persistence, RAG, and built-in toolkits.

LaraGraph

LaraGraph is best for Laravel projects. It adapts LangGraph-style cyclic graphs to PHP’s stateless architecture. Each node runs as an independent queue job. Concurrency and horizontal scaling depend on Laravel’s database and queue system. It integrates deeply with Eloquent and other native Laravel capabilities.

langgraph/langgraph-php

langgraph/langgraph-php is best for developers already familiar with LangGraph concepts. It is a direct PHP port with StateGraph, nodes, edges, checkpointing, and other core components. The API mapping is direct, so concept migration is low-cost.

Nexus AI Workflows

Nexus AI Workflows is best for projects with complex workflow structures. It provides a fluent WorkflowBuilder API and supports eight node types, including condition, loop, parallel, and sub-workflow. It also offers resumable execution, middleware, and observability. This suits flows that need fine-grained control.

PocketFlow PHP

PocketFlow PHP is best for developers who want extreme lightweight control. It is about 400 lines of pure PHP, framework-agnostic, and has zero bloat. It provides only core graph execution, node, and flow abstractions. Everything else, including dependencies and extensions, is up to you.

Pagent

Pagent is best for teams that prefer a declarative API. It offers Pest-style agent configuration, automatic tool calling, multi-agent workflows, evaluation, and OpenTelemetry tracing.

Advantages of PHP Alternatives Over Python LangGraph

The most practical advantage is stack consistency. Your team does not have to switch to Python for agent orchestration.

Agent logic and business logic can share the same codebase and deployment pipeline. Database, cache, authentication, and middleware stay in the existing PHP environment. Development, debugging, and release do not require a cross-language setup. For projects already running core business logic in PHP, this difference shows up directly in maintenance cost.

Deep integration with existing systems is another strength. LaraGraph is driven entirely by Laravel’s database and queue system. Each node runs as an independent queue job, which gives it native concurrency and horizontal scaling. Neuron AI emphasizes co-living with existing PHP applications. It can access local ORM and Redis directly and avoid cross-service latency.

Team onboarding is easier. PHP engineers build agents with a familiar language and patterns. The learning curve is much lower than moving to the Python ecosystem. One of Neuron AI’s design goals is to make onboarding cost almost 0.

Drawbacks of PHP Alternatives

The gaps are mostly in ecosystem and advanced capabilities, not in whether basic workflows can run.

Ecosystem maturity and community size still lag. Python LangGraph has a larger community, richer integrations, and broader commercial adoption. PHP options started later, and the ecosystem is still being built. There are fewer reference cases and third-party extensions.

Feature depth and advanced abstractions are still catching up. LangGraph has deeper experience in long-flow state management, fine-grained streaming control, and seamless integration with the LangChain ecosystem. PHP options are still catching up on state persistence granularity and checkpoint completeness.

Talent availability is another practical issue. There are far more developers familiar with the Python AI ecosystem than with PHP AI frameworks. This can create challenges in hiring and team expansion.

How to Choose

Choose by framework, task complexity, and team preference. Do not pick based only on the length of a feature list.

  • In the Laravel ecosystem, LaraGraph has the highest integration level. It fits workflows into the familiar queue and database system.
  • If you need broader agent capabilities, such as built-in RAG and toolkits, Neuron AI is also fully compatible with Laravel.
  • If you need cross-framework support or complex enterprise agent systems, Neuron AI is the most mature and complete framework-agnostic option in the PHP ecosystem today.
  • If you know LangGraph concepts and want to reuse them quickly in PHP, langgraph/langgraph-php offers the most direct API mapping.
  • If you want extreme lightweight control, PocketFlow PHP gives you the core abstractions and leaves the rest to you.
  • If you need mature middleware and an event system, Nexus AI Workflows is a better fit.
  • If you prefer a Pest-style declarative API and need built-in evaluation and tracing, Pagent is closer.

Pre-Launch Checklist

Before you commit, answer these questions. They can save a lot of rework.

  • Is the project Laravel or cross-framework? For Laravel, prefer LaraGraph. For cross-framework, prefer Neuron AI.
  • Does the workflow need loops, conditional branches, parallelism, and sub-workflows? Nexus AI Workflows has more complete support for these node types.
  • What level of state persistence do you need? Can the checkpoint granularity support recovery from an interruption?
  • Do you need human-in-the-loop? Choose an option that supports pausing and human review.
  • Do you need built-in RAG and toolkits? Neuron AI has broader capability coverage.
  • How will concurrency and horizontal scaling work? LaraGraph depends on Laravel’s database and queue system.
  • Do you need evaluation and OpenTelemetry tracing? Pagent has these built in.
  • Will hiring and team expansion be easy later? PHP AI framework talent is less available than Python AI ecosystem talent.

FAQ

Can I use Python LangGraph directly in PHP?
No. You cannot run it directly. The PHP ecosystem currently reimplements or adapts graph orchestration.

Which PHP option is most like LangGraph?
langgraph/langgraph-php provides PHP implementations of StateGraph, nodes, edges, checkpointing, and other core components.

Which one should a Laravel project choose first?
LaraGraph. It deeply integrates Eloquent, queues, and other native Laravel capabilities.

Which option should I choose if I need RAG and toolkits?
Neuron AI. It provides multi-agent collaboration, human-in-the-loop, state persistence, RAG, and built-in toolkits.

Which option is the most lightweight?
PocketFlow PHP. It is about 400 lines of pure PHP, framework-agnostic, and keeps only core graph execution abstractions.

Which option should I choose if I need observability and middleware?
Nexus AI Workflows provides middleware and observability. Pagent provides OpenTelemetry tracing.

What is the biggest advantage of PHP options?
Stack consistency. Agent logic and business logic share the same codebase and deployment pipeline, with deeper integration into existing PHP systems.

What is the biggest drawback of PHP options?
Ecosystem maturity, community size, and advanced state management still lag behind Python LangGraph.