Download the PHP package projectsaturnstudios/pocketflow-php without Composer

On this page you can find all versions of the php package projectsaturnstudios/pocketflow-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pocketflow-php

PocketFlow PHP

PocketFlow PHP: Minimalist LLM framework for PHP. Let Agents build Agents!

Language: PHP | License: MIT

License: MIT PHP ReactPHP Total Downloads

PocketFlow PHP is the first PHP implementation of the minimalist LLM framework concept

Get started with PocketFlow PHP:

Why PocketFlow PHP?

The PHP ecosystem was missing a minimalist LLM workflow framework... until now!

| | **Abstraction** | **PHP Integration** | **LLM Support** | **Lines** | **Dependencies** | |----------------|:-----------------------------: |:-----------------------------------------------------------:|:------------------------------------------------------------:|:---------------:|:----------------------------:| | LLPhant | Comprehensive | Framework agnostic
(Symfony/Laravel compatible) | Multiple providers
(OpenAI, Anthropic, Mistral, etc.) | ~15K+ | Heavy (many providers) | | LangChain PHP | Agent, Chain | Basic
(Work in progress) | Limited
(OpenAI, llama.cpp) | ~5K | Moderate | | **PocketFlow PHP** | **Graph** | **Framework Agnostic**
(Pure PHP, works anywhere) | **Bring Your Own**
(Use any HTTP client) | **~400** | **Minimal** |

How does PocketFlow PHP work?

The core abstraction: Graph-based workflow execution with simple nodes and flows.

Core Components:

  1. BaseNode: Foundation class with prep(), exec(), post() lifecycle
  2. Node: Extended with retry logic and fallback handling
  3. Flow: Orchestrates node execution with action-based routing
  4. BatchNode/BatchFlow: Process arrays of data through workflows
  5. AsyncNode/AsyncFlow: ReactPHP-powered parallel execution (optional)

Key Features:

Examples

Basic Hello World

LLM Integration Example

Self-Looping Chat Bot

Advanced Patterns

Batch Processing

Async Workflows (ReactPHP - Optional Dependency)

Conditional Routing

Comparison with Original PocketFlow

Feature Python PocketFlow PHP PocketFlow Notes
Core Abstraction ✅ Graph ✅ Graph Same philosophy
Async Support ✅ asyncio ⚠️ ReactPHP (optional) Different implementations
Framework Integration ❌ None ✅ Framework Agnostic Works with any PHP project
LLM Providers ❌ Manual ❌ Bring Your Own Both require manual integration
Type Safety ⚠️ Optional ✅ Full PHP 8.1+ strict types
Lines of Code 100 ~400 More features, still minimal

Installation & Setup

Requirements

Installation

Optional Dependencies

Quick Setup

  1. Install Package: composer require projectsaturnstudios/pocketflow-php
  2. Create Nodes: Extend Node or BaseNode classes
  3. Chain Workflows: Use $node->next($nextNode, 'action')
  4. Run Flows: $flow = new Flow($startNode); $flow->_run($shared);

LLM Integration Notes

Important: PocketFlow PHP is framework-agnostic and does not include LLM provider integrations. You need to:

  1. Choose Your LLM Client: OpenAI SDK, Guzzle HTTP, cURL, etc.
  2. Implement in Nodes: Add LLM calls in your exec() methods
  3. Handle Responses: Process LLM responses in your post() methods
  4. Manage State: Use &$shared parameters for conversation history

This approach gives you complete control over your LLM integrations without vendor lock-in.

Vendor Dependencies

Dependencies:

No Lock-ins:

Contributing

This is the world's first PHP implementation of PocketFlow! We welcome contributions:

Roadmap

License

MIT License - same as original PocketFlow

Acknowledgments


Built with ADHD by Project Saturn Studios


All versions of pocketflow-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
react/promise Version ^3.2 || ^2.0 || ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package projectsaturnstudios/pocketflow-php contains the following files

Loading the files please wait ....