PHPackages                             papi-ai/symfony - 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. papi-ai/symfony

ActiveSymfony-bundle[API Development](/categories/api)

papi-ai/symfony
===============

Symfony bridge for PapiAI - Integrate AI agents into your Symfony application

v0.9.1(3mo ago)01MITPHPPHP ^8.2CI passing

Since Mar 7Pushed 3mo agoCompare

[ Source](https://github.com/papi-ai/symfony)[ Packagist](https://packagist.org/packages/papi-ai/symfony)[ RSS](/packages/papi-ai-symfony/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (7)Versions (4)Used By (0)

PapiAI Symfony Bundle
=====================

[](#papiai-symfony-bundle)

[![CI](https://github.com/papi-ai/symfony/workflows/CI/badge.svg)](https://github.com/papi-ai/symfony/actions?query=workflow%3ACI) [![Latest Version](https://camo.githubusercontent.com/3a763fe660981511b0a19087b61f039a5651dab29cd1f5d5aa566be88d4c17a6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706170692d61692f73796d666f6e792e737667)](https://packagist.org/packages/papi-ai/symfony) [![Total Downloads](https://camo.githubusercontent.com/293a532a16776c6734d8a307c5e06d1832265a2c9768d75b67556b35d5cf2ae7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706170692d61692f73796d666f6e792e737667)](https://packagist.org/packages/papi-ai/symfony) [![PHP Version](https://camo.githubusercontent.com/06987c9b16cff3137e72b241a9ac25c4e84c7a161139862e563acdddeaf17a17/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f706170692d61692f73796d666f6e792e737667)](https://packagist.org/packages/papi-ai/symfony) [![License](https://camo.githubusercontent.com/bb212c5550f817fb557d07f5bd14a9c3048e4cd396d885f561fe8e4d2eb52884/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f706170692d61692f73796d666f6e792e737667)](https://packagist.org/packages/papi-ai/symfony)

Symfony bridge for [PapiAI](https://github.com/papi-ai/papi-core) -- integrate AI agents into your Symfony application with full dependency injection, configuration, and service wiring.

Installation
------------

[](#installation)

```
composer require papi-ai/symfony
```

Bundle Registration
-------------------

[](#bundle-registration)

If you are not using Symfony Flex, register the bundle manually in `config/bundles.php`:

```
return [
    // ...
    PapiAI\Symfony\PapiBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

Create `config/packages/papi.yaml`:

```
papi:
    default_provider: openai

    providers:
        openai:
            driver: PapiAI\OpenAI\OpenAIProvider
            api_key: '%env(OPENAI_API_KEY)%'
            model: gpt-4o

        anthropic:
            driver: PapiAI\Anthropic\AnthropicProvider
            api_key: '%env(ANTHROPIC_API_KEY)%'
            model: claude-sonnet-4-20250514

    middleware:
        - app.middleware.logging
        - app.middleware.rate_limit

    conversation:
        store: file
        path: '%kernel.project_dir%/var/papi/conversations'
```

Usage
-----

[](#usage)

### Injecting a Provider

[](#injecting-a-provider)

```
use PapiAI\Core\Contracts\ProviderInterface;

class ChatController
{
    public function __construct(
        private ProviderInterface $provider,
    ) {}

    public function chat(string $message): string
    {
        $response = $this->provider->chat([
            ['role' => 'user', 'content' => $message],
        ]);

        return $response->getText();
    }
}
```

### Using Conversation Storage

[](#using-conversation-storage)

```
use PapiAI\Core\Contracts\ConversationStoreInterface;
use PapiAI\Core\Conversation;

class ConversationService
{
    public function __construct(
        private ConversationStoreInterface $store,
    ) {}

    public function saveConversation(string $id, Conversation $conversation): void
    {
        $this->store->save($id, $conversation);
    }

    public function loadConversation(string $id): ?Conversation
    {
        return $this->store->load($id);
    }
}
```

### Using Doctrine Conversation Store

[](#using-doctrine-conversation-store)

Install Doctrine DBAL and configure the store:

```
composer require doctrine/dbal
```

```
papi:
    conversation:
        store: doctrine
```

Create the conversations table in your database:

```
CREATE TABLE papi_conversations (
    id VARCHAR(255) PRIMARY KEY,
    data JSON NOT NULL,
    created_at DATETIME NOT NULL,
    updated_at DATETIME NOT NULL
);
```

### Using Messenger Queue

[](#using-messenger-queue)

Install Symfony Messenger:

```
composer require symfony/messenger
```

```
use PapiAI\Core\Contracts\QueueInterface;
use PapiAI\Core\AgentJob;

class AgentService
{
    public function __construct(
        private QueueInterface $queue,
    ) {}

    public function dispatchJob(string $agentClass, string $prompt): string
    {
        $job = new AgentJob(
            agentClass: $agentClass,
            prompt: $prompt,
        );

        return $this->queue->dispatch($job);
    }
}
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance81

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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

Total

3

Last Release

102d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/70713?v=4)[md](/maintainers/md)[@md](https://github.com/md)

---

Top Contributors

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

###  Code Quality

TestsPest

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/papi-ai-symfony/health.svg)

```
[![Health](https://phpackages.com/badges/papi-ai-symfony/health.svg)](https://phpackages.com/packages/papi-ai-symfony)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M373](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)[sulu/headless-bundle

Bundle that provides controllers and services for using Sulu as headless content management system

56140.6k2](/packages/sulu-headless-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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