Download the PHP package phpro/agent-rules without Composer

On this page you can find all versions of the php package phpro/agent-rules. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package agent-rules

Agent Rules

A declarative rule engine designed for conversational agents, AI assistants, and interactive workflows.

Perfect for building chatbots, AI agents, CLI wizards, or any system that guides users through multi-step processes by asking questions and validating responses.

Overview

Agent Rules provides a logical processing unit for handling unstructured input in a structured and interactive way. It enables you to define validation rules that can request missing information, enforce business logic, and provide intelligent feedback to users or AI agents.

Built to be compatible with Symfony AI Agent, this library integrates seamlessly with AI-powered tools and conversational interfaces.

Key Features

Installation

Quick Start

1. Define Your Subject

The subject is the data being validated:

2. Create Validation Rules

Each rule checks one aspect and can request missing information:

3. Run the Engine

Result Types

The engine provides four result types to communicate different states:

Result Type Status Use Case Key Fields
CompleteResult complete Validation passed message
IncompleteResult incomplete Missing/invalid data missingField, message
BlockedResult blocked Access denied reason, message
ErrorResult error Processing error message, resolution

Complete Result

Incomplete Result

Blocked Result

Error Result

Composable Rules

Sequence (AND Logic)

All rules must pass. First failure stops execution:

Any (OR Logic)

At least one rule must pass:

Either (Binary Choice)

Try left, fall back to right:

Dependency Resolution

Rules can declare dependencies to ensure proper execution order:

The engine automatically:

Adding Context with Sources

You can attach contextual information to results that helps users or AI agents understand where to find more information:

Sources are particularly useful for:

Symfony Configuration

Configure the rule engine as a service:

Tag your rules:

Real-World Example: Form Validation Assistant

Imagine building a conversational AI that helps users complete a multi-step registration form. The AI needs to:

Implementation

1. Define the Request Context

2. Create Validation Rules

3. Create the AI tool

This is an example of linking the rule engine to a Symfony AI agent tool:

With following agent configuration:

Conversation Flow

Use Cases

Chatbot Form Wizards

Guide users through complex forms by requesting one piece of information at a time based on validation rules.

AI-Powered Customer Support

Validate customer requests interactively, asking clarifying questions when information is missing or invalid.

CLI Configuration Tools

Build interactive command-line tools that guide users through setup by validating configuration step-by-step.

API Request Validation

Validate API requests from AI agents, providing structured feedback on missing or invalid parameters.

Document Processing Workflows

Check documents for completeness, requesting missing sections or data from users or automated systems.

Advanced Patterns

Conditional Rules

Nested Composites

Stateful Rules

Testing

Architecture

Design Principles

Core Components

Performance Considerations

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License. See LICENSE file for details.


All versions of agent-rules with dependencies

PHP Build Version
Package Version
Requires php Version ~8.4.0 || ~8.5.0
php-standard-library/foundation Version ^6.1
php-standard-library/graph Version ^6.1
php-standard-library/iter Version ^6.1
php-standard-library/vec Version ^6.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phpro/agent-rules contains the following files

Loading the files please wait ...