Symfony Runtime Surfaces
packages/symfony exposes three distinct runtime surfaces.
Use this rule of thumb:
- use the core primitives when you want direct inference, embeddings, or structured output
- use
AgentCtrlwhen you want Symfony-managed execution of external CLI code agents such as Codex or Claude Code - use native agents when you want the in-process
Cognesy\Agentsruntime with definitions, tools, capabilities, and resumable sessions
1. Core Primitives
This is the lowest-level surface. Use it when your Symfony app needs:- direct chat or completion calls
- embeddings generation
- structured extraction without agent orchestration
Cognesy\Polyglot\Inference\InferenceCognesy\Polyglot\Embeddings\EmbeddingsCognesy\Instructor\StructuredOutput
2. AgentCtrl
AgentCtrl is the Symfony surface for external code agents.
Use it when you want to run tools such as:
- Codex
- Claude Code
- OpenCode
- Gemini CLI style backends
Cognesy\Instructor\Symfony\AgentCtrl\SymfonyAgentCtrlCognesy\Instructor\Symfony\AgentCtrl\SymfonyAgentCtrlRuntimesCognesy\Instructor\Symfony\Delivery\Messenger\ExecuteAgentCtrlPromptMessage
AgentCtrl when the real unit of work is an external coding agent process, not an in-process InstructorPHP runtime.
3. Native Agents
Native agents are the in-processCognesy\Agents runtime.
Use them when you want:
- package-owned definitions, tools, capabilities, and schemas in Symfony’s container
- resumable session state
- direct control over the runtime without shelling out to external agent CLIs
Cognesy\Agents\Template\Contracts\CanManageAgentDefinitionsCognesy\Agents\Tool\Contracts\CanManageToolsCognesy\Agents\Capability\CanManageAgentCapabilitiesCognesy\Agents\Capability\StructuredOutput\CanManageSchemasCognesy\Agents\Session\Contracts\CanManageAgentSessionsCognesy\Agents\Template\Contracts\CanInstantiateAgentLoopCognesy\Instructor\Symfony\Delivery\Messenger\ExecuteNativeAgentPromptMessage
Which One Should You Choose?
Choose core primitives when:- you want lower-level LLM building blocks
- orchestration belongs in your own application code
AgentCtrl when:
- the agent is an external CLI process
- you want runtime context policy around HTTP, CLI, and Messenger dispatch
- the agent runtime should stay in PHP
- you want Symfony-managed definitions, tools, and session persistence
AgentCtrlorchestrates external agent processes- native agents orchestrate the in-process
Cognesy\Agentsruntime - core primitives are not agent orchestration at all