{"id":50361514,"url":"https://github.com/lablnet/hyperflow-php","last_synced_at":"2026-05-30T02:02:27.566Z","repository":{"id":354576004,"uuid":"1224230359","full_name":"lablnet/hyperflow-php","owner":"lablnet","description":"HyperFlow PHP is a fully functional PHP port of the framework for building agents that rewrite and test their own improvements.","archived":false,"fork":false,"pushed_at":"2026-04-29T05:10:42.000Z","size":1386,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-29T07:10:40.714Z","etag":null,"topics":["agent","ai","claude","framework","harness","hyperflow","openai","openclaw"],"latest_commit_sha":null,"homepage":"https://hyperflow-php.lablnet.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lablnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"patreon":"lablnet"}},"created_at":"2026-04-29T04:45:26.000Z","updated_at":"2026-04-29T05:10:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lablnet/hyperflow-php","commit_stats":null,"previous_names":["lablnet/hyperflow-php"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/lablnet/hyperflow-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lablnet%2Fhyperflow-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lablnet%2Fhyperflow-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lablnet%2Fhyperflow-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lablnet%2Fhyperflow-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lablnet","download_url":"https://codeload.github.com/lablnet/hyperflow-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lablnet%2Fhyperflow-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33677261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","ai","claude","framework","harness","hyperflow","openai","openclaw"],"created_at":"2026-05-30T02:02:26.299Z","updated_at":"2026-05-30T02:02:27.561Z","avatar_url":"https://github.com/lablnet.png","language":"JavaScript","funding_links":["https://patreon.com/lablnet"],"categories":[],"sub_categories":[],"readme":"# HyperFlow (PHP)\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./assets/logo.png\" width=\"150\" alt=\"HyperFlow Logo\" /\u003e\n\u003c/p\u003e\n\nHyperFlow PHP is a fully functional PHP port of the framework for building agents that rewrite and test their own improvements.\n\nInstead of manually retuning prompts and logic after every failure, HyperFlow runs a self-improvement loop where an agent evaluates what happened, edits its own code, tools, and prompts, then tests the new version in a sandbox.\n\nThe core idea is simple: do not just rerun the same workflow. Learn from execution and get better over time.\n\nBuilt natively in PHP 8.1+ utilizing `openai-php/client`. Inspired by [HyperAgents](https://github.com/facebookresearch/HyperAgents) (Meta Research, 2026).\n\n\u003e **⚠️ EXPERIMENTAL**: This project is currently in an experimental phase and is **not recommended for production use**.\n\n## What it does\n\nHyperFlow runs an evolutionary self-improvement loop with two roles:\n- **TaskAgent** solves the domain problem\n- **MetaAgent** studies evaluation results and improves the system\n\nEach generation:\n\n1. Select a parent generation from the archive\n2. MetaAgent reads past evaluation scores and edits the source code\n3. Evaluation scripts run in a sandbox to score the new agent\n4. Better agents are added back to the archive for future generations\n\nIt is **self-referential**: the mechanism that improves the agent is itself part of the editable code.\n\n\u003e [!IMPORTANT]\n\u003e This framework is currently in an **Experimental** state. See [Limitations](docs_site/docs/guide/limitations.md) for more information.\n\nThe TaskAgent gets better over generations without manual intervention.\n\n## Installation\n\nInstall using Composer:\n\n```bash\ncomposer require lablnet/hyperflow-php\n```\n\nOr install from source for development:\n\n```bash\ngit clone https://github.com/lablnet/hyperflow-php.git\ncd hyperflow-php\n\ncomposer install\n```\n\n### Requirements\n\n- PHP 8.1+\n- Composer\n- At least one LLM provider API key (e.g. `OPENAI_API_KEY`)\n\n## Quick Start\n\n```bash\n# Set your API key in .env or export it\ncp .env.example .env\n# Edit .env and set OPENAI_API_KEY\n\n# Run the bash example\ncd examples/bash\nphp run.php\n```\n\n## Project Structure\n\n```text\nphp/\n  composer.json\n  src/\n    Agent/\n      AgentOptions.php       # DTO for agent configuration\n      AgentSystem.php        # Abstract AgentSystem base class\n      Llm.php                # OpenAI client integration\n      LlmConfig.php          # Config DTO for the LLM\n      LlmWithTools.php       # Synchronous ReAct chat loop\n      MetaAgent.php          # MetaAgent (mutation operator)\n      TaskAgent.php          # TaskAgent (task solver)\n      ToolRegistry.php       # Tool registration\n    Contracts/\n      BaseChatModel.php      # LLM invocation interface\n      BaseTool.php           # Abstract class defining tools\n      Message.php            # Base Message class\n      AIMessage.php          # Assistant message model\n      HumanMessage.php       # User message model\n      SystemMessage.php      # System message model\n      ToolMessage.php        # Tool execution result model\n    Core/\n      GenerateLoop.php       # Main evolutionary loop\n    Domains/\n      Base.php               # Domain interfaces\n      Harness.php            # Evaluation harness\n    Tools/\n      BashTool.php           # Bash shell tool\n      EditorTool.php         # File editor tool\n    Utils/\n      Archive.php            # JSONL archive CRUD\nexamples/\n  bash/                      # Bash command generation\n  calculator/                # Buggy tool fix demo\n  factcheck/                 # True/false classification\n```\n\n## Supported Models\n\nSince this PHP implementation relies primarily on the OpenAI API standard, you can pass any supported model string during configuration:\n\n```php\nuse HyperFlow\\Agent\\AgentOptions;\n\n$options = new AgentOptions(model: 'gpt-4o'); // 'gpt-4o', 'gpt-4o-mini', 'o3', etc.\n```\n\n## Environment Variables\n\nThe framework supports loading environment variables from a `.env` file in the project root.\n\n| Variable | Description |\n|----------|-------------|\n| `OPENAI_API_KEY` | OpenAI API key |\n\n## Examples\n\n### Single Evaluation / Self-Improvement Loops\n\nExecute the specific scripts depending on the example you want to run. \nThe examples demonstrate both strict execution and evolutionary loops.\n\n```bash\ncd examples/bash \u0026\u0026 php run.php\ncd examples/factcheck \u0026\u0026 php run.php\ncd examples/paper_review \u0026\u0026 php run.php\ncd examples/calculator \u0026\u0026 php run.php\n```\n\n## License\n\nMIT\n\n## Citation\n\nIf you use this framework in your research, please cite the original HyperAgents paper:\n\n```bibtex\n@misc{zhang2026hyperagents,\n      title={Hyperagents}, \n      author={Jenny Zhang and Bingchen Zhao and Wannan Yang and Jakob Foerster and Jeff Clune and Minqi Jiang and Sam Devlin and Tatiana Shavrina},\n      year={2026},\n      eprint={2603.19461},\n      archivePrefix={arXiv},\n      primaryClass={cs.AI},\n      url={https://arxiv.org/abs/2603.19461}, \n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flablnet%2Fhyperflow-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flablnet%2Fhyperflow-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flablnet%2Fhyperflow-php/lists"}