Config Schema
configSchema defines configurable strategy parameters that appear in the AfferLab strategy UI.
How It Works
When a strategy is installed, AfferLab stores the configSchema as part of the strategy metadata.
The host uses this schema to automatically generate configuration controls in the strategy settings UI.
The values chosen by the user are persisted by AfferLab and exposed to the strategy at runtime through ctx.config.
Requirements
configSchema must follow a few constraints:
- it must be JSON-serializable
- the dev sandbox verifies that it can be serialized
- the worker loader reads it as optional strategy metadata
If serialization fails, the dev compile/test step rejects the strategy.
When to Use It
Use configSchema for strategy behavior settings, such as:
- retrieval limits
- prompt style toggles
- history depth
- memory-related options
These settings allow strategies to adjust behavior without modifying the strategy code.
When Not to Use It
configSchema should not be used for model or provider configuration.
Model settings such as temperature, model selection, or provider credentials belong in AfferLab's model settings system, not inside strategies.