adachsoft / ai-agent-config-repository
AI agent configuration repository library for AdachSoft projects.
Package info
gitlab.com/a.adach/ai-agent-config-repository
pkg:composer/adachsoft/ai-agent-config-repository
Requires
- php: ^8.3
- adachsoft/collection: ^3.0
Requires (Dev)
- adachsoft/php-code-style: ^0.3
- friendsofphp/php-cs-fixer: ^3.89
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.4
- rector/rector: ^2.3
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Framework-agnostic library for storing AI agent configuration.
This package contains only the configuration model and in-memory repository implementations. Agent runtime composition and JSON file storage are provided by separate packages:
adachsoft/ai-agent-factoryprovides agent composition.adachsoft/ai-agent-config-repository-jsonprovides JSON file repositories.
Requirements
- PHP
^8.3 adachsoft/collection^3.0
Installation
composer require adachsoft/ai-agent-config-repository
Package structure
The root namespace is AdachSoft\AiAgentConfigRepository.
PublicApi/Vocontains validated identifier value objects.PublicApi/Dtocontains configuration and conversation context DTOs.PublicApi/Collectioncontains typed immutable collections.PublicApi/Exceptioncontains public API exceptions.PublicApi/Servicecontains the conversation context profile resolver.SPI/Repositorycontains repository contracts.Infrastructure/Repository/InMemorycontains in-memory repository implementations.
System prompt templates
SystemPromptRepositoryInterface exposes both rendered prompt content and raw templates:
use AdachSoft\AiAgentConfigRepository\PublicApi\Vo\PromptIdVo;
use AdachSoft\AiAgentConfigRepository\SPI\Repository\SystemPromptRepositoryInterface;
/** @var SystemPromptRepositoryInterface $repository */
$template = $repository->getTemplateById(new PromptIdVo('my-prompt'));
The in-memory implementation does not render prompts, so getTemplateById() returns the same text as getById().
Conversation context profiles
Conversation context profiles are represented by public DTOs and resolved through ConversationContextProfileResolver. JSON file storage for these profiles belongs to adachsoft/ai-agent-config-repository-json.
Tests and quality
vendor/bin/phpunit
vendor/bin/phpstan analyse src tests
vendor/bin/rector process src tests
vendor/bin/php-cs-fixer fix src tests