Search by

adachsoft / ai-agent-factory

Arkadiusz Adach

Build AI agents from configuration and provider credentials.

Package info

gitlab.com/a.adach/ai-agent-factory

Issues

pkg:composer/adachsoft/ai-agent-factory

Statistics

Installs: 8

Dependents: 1

Suggesters: 0

Stars: 0

v0.1.0 2026-09-30 10:28 UTC

This package is not auto-updated.

Last update: 2026-10-01 07:41:50 UTC


README

adachsoft/ai-agent-factory builds running ai-agent facades from agent configuration definitions or configuration repositories.

Tool integration

use AdachSoft\AiAgentFactory\PublicApi\Builder\AiAgentFactoryBuilder;
use AdachSoft\AiAgentFactory\PublicApi\Runner\EphemeralAgentRunnerFactory;
use AdachSoft\AiToolCall\PublicApi\Builder\AiToolCallFacadeBuilder;

$factory = AiAgentFactoryBuilder::create()
    ->withProviderCredentials('openai/responses', $apiKey)
    ->build();

$agent = $factory->create($agentDefinition, AiToolCallFacadeBuilder::new()->build());
$response = EphemeralAgentRunnerFactory::create($agent)->run('Summarize this file.');

Application integration

Applications can provide an existing chat facade, context strategies, a conversation repository, and configuration repositories:

$factory = AiAgentFactoryBuilder::create()
    ->withToolCallingChatFacade($toolCallingChatFacade)
    ->withConversationContextStrategy($contextStrategy)
    ->withConversationRepository($conversationRepository)
    ->withAgentConfigRepository($agentConfigRepository)
    ->withSystemPromptRepository($systemPromptRepository)
    ->buildFromConfig();

$agent = $factory->createById($agentId, $aiToolCallFacade);

The library does not read environment variables or configuration files. Provider credentials are passed explicitly. To add a provider, implement ChatProviderFactoryInterface and register it with withChatProviderFactory().

End-to-end test

Copy .env.example to .env, set OPENAI_API_KEY, and run:

composer test:e2e

Unit tests and static analysis are available through composer test and composer stan.