Download the PHP package langgraph/langgraph-php without Composer
On this page you can find all versions of the php package langgraph/langgraph-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package langgraph-php
LangGraph PHP SDK
A powerful PHP implementation of Python's LangGraph. This SDK enables you to build stateful, multi-agent applications with complex, graph-based logic. It provides the core components to create robust and scalable AI workflows in your PHP projects.
β¨ Core Features
- Stateful Graphs: Create graphs where state is passed between nodes, allowing for complex, long-running workflows.
- Node & Edge Control: Define nodes as units of work and use edges to control the flow, including conditional branching.
- Agent System: A built-in factory for creating and managing AI agents.
- AI Model Integration: Easily connect to various large language models (e.g., DeepSeek, Qwen).
- Persistence (Checkpointing): Save and restore the state of your graphs, allowing workflows to be paused and resumed.
- Streaming: Support for real-time streaming of responses from nodes.
π Installation
You can install the package via Composer:
π οΈ Usage & Functionality
Hereβs how to use the core features of the LangGraph PHP SDK.
1. Creating a Basic Workflow
The fundamental building block is the StateGraph. You define a state class, add nodes (functions or callables), and connect them with edges.
2. Conditional Logic
You can direct the flow of your graph based on the current state using conditional edges. This allows for dynamic, branching workflows.
3. Using AI Agents
The SDK includes an AgentFactory to easily create model-based agents that can be used as nodes in your graph.
First, configure your model API keys in config/model.php.
4. Persistence with Checkpoints
Save the state of a workflow at any point and resume it later. The SDK includes a MemoryCheckpointSaver for simple use cases.
π Documentation
For detailed documentation and FAQs, please refer to our documentation:
- δΈζζζ‘£ - Chinese documentation
- English Documentation - English documentation
Advanced Examples
For more complex examples, including multi-agent collaboration, streaming, and web integrations, please explore the scripts in the bin/ and examples/ directories.
π€ Contributing
Contributions are welcome! Please read CONTRIBUTING.md for details.
π License
This project is licensed under the MIT License. See the LICENSE file for more information.