Signals and Signal Sources: What Brezel provides
Back to Signals and Signal Sources.
What Brezel provides
Section titled “What Brezel provides”SignalSources: a module capability for driver selection, configuration, cursor state, and polling health.Signals: a module capability for normalized payloads, classifications, audit state, and case references.Cases: a capability for generated decisions or cases.CaseWorkItems: a capability for reviewable, releasable work derived from a case.SignalDriver: the PHP contract used to add channels other than IMAP.imap: the built-in driver, implemented withdirectorytree/imapengine.webhook: the built-in push driver for external applications. It provisions a token-authenticated source URL and sends received payloads through the same signal classification pipeline as polled sources.signal-filter: an automatically provisioned small-model agent.signal-case-builder: an automatically provisioned large-model agent.
Capabilities generate their canonical fields during Bakery planning. A new module can therefore use "fields": [].
Explicit fields are only needed for presentation data, driver-specific configuration, or an existing schema that should
be mapped to a capability.
Prerequisites
Section titled “Prerequisites”Before enabling a source, make sure that:
- The API version containing the signal jobs and capability classes is deployed.
- Tenant migrations have been applied with
php bakery migrate --force. - The target system has a global client.
- AI provider credentials and the small and large default models are configured.
- The system scheduler runs every minute.
- A queue worker processes the system’s workflow queue.
- The four capability-backed modules described below have been applied.
For local queue processing:
php bakery work exampleFor a typical server, invoke Laravel’s scheduler every minute. The exact PHP path depends on the deployment:
* * * * * cd /path/to/brezel-api && php artisan schedule:run >/dev/null 2>&1Configure the AI model tiers
Section titled “Configure the AI model tiers”Set both defaults in the API environment:
OPENAI_API_KEY=sk-...AI_DEFAULT_SMALL_MODEL=gpt-5.4-miniAI_DEFAULT_LARGE_MODEL=gpt-5.4AI_DEFAULT_MODEL remains the legacy fallback for the large tier. Model resolution follows this order:
- Explicit model on the agent.
- Provider-specific tier configuration, when present.
AI_DEFAULT_SMALL_MODELorAI_DEFAULT_LARGE_MODEL.- Legacy
AI_DEFAULT_MODELfallback.
The signal filter uses small; the case builder uses large. If an agent with the reserved identifier already exists,
Brezel uses that agent unchanged. This makes it possible to customize the provider, model, and instructions before the
first signal arrives:
php bakery agent create example signal-filter \ --name="Signal Filter" \ --provider=openai \ --model-tier=small \ --background
php bakery agent create example signal-case-builder \ --name="Signal Case Builder" \ --provider=openai \ --model-tier=large \ --backgroundAn explicit --model overrides --model-tier. Provider credentials and budgets are configured by the operator of
the instance.
Create the signal source module
Section titled “Create the signal source module”The generic SignalSources capability generates these fields:
| Field | Purpose |
|---|---|
source_identifier | Stable source identity used in deduplication keys. |
driver | Registered driver identifier. Defaults to imap. |
enabled | Whether the scheduler should poll the source. |
configuration | Driver configuration not represented by dedicated fields. |
cursor | Driver-owned incremental polling state. |
webhook_url | Read-only URL generated for a source using the webhook driver. |
webhook_token | Read-only secret token storage. The token is hashed; use the generated URL as the integration credential. |
status | idle, active, or error. |
last_polled_at | Time of the last successful poll. |
last_error | Last polling error, capped at 2,000 characters. |
For an IMAP source, add editable IMAP fields and map them into the driver’s configuration:
[ { "resource_module": "signal_sources", "resource": { "identifier": "signal_sources", "title": "name", "options": { "capabilities": [ { "identifier": "SignalSources", "options": { "field_mapping": { "host_field": "imap_host", "port_field": "imap_port" } } } ] } } }]The capability generates dedicated IMAP fields. Use field_mapping with capability roles such as host_field, port_field, username_field, password_field, encryption_field, validate_cert_field, folders_field, bootstrap_days_field and max_messages_per_poll_field. Dedicated fields override matching keys in the generic configuration field. Folders is a list of objects with a value field, not a list of strings.
The capability also accepts:
| Option | Default | Purpose |
|---|---|---|
drivers | ["imap", "module", "webhook"] | Choice values offered by the generated driver field. Add custom driver identifiers here. |
field_mapping | canonical names | Maps capability roles to fields in an existing module. |