PHPackages                             cognesy/agents - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cognesy/agents

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cognesy/agents
==============

SDK for building custom AI agents

v2.3.1(3mo ago)002MITPHPPHP ^8.3

Since Mar 13Pushed 3mo agoCompare

[ Source](https://github.com/cognesy/agents)[ Packagist](https://packagist.org/packages/cognesy/agents)[ Docs](https://instructorphp.com)[ RSS](/packages/cognesy-agents/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (19)Versions (6)Used By (2)

Instructor Agents
=================

[](#instructor-agents)

SDK for building composable AI agents in PHP.

This package provides:

- `AgentLoop` for step-based agent execution
- tools and tool execution runtime
- hooks/guards for lifecycle control
- `AgentBuilder` capabilities for composition
- templates and session runtime for persisted workflows

This package is a split from the [Instructor PHP monorepo](https://github.com/cognesy/instructor-php).

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

[](#installation)

```
composer require cognesy/agents
```

Minimal Example
---------------

[](#minimal-example)

```
use Cognesy\Agents\AgentLoop;
use Cognesy\Agents\Data\AgentState;

$agent = AgentLoop::default();
$state = AgentState::empty()->withUserMessage('What is 2+2?');
$result = $agent->execute($state);

echo $result->finalResponse()->toString();
```

Documentation
-------------

[](#documentation)

Use the Agents docs for actual usage and architecture details:

- `packages/agents/docs/01-introduction.md`
- `packages/agents/docs/02-basic-agent.md`
- `packages/agents/docs/13-agent-builder.md`
- `packages/agents/docs/14-agent-templates.md`
- `packages/agents/docs/16-session-runtime.md`

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance82

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

5

Last Release

95d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/184133?v=4)[Dariusz Debowczyk](/maintainers/ddebowczyk)[@ddebowczyk](https://github.com/ddebowczyk)

---

Top Contributors

[![ddebowczyk](https://avatars.githubusercontent.com/u/184133?v=4)](https://github.com/ddebowczyk "ddebowczyk (42 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cognesy-agents/health.svg)

```
[![Health](https://phpackages.com/badges/cognesy-agents/health.svg)](https://phpackages.com/packages/cognesy-agents)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
