PHPackages                             anwar/agent-orchestrator - 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. [API Development](/categories/api)
4. /
5. anwar/agent-orchestrator

ActiveLibrary[API Development](/categories/api)

anwar/agent-orchestrator
========================

Core Brain to receive webhooks from n8n and orchestrate OpenAI Tool calling.

0.0.6(3mo ago)016MITPHPPHP ^8.1|^8.2|^8.3|^8.4

Since Apr 13Pushed 3mo agoCompare

[ Source](https://github.com/ringkubd/agent-orchestrator)[ Packagist](https://packagist.org/packages/anwar/agent-orchestrator)[ RSS](/packages/anwar-agent-orchestrator/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (6)Dependencies (3)Versions (7)Used By (0)

AI Agent Orchestrator for Laravel
=================================

[](#ai-agent-orchestrator-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5d1e6ff471e9fe172c953abb095eefe489b1dacd198be6e841906f393bfb8368/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e7761722f6167656e742d6f7263686573747261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anwar/agent-orchestrator)[![Total Downloads](https://camo.githubusercontent.com/38b5f54c02799f8f30255560410c61af8a973d7eec17b05b2819a141e43f7239/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e7761722f6167656e742d6f7263686573747261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anwar/agent-orchestrator)

A powerful AI-driven core for Laravel applications that orchestrates OpenAI tool calling, local vector embeddings via Ollama, and semantic search via Qdrant. Specifically designed to handle complex "Neighbor Chef" personas with HTML-rich responses and direct cart integration.

---

🎨 Features
----------

[](#-features)

- **🚀 Hybrid Semantic Search**: Integrated with **Qdrant** for high-performance vector search.
- **🧠 Local Embeddings**: Support for local **Ollama** (`nomic-embed-text`) to save costs and ensure privacy.
- **🛠️ OpenAI Tool Calling**: Seamlessly handle tool calls for order tracking, recipe consultation, and cart management.
- **🍱 Branded HTML Responses**: Enforces strict HTML formatting (no Markdown) for premium UI rendering.
- **🛒 Cart Integration**: Automatic generation of `[Add to Cart]` links and batch ingredient buttons.
- **🔌 Webhook Ready**: Built-in endpoint for n8n or other automation platform orchestration.

---

📦 Installation
--------------

[](#-installation)

You can install the package via composer:

```
composer require anwar/agent-orchestrator
```

The service provider will automatically register itself.

### Publish Configuration

[](#publish-configuration)

```
php artisan vendor:publish --tag="agent-config"
```

---

⚙️ Configuration
----------------

[](#️-configuration)

Add the following variables to your `.env` file:

```
# AI Agent Settings
AGENT_WEBHOOK_SECRET=your_secure_secret
AGENT_OPENAI_MODEL=gpt-4o-mini
OPENAI_REQUEST_TIMEOUT=120

# Vector Database (Qdrant)
QDRANT_HOST=http://localhost:6333

# Embedding Source (ollama or openai)
AGENT_EMBEDDING_SOURCE=ollama
OLLAMA_HOST=http://localhost:11435
OLLAMA_EMBEDDING_MODEL=nomic-embed-text

# OpenAI (if source is openai)
OPENAI_API_KEY=your_openai_key
```

---

🚀 Usage
-------

[](#-usage)

### 1. Synchronize Data to Qdrant

[](#1-synchronize-data-to-qdrant)

To populate the vector database with your products and recipes:

```
# Sync Recipes
php artisan agent:sync-chef-brain

# Sync Active Products
php artisan agent:sync-products
```

### 2. Using the Service

[](#2-using-the-service)

You can resolve and use the `AiAgentService` anywhere in your application:

```
use Anwar\AgentOrchestrator\Services\AiAgentService;

$agent = app(AiAgentService::class);
$response = $agent->processMessage($customerPhone, "I want to cook Chicken Biryani");

// $response will contain HTML-formatted content with images and cart links.
```

### 3. Webhook Integration

[](#3-webhook-integration)

The package provides a standard webhook endpoint: **Endpoint**: `POST /api/v1/agent/webhook`

Payload Example:

```
{
    "phone": "08012345678",
    "message": "Find me some Miso paste"
}
```

---

👨‍🍳 Persona: Gunma Neighbor Chef
--------------------------------

[](#‍-persona-gunma-neighbor-chef)

The agent is pre-configured to behave as a **Friendly, Bengali-Japanese neighbor**.

- **Tone**: Uses phrases like *"Itadakimasu Bhai"*, *"Ja-matod"*, and *"Salam!"*.
- **Formatting**: Strictly uses ``, ``, ``, and ``.
- **E-commerce**: Integrates product images and cart buttons directly into the chat flow.

---

🏗️ Dependencies
---------------

[](#️-dependencies)

- [OpenAI PHP SDK](https://github.com/openai-php/laravel)
- [Qdrant](https://qdrant.tech/)
- [Ollama](https://ollama.com/) (Optional for local embeddings)

---

🔗 Repository
------------

[](#-repository)

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

---

*Developed with ❤️ for Gunma Halal Food.*

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance81

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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 ~1 days

Total

6

Last Release

99d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b1333bbd2f796d53001d6dfbc3327f4c5ae72bca1a67fd4f32ee7375a538004?d=identicon)[ringkubd](/maintainers/ringkubd)

---

Top Contributors

[![ringkubd](https://avatars.githubusercontent.com/u/20917263?v=4)](https://github.com/ringkubd "ringkubd (7 commits)")

### Embed Badge

![Health badge](/badges/anwar-agent-orchestrator/health.svg)

```
[![Health](https://phpackages.com/badges/anwar-agent-orchestrator/health.svg)](https://phpackages.com/packages/anwar-agent-orchestrator)
```

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

813336.8k3](/packages/defstudio-telegraph)

PHPackages © 2026

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