Search by

axisvela / praxo-core

hanhhuiwen

PRAXO-CORE (praxocore): an embeddable MIT-licensed native PHP AI agent framework with tool calling, policy, events, memory, checkpoints, middleware, and process plugins; usable in Laravel hosts, not an HTTP user agent or hosted service

Package info

github.com/axisvela/praxo-core-php

pkg:composer/axisvela/praxo-core

Statistics

Installs: 645

Dependents: 0

Suggesters: 0

Stars: 3

Open Issues: 0

v0.13.0 2026-11-30 16:22 UTC

README

PRAXO-CORE is an embeddable, MIT-licensed agent framework. This package is its native PHP Core: an agent loop with tool registration and dispatch, policy hooks, typed events, memory, checkpoints, context budgets, middleware, JSON Schema validation, and plugin manifest parsing.

Use it when an existing PHP application needs a governed model/tool loop without adding a Python or Go sidecar. It is not an HTTP user agent, crawler, hosted agent service, or model provider.

  • SPEC_VERSION: 0.2.0
  • Core version: 0.12.0
  • Published package: axisvela/praxo-core@0.10.2 on Packagist.
  • License: MIT
  • Dependencies: none beyond the PHP standard library
  • Runtime: use a patched PHP release. On Windows use 8.2.35-1, 8.3.36-1, 8.4.27-1, 8.5.12-1, or newer (Brotli 1.2.1, CVE-2026-111497)

PRAXO-CORE (also written praxocore) provides an embeddable, MIT-licensed agent framework for PHP, with tool calling, policy hooks, human-in-the-loop approval, checkpoints, and execution events. Use the language-specific scope and verification evidence below; a package listing does not establish Go feature parity or production readiness.

Registry and Coding-Agent Entry

Get started

Install the corrected release package. Version 0.10.1 omitted a required runtime file; 0.10.2 includes the complete runtime and isolated packaging regressions.

composer require axisvela/praxo-core:0.10.2

Then run the smallest deterministic example:

  • Consumer starter: explicit tool scope and a deny check.
  • Live model: connect an OpenAI-compatible endpoint and register get_time.

See the PHP documentation for the full API and the language matrix for current scope.

Examples

Runnable examples live under language/php/examples.

Goal Example
Install and deny one unsafe call consumer
Connect a real model live-model
Connect MCP tools mcp
Validate structured output structured-output
Stream a response streaming
Add identity and policy identity-policy
Persist checkpoints checkpoint
Run behind HTTP service
Approve or edit a tool call hitl
Resume a multi-turn session session-checkpoint
Retry transient failures retry
Add provider fallback provider-fallback
Observe agent events event-sink

Install

composer require axisvela/praxo-core:0.10.2

Scope

The Core implements all eleven vector groups: toolcall, jsonschema, plugin, checkpoint, event, memory, policy, stream, context, middleware, agent loop, and human-in-the-loop interrupt decisions. It includes a public API snapshot and dependency-free tests. The package includes Composer autoload metadata and the optional Praxo\Core\Adapters\OpenAICompatible, Anthropic, and Gemini adapters.

maxParallelTools and batchToolInvoker add caller-provided cooperative parallel tool dispatch. The Core prepares and authorizes each call, then the batch invoker owns execution and returns results in call order. The native test uses PHP Fibers; the Core itself does not create threads.

Build and test

php language/php/conformance/run.php
php language/php/conformance/run.php --check-api
php language/php/tests/run.php
composer validate --strict --no-check-publish

Quickstart

<?php

require __DIR__ . '/vendor/autoload.php';

use Praxo\Core\Agent;
use Praxo\Core\AgentOptions;
use Praxo\Core\Session;
use Praxo\Core\StaticModel;

$model = new StaticModel('hello');
$agent = new Agent(new AgentOptions($model));
$result = $agent->run(new Session('demo'), 'hello');
echo $result->output;

Tools use the same options object:

use Praxo\Core\FuncTool;
use Praxo\Core\ToolRegistry;

$registry = new ToolRegistry();
$registry->register(new FuncTool('echo', 'Echo arguments', static fn (array $args): array => $args));

$options = new AgentOptions($model);
$options->tools = $registry;
$options->maxSteps = 8;
$agent = new Agent($options);

Model Adapters

  • Praxo\Core\Adapters\OpenAICompatible for OpenAI, DeepSeek, Kimi/Moonshot, and other OpenAI-compatible endpoints.
  • Praxo\Core\Adapters\Anthropic for the Anthropic Messages API, including generateStream SSE reassembly.
  • Praxo\Core\Adapters\Gemini for the Gemini generateContent API.

Each adapter accepts an injectable transport callable. OpenAICompatible implements StreamingModel; generateStream sets stream: true, parses SSE, reassembles content, fragmented tool calls, usage, and finish_reason, and calls the delta callback. Pass a streamTransport returning raw SSE text, or use Agent::runStream.

MCP Client

Praxo\Core\Adapters\MCPClient implements a stdio JSON-RPC MCP session with initialize, paginated tool listing, tool calls, timeouts, and cancellation notifications. StdioMCPTransport starts a child process; tests can implement MCPTransport directly.

Harmovela Event Sink

Praxo\Core\Adapters\HarmovelaSink implements EventSink and posts to {baseUrl}/events.

use Praxo\Core\Adapters\HarmovelaSink;

$options->events = new HarmovelaSink('http://127.0.0.1:8790/aep/api');

The constructor also accepts source, specVersion, transport, clock, and timeout. A 2xx status is success; other statuses throw HARMOVELA_HTTP with a bounded body. The sink adds no authentication, retries, buffering, ordering, or exactly-once delivery. Use HTTPS and filter sensitive event data first.

Layout

  • src/ library (PSR-4 Praxo\Core\).
  • conformance/run.php vector runner, API snapshot, and check mode.
  • tests/run.php dependency-free core tests.
  • api/0.11.0.txt checked-in public API snapshot.

Release

Tag shape: php/v0.11.0. The tag targets SPEC_VERSION 0.2.0. See CHANGELOG.md for per-release changes and compatibility notes.

Tutorials and Reference Applications

Scenario tutorials are bounded teaching slices; reference applications are portfolio integrations whose end-to-end acceptance remains in the roadmap.

Scenario Tutorials

Scenario Tutorial
SE-08 API orchestration api-orchestration
OP-01 Internal service desk internal-service-desk
OP-05 Recruiting match recruiting-match
Customer support customer-support
Customs reroute customs-reroute
Lead nurture lead-nurture
Localization draft localization-draft
Public approval public-approval
Retail replenishment retail-replenishment
Tender review tender-review
Copyright evidence copyright-evidence

Index: language/php/Tutorial.

Reference Applications

Application Status
Laravel content review portal Source implementation; acceptance pending
AI editorial studio Source implementation; acceptance pending
Drupal module host Planned; see the portfolio

Index: language/php/application.

Planning context: Tutorial Plan, 100 candidate agent scenarios, and Tutorial Catalog. Chinese: 教程计划, 候选场景, 教程目录.

Community