cognesy / agents
SDK for building custom AI agents
v2.0.0
2026-03-13 19:48 UTC
Requires
- php: ^8.3
- ext-fileinfo: *
- ext-libxml: *
- cognesy/instructor-dynamic: ^2.0
- cognesy/instructor-events: ^2.0
- cognesy/instructor-http-client: ^2.0
- cognesy/instructor-messages: ^2.0
- cognesy/instructor-polyglot: ^2.0
- cognesy/instructor-sandbox: ^2.0
- cognesy/instructor-schema: ^2.0
- cognesy/instructor-struct: ^2.0
- cognesy/instructor-utils: ^2.0
Requires (Dev)
- icanhazstring/composer-unused: ^0.9.0
- jetbrains/phpstorm-attributes: ^1.2
- maglnet/composer-require-checker: ^4.16
- mockery/mockery: ^1.6
- pestphp/pest: ^2.34
- phpstan/phpstan: ^1.11
- roave/security-advisories: dev-latest
- vimeo/psalm: ^6.0
README
SDK for building composable AI agents in PHP.
This package provides:
AgentLoopfor step-based agent execution- tools and tool execution runtime
- hooks/guards for lifecycle control
AgentBuildercapabilities for composition- templates and session runtime for persisted workflows
This package is a split from the Instructor PHP monorepo.
Installation
composer require cognesy/agents
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
Use the Agents docs for actual usage and architecture details:
packages/agents/docs/01-introduction.mdpackages/agents/docs/02-basic-agent.mdpackages/agents/docs/13-agent-builder.mdpackages/agents/docs/14-agent-templates.mdpackages/agents/docs/16-session-runtime.md