PHPackages                             claude-php/agent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. claude-php/agent

ActiveLibrary[Framework](/categories/framework)

claude-php/agent
================

A powerful PHP framework for building AI agents with Claude, featuring ReAct loops, tool orchestration, and advanced agentic patterns

v1.5.0(3mo ago)12371[5 PRs](https://github.com/claude-php/claude-php-agent/pulls)MITPHPPHP ^8.1|^8.2|^8.3CI passing

Since Dec 15Pushed 1mo agoCompare

[ Source](https://github.com/claude-php/claude-php-agent)[ Packagist](https://packagist.org/packages/claude-php/agent)[ Docs](https://github.com/claude-php/agent)[ RSS](/packages/claude-php-agent/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (32)Used By (0)

Claude PHP Agent Framework
==========================

[](#claude-php-agent-framework)

[![Tests](https://github.com/claude-php/claude-php-agent/actions/workflows/tests.yml/badge.svg)](https://github.com/claude-php/claude-php-agent/actions/workflows/tests.yml)[![Code Quality](https://github.com/claude-php/claude-php-agent/actions/workflows/code-quality.yml/badge.svg)](https://github.com/claude-php/claude-php-agent/actions/workflows/code-quality.yml)[![Security](https://github.com/claude-php/claude-php-agent/actions/workflows/security.yml/badge.svg)](https://github.com/claude-php/claude-php-agent/actions/workflows/security.yml)[![PHP Version](https://camo.githubusercontent.com/e0dcf1c5cee433a9401c24870138aaf2fd6f41aacdd1d34f198d13a141dd2b2e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e31253743253545382e32253743253545382e332d626c7565)](https://www.php.net/)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Latest Stable Version](https://camo.githubusercontent.com/4ae8e460a30287d2b896abd4a395b5d50526da4f71952b97db93ede66c6903e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c617564652d7068702f6167656e742e737667)](https://packagist.org/packages/claude-php/agent)[![Total Downloads](https://camo.githubusercontent.com/5ad35251c559113ff182e11ccb3d6edb9c5aecd666307799146814e7a3eb130f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c617564652d7068702f6167656e742e737667)](https://packagist.org/packages/claude-php/agent)

A powerful PHP framework for building AI agents with Claude, featuring ReAct loops, tool orchestration, hierarchical agents, and advanced agentic patterns.

Features
--------

[](#features)

- 🔄 **Loop Strategies** - ReactLoop, PlanExecuteLoop, ReflectionLoop, and StreamingLoop
- 🌊 **Streaming Flow Execution** - Real-time token streaming with event broadcasting
- 🎨 **Template System** - 22+ starter templates with instant instantiation
- **🎯 Error Handling Service** - User-friendly error messages for all API errors (NEW!)
- 🛠️ **Tool System** - Easy tool definition, registration, and execution
- 🧠 **Memory Management** - Persistent state across agent iterations
- 🏗️ **Agent Patterns** - ReAct, Plan-Execute, Reflection, Hierarchical, and more
- 🤖 **Adaptive Agent Service** - Intelligent agent selection, validation, and auto-adaptation
- 📊 **Output Parsers** - JSON, XML, Markdown, CSV, Lists, and Regex with auto-detection
- 🔗 **Chain Composition** - Sequential, parallel, and conditional chain execution
- ⚡ **Production Ready** - Retry logic, error handling, logging, and monitoring
- 🚀 **Async/Concurrent** - AMPHP-powered parallel execution for batch operations
- 🌐 **MCP Server** - Model Context Protocol integration for Claude Desktop and IDEs
- 🎯 **Extensible** - Build custom agents and patterns with ease
- 🆕 **Component Validation** - Runtime validation by instantiation (v0.8.0)
- 🏢 **Services System** - Enterprise service management with dependency injection (v0.7.0)
- 🧪 **Code Generation** - AI-powered code generation with validation pipelines (v0.8.0)

Installation
------------

[](#installation)

```
composer require claude-php/agent
```

Quick Start
-----------

[](#quick-start)

```
