Skip to main content

Symfony Quickstart

packages/symfony now gives Symfony applications a real first-party starting point:
  • one public instructor config root
  • core runtime bindings for Inference, Embeddings, StructuredOutput, HTTP, and events
  • AgentCtrl builder and runtime adapters for cli, http, and messenger

1. Install The Package

2. Register The Bundle

Add the bundle to config/bundles.php if your application does not register it automatically:

3. Add Minimal Core Config

Create config/packages/instructor.yaml:
This baseline is enough to resolve the current core services from the container:
  • Cognesy\Config\Contracts\CanProvideConfig
  • Cognesy\Http\Contracts\CanSendHttpRequests
  • Cognesy\Polyglot\Inference\Inference
  • Cognesy\Polyglot\Embeddings\Embeddings
  • Cognesy\Instructor\StructuredOutput

4. Inject The Core Runtime Services

5. Optionally Enable AgentCtrl

If you also want Symfony-managed code-agent execution, extend the same config file:
The AgentCtrl container entry points are:
  • Cognesy\Instructor\Symfony\AgentCtrl\SymfonyAgentCtrl
  • Cognesy\Instructor\Symfony\AgentCtrl\SymfonyAgentCtrlRuntimes
  • Cognesy\Instructor\Symfony\Delivery\Messenger\ExecuteAgentCtrlPromptMessage
  • Cognesy\Instructor\Symfony\Delivery\Messenger\ExecuteNativeAgentPromptMessage
Example controller using the HTTP runtime:

6. Optionally Enable Persisted Native-Agent Sessions

If you want resumable native-agent sessions across CLI, HTTP, or Messenger worker boots, enable the file-backed adapter:
This keeps the persistence seam package-owned while still letting applications override Cognesy\Agents\Session\Contracts\CanStoreSessions if they need a custom backend later.

7. Current Boundaries

Already supported:
  • bundle registration under Cognesy\Instructor\Symfony\
  • core runtime config translation and service wiring
  • Symfony-aware HTTP transport selection
  • package-owned event bus with optional Symfony event bridging
  • AgentCtrl builder and runtime adapters
  • native-agent session store selection with built-in memory and file adapters
  • package-owned testing patterns built around public container override seams
  • telemetry exporter selection, projector composition, and lifecycle hooks
Still landing in later tasks:
  • logging presets
  • split-package publication bootstrap and Packagist registration
For a practical “which runtime surface should I use?” guide, see packages/symfony/docs/runtime-surfaces.md. For the detailed config surface, see packages/symfony/docs/configuration.md. For the telemetry-specific runtime and exporter guidance, see packages/symfony/docs/telemetry.md. For the package testing model and public helper boundary, see packages/symfony/docs/testing.md. For app-shape observability and delivery guidance, see packages/symfony/docs/operations.md. For migration from older scattered Symfony glue, see packages/symfony/docs/migration.md.