agenticorchestrator/agenticorchestrator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

agenticorchestrator/agenticorchestrator

最新稳定版本:v0.8.0

Composer 安装命令:

composer require agenticorchestrator/agenticorchestrator

包简介

A Laravel AI Agent framework with multi-tenancy, workflows, RAG pipelines, and evaluation tools

README 文档

README

A Laravel AI Agent framework with first-class multi-tenancy support.

Latest Version on Packagist GitHub Tests Action Status PHPStan License

Key Highlights

  • First-Class Multi-Tenancy — Team isolation, system vs custom agents, per-team cost attribution
  • 10+ LLM Providers — OpenAI, Anthropic, Gemini, Mistral, Ollama, and more via Prism PHP
  • 5 Vector Stores — Pinecone, Qdrant, Weaviate, Chroma, PgVector for semantic memory
  • Full Workflow Engine — Sequential, parallel, conditional, loop, and human-in-the-loop patterns
  • LLM-as-Judge Evaluation — Built-in evaluation framework with custom assertions and metrics
  • Production Ready — Rate limiting, caching, circuit breakers, and comprehensive event system

Installation

composer require agenticorchestrator/agenticorchestrator

Publish the configuration:

php artisan vendor:publish --provider="AgenticOrchestrator\AgenticOrchestratorServiceProvider"

Run migrations:

php artisan migrate

Quick Start

Create Your First Agent

php artisan agent:make CustomerSupportAgent
<?php

namespace App\Agents;

use AgenticOrchestrator\Agents\Agent;
use AgenticOrchestrator\Tools\Attributes\Tool;

class CustomerSupportAgent extends Agent
{
    protected string $name = 'Customer Support';
    protected string $description = 'Handles customer inquiries';
    protected string $model = 'gpt-4o';

    public function instructions(): string
    {
        return "You are a helpful customer support agent for {$this->team->name}.";
    }

    #[Tool('Look up customer order')]
    public function lookupOrder(string $orderId): array
    {
        return $this->team->orders()
            ->where('id', $orderId)
            ->firstOrFail()
            ->toArray();
    }
}

Use Your Agent

use App\Agents\CustomerSupportAgent;

// Simple usage
$response = CustomerSupportAgent::make()
    ->forTeam($team)
    ->respond('What is the status of order #12345?');

echo $response->content;

// With streaming
$stream = CustomerSupportAgent::make()
    ->forTeam($team)
    ->stream('Tell me about your return policy');

foreach ($stream as $chunk) {
    echo $chunk->content;
}

Multi-Tenancy Support

// System agents (platform-wide, read-only)
class SystemHelpAgent extends Agent
{
    protected bool $isSystem = true;
}

// Custom agents (team-owned)
class TeamSalesAgent extends Agent
{
    protected bool $isSystem = false;
}

// Get available agents for a team
$agents = $team->availableAgents(); // System + team's custom agents

Workflow Orchestration

use AgenticOrchestrator\Workflows\Workflow;
use AgenticOrchestrator\Workflows\Patterns\ParallelPattern;
use AgenticOrchestrator\Workflows\Steps\{AgentStep, ConditionalStep};

class OnboardingWorkflow extends Workflow
{
    public function definition(): array
    {
        return [
            new AgentStep(WelcomeAgent::class, output: 'welcome'),

            ParallelPattern::make([
                new AgentStep(AccountSetupAgent::class, output: 'account'),
                new AgentStep(PreferencesAgent::class, output: 'prefs'),
            ]),

            new ConditionalStep(
                condition: fn ($ctx) => $ctx->get('customer.plan') === 'enterprise',
                then: new AgentStep(EnterpriseSetupAgent::class),
            ),

            new AgentStep(SummaryAgent::class, output: 'summary'),
        ];
    }
}

// Execute
$result = OnboardingWorkflow::make()
    ->forTeam($team)
    ->run(['customer' => $customerData]);

Memory Systems

// Configure memory in your agent
protected array $memory = [
    'driver' => 'vector',
    'vector_store' => 'pinecone',
    'namespace' => 'support',
];

// Use memory
$this->getMemory()->store('customer_123', $preferences);
$data = $this->getMemory()->recall('customer_123');
$results = $this->getMemory()->search('shipping policy', limit: 5);

Features

Core Features

  • Multi-Tenancy: Team isolation, system vs custom agents, per-team cost tracking
  • 10+ LLM Providers: Via Prism PHP (OpenAI, Anthropic, Gemini, Mistral, Ollama, etc.)
  • Tool System: Attribute-based tools with parallel execution
  • Memory: Session, cache, database, vector (5 stores), and RAG drivers
  • Streaming: Real-time token streaming with callbacks

Advanced Features

  • Workflows: Sequential, parallel, conditional, loop, human-in-the-loop patterns
  • Agent Delegation: Agents can delegate tasks to other agents
  • Evaluation: LLM-as-judge with custom assertions and metrics
  • Error Handling: Retry strategies, circuit breakers, fallback providers
  • Usage Tracking: Tokens, cost, latency tracking per team/agent/user

Production Features

  • Rate Limiting: Per-user, per-team, per-agent limits
  • Caching: Response, embedding, and tool result caching
  • Events: Comprehensive event system for all operations
  • Testing: Fakes, mocks, and evaluation framework

Configuration

// config/agent-orchestrator.php
return [
    'default_provider' => 'openai',
    'default_model' => 'gpt-4o',

    'multi_tenancy' => [
        'enabled' => true,
        'team_model' => \App\Models\Team::class,
        'system_agents' => [
            \App\Agents\SystemHelpAgent::class,
        ],
    ],

    'memory' => [
        'default' => 'cache',
        'drivers' => [
            'vector' => [
                'store' => 'pinecone',
                'embedding_provider' => 'openai',
            ],
        ],
    ],

    'rate_limiting' => [
        'per_team' => ['requests' => 1000, 'period' => 60],
    ],
];

Artisan Commands

Command Description
agent:make {name} Create a new agent
agent:make-tool {name} Create a new tool
agent:make-workflow {name} Create a new workflow
agent:list List all agents
agent:run {agent} {message} Run an agent
agent:chat {agent} Interactive chat
agent:evaluate {agent} Run evaluation suite

Testing

use AgenticOrchestrator\Facades\Agent;

// Fake responses
Agent::fake([
    CustomerSupportAgent::class => 'Mocked response',
]);

// Assertions
Agent::assertResponded(CustomerSupportAgent::class);
Agent::assertToolCalled(CustomerSupportAgent::class, 'lookupOrder');

Requirements

  • PHP 8.3+
  • Laravel 11.0+ or 12.0+

Documentation

Full documentation available in the docs folder.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security issues, please email agenticorchestrator@proton.me instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固