Configuration Models
Data structures for system configuration — profile extraction, playbook extraction, evaluation, storage, and LLM settings.
Config
Root configuration object for the Reflexio system. Every nested type below is linked — click through to see the fields each accepts.
| Prop | Type | Default | Description |
|---|---|---|---|
storage_config | StorageConfig | — | Database storage configuration. One of the StorageConfig variants. |
storage_config_test? | StorageConfigTest | "unknown" | Latest storage-configuration test state. Primarily populated by the server. |
agent_context_prompt? | string | — | Global agent context prompt describing the agent's environment |
tool_can_use? | array[ToolUseConfig] | — | Tools the agent can use (shared across success evaluation and playbook extraction) |
profile_extractor_config? | ProfileExtractorConfig | — | Profile extraction configuration. |
user_playbook_extractor_config? | UserPlaybookExtractorConfig | — | User playbook extraction configuration. |
agent_success_config? | AgentSuccessConfig | — | Agent success evaluation configuration. Defaults to an AI-agent success rubric with 5% session sampling; set to null to disable. |
extraction_preset? | ExtractionPreset | — | Named preset that bundles `window_size` and `stride_size`. One of "quick_chat", "standard", "long_form", "high_volume". Explicit window_size/stride_size override the preset. |
window_size? | integer | 10 | Number of interactions analyzed per extraction window |
extraction_idle_timeout_seconds? | int | 21600 | Session inactivity delay for judged partial-window evaluation. Default 21600 (six hours); 0 disables for new publications. Captured at admission, so changes apply prospectively. |
stride_size? | integer | 8 | New interactions required before the next extraction window. Must be less than or equal to window_size. |
api_key_config? | APIKeyConfig | — | API key configuration for LLM providers |
llm_config? | LLMConfig | — | LLM model configuration overrides |
retrieval_experiment_config? | RetrievalExperimentConfig | — | The single active user-level retrieval holdout. Read-only through generic config routes; use the experiment lifecycle endpoints to change it. |
retrieval_experiment_history? | array[RetrievalExperimentRecord] | [] | Active and completed retrieval experiment lifecycle records. Managed by the experiment lifecycle endpoints. |
skip_should_run_check? | boolean | false | When true, skip the LLM pre-extraction eligibility check and always run extraction. Saves one LLM call per window but means every window triggers full extraction. |
enable_document_expansion? | boolean | false | Enable storage-time document expansion for improved FTS recall |
retrieval_floor? | RetrievalFloorConfig | — | Read-path relevance floor configuration. Reranks unified-search results with a cross-encoder and drops those below a per-arm floor. |
playbook_optimizer_config? | PlaybookOptimizerConfig | — | Opt-in GEPA-backed playbook content optimizer configuration. |
lineage_gc? | LineageGCConfig | — | Retention and polling settings for lineage tombstone garbage collection. |
expiry_reclamation? | ExpiryReclamationConfig | — | Direct deletion of expired non-audited rows. |
governance_retention? | GovernanceRetentionConfig | — | Hosted Enterprise audit-event retention policy. |
pending_tool_call_config? | PendingToolCallConfig | — | Configuration for non-blocking async information tools during extraction. |
eval_sample_n_per_stratum? | integer | 200 | F3: stratified-sample cap per (day × group) stratum in the regen pipeline. Strata with fewer items are kept whole. Predictable cost regardless of traffic volume. |
eval_concurrency_limit? | integer | 10 | F3: max simultaneous LLM judge calls in flight per regen job, enforced via a ThreadPoolExecutor. Bound to respect provider rate limits. |
shadow_comparison_judge_prompt_version? | string | "v1.1.0" | F1: pinned judge prompt version for per-turn shadow comparison. Verdicts are stored with the version that produced them; the dashboard filters to this org's current pinned version so a future rubric bump doesn't silently mix epochs into the headline. |
Enterprise Offline Tuner Configuration
Enterprise get_config responses include a separate offline-tuner overlay:
{
"offline_tuner_config": {
"enabled": false
}
}offline_tuner_config is a response overlay, not a persisted shared Config
field. The Python client's set_config method strips response overlays from
Config model instances, including objects returned by get_config; a
dictionary containing an overlay is rejected by strict shared-Config
validation. Use the enterprise tuning controls for enablement; availability is
separate from the shared Config model. deployment_unsupported means the mode
is unrecognized, config_reset_incomplete means setup has not finished, and
tuner_not_composed can mean the tenant's method-schema upgrade is pending.
Managed platform and self-hosted deployments are supported once their required
setup is ready. A response overlay alone does not establish that tuning is active.
StorageConfig
StorageConfig is a union type — pass whichever variant matches your deployment. None is also accepted (no storage configured yet).
StorageConfigSQLite
Local SQLite storage. The default for Local OSS.
| Prop | Type | Default | Description |
|---|---|---|---|
db_path? | string | — | Path to the SQLite file. If omitted, the server writes `reflexio.db` to the directory set by `LOCAL_STORAGE_PATH` (defaults to `~/.reflexio/data/`). |
StorageConfigSupabase
Supabase-backed storage for Hosted Enterprise configurations.
| Prop | Type | Default | Description |
|---|---|---|---|
url | string | — | Supabase project URL. |
key | string | — | Supabase service-role key. |
db_url | string | — | Direct Postgres connection URL (used for migrations and vector search). |
read_url? | string | — | Optional Supabase/PostgREST reader URL used for search. Defaults to `url`. |
read_key? | string | — | Optional reader key used for search. Defaults to `key`. |
schema? | string | — | Optional Postgres schema. Hosted Reflexio uses this for platform-managed per-org schemas; leave it unset for bring-your-own Supabase. |
StorageConfigPostgres
Native PostgreSQL-backed storage for RDS or bring-your-own Postgres deployments.
| Prop | Type | Default | Description |
|---|---|---|---|
type? | literal["postgres"] | "postgres" | Storage discriminator. |
db_url | string | — | Direct PostgreSQL connection URL. |
schema? | string | — | Optional Postgres schema for Reflexio data. Defaults to `public`. |
pool_size? | integer | 10 | Maximum direct SQL connections per process (per organization). |
pool_acquire_timeout? | number | 30.0 | Seconds a query waits for a free pooled connection before failing. |
read_db_url? | string | — | Optional reader PostgreSQL URL used for search. Defaults to `db_url`. |
read_pool_size? | integer | — | Maximum reader SQL connections per process (per organization). Defaults to `pool_size`. |
read_pool_acquire_timeout? | number | — | Seconds search waits for a free reader connection before failing. Defaults to `pool_acquire_timeout`. |
StorageConfigManagedSupabase
Read-only representation returned when Hosted Enterprise manages storage credentials.
| Prop | Type | Default | Description |
|---|---|---|---|
managed_by | literal["platform"] | — | Indicates that Hosted Enterprise manages the storage connection. |
schema_present? | boolean | true | Whether the managed organization schema is present. |
ToolUseConfig
Defines a tool that the agent can use.
| Prop | Type | Default | Description |
|---|---|---|---|
tool_name | string | — | Name of the tool |
tool_description | string | — | Description of what the tool does |
ProfileExtractorConfig
Configuration for profile extraction from interactions.
Legacy extractor/evaluation names are accepted and discarded when loading older configurations. They are absent from the current schema and saved configuration; runtime identities are fixed.
| Prop | Type | Default | Description |
|---|---|---|---|
extraction_definition_prompt | string | — | Prompt defining what to extract from interactions. Legacy field name `profile_content_definition_prompt` is accepted and auto-migrated. |
context_prompt? | string | — | Additional context for profile extraction |
tagging_definition_prompt? | string | — | Prompt defining tags applied asynchronously to persisted profiles |
should_extract_profile_prompt_override? | string | — | Override prompt for extraction conditions |
request_sources_enabled? | array[string] | — | Only extract from these request sources. If not set, extracts from all sources |
manual_trigger? | boolean | false | If true, skip auto extraction and require manual triggering (rerun) |
window_size_override? | integer | — | Override global window_size for this extractor |
stride_size_override? | integer | — | Override global stride_size for this extractor |
UserPlaybookExtractorConfig
Configuration for user-playbook extraction. Also exposed as PlaybookConfig (deprecated alias).
Legacy extractor/evaluation names are accepted and discarded when loading older configurations. They are absent from the current schema and saved configuration; runtime identities are fixed.
| Prop | Type | Default | Description |
|---|---|---|---|
extraction_definition_prompt | string | — | Prompt defining what playbook entries to extract. Legacy field names `playbook_definition_prompt`/`feedback_definition_prompt` are accepted and auto-migrated. |
context_prompt? | string | — | Additional context for playbook extraction |
tagging_definition_prompt? | string | — | Prompt defining tags applied asynchronously to persisted playbooks |
aggregation_config? | PlaybookAggregatorConfig | PlaybookAggregatorConfig() | Configuration for playbook aggregation (clustering similar user playbooks). Missing and legacy `null` values use the enabled defaults. Set `min_cluster_size` to `1` to disable aggregation while retaining user-playbook extraction. Legacy field name `playbook_aggregator_config` is accepted and auto-migrated. |
deduplication_config? | DeduplicationConfig | — | Configuration for playbook deduplication against existing user playbooks. |
request_sources_enabled? | array[string] | — | Only extract from these request sources. If not set, extracts from all sources |
window_size_override? | integer | — | Override global window_size for this playbook config |
stride_size_override? | integer | — | Override global stride_size for this playbook config |
PlaybookAggregatorConfig
Configuration for playbook aggregation (clustering similar user playbooks into agent playbooks).
| Prop | Type | Default | Description |
|---|---|---|---|
min_cluster_size? | integer | 2 | Minimum user playbooks required before aggregation runs. Set to 1 to disable aggregation while retaining user-playbook extraction. |
reaggregation_trigger_count? | integer | 2 | Number of new user playbooks that trigger a re-aggregation |
clustering_similarity? | float | null | Model-specific: 0.30 for MiniLM/other models; 0.85 for Nomic | Cosine similarity threshold for clustering. Higher values require user playbooks to be more similar to cluster together (0.0–1.0). When omitted, Reflexio uses the active embedding model's calibrated default. |
direction_overlap_threshold? | float | 0.6 | Token overlap threshold for grouping playbooks by direction (0.0–1.0) |
DeduplicationConfig
Controls bounded candidate generation when looking for existing playbooks to dedup against. The LLM consolidation stage makes the final duplicate decision.
| Prop | Type | Default | Description |
|---|---|---|---|
strategy? | 'legacy' | 'audited' | legacy | Select legacy consolidation or evidence-backed consolidation with independent review. Audited requires persisted source observations for new advice. Use legacy for compatibility or rollback. |
search_threshold? | float | 0.4 | Minimum similarity score for bounded deduplication candidate generation (0.0–1.0). This dedicated threshold is independent from the embedding model's user-facing retrieval default; an LLM makes the final duplicate decision. |
search_top_k? | integer | 5 | Maximum number of existing playbooks to retrieve per new playbook |
max_unified_content_chars? | integer | 1200 | Legacy strategy soft content-length cap used when deciding whether duplicate playbooks should be unified. |
RetrievalExperimentConfig
The one retrieval experiment currently assigning agent search traffic.
| Prop | Type | Default | Description |
|---|---|---|---|
experiment_id | string | — | Organization-unique experiment ID, up to 128 characters. |
holdout_percentage | float | — | Percentage of users assigned to holdout. Must be greater than 0 and less than 100. |
RetrievalExperimentRecord
Historical lifecycle metadata for a retrieval experiment. It contains all
RetrievalExperimentConfig fields plus:
| Prop | Type | Default | Description |
|---|---|---|---|
started_at | integer | — | Unix timestamp when assignment began. |
ended_at? | integer | — | Unix timestamp when assignment stopped. Omitted while active. |
RetrievalFloorConfig
Configuration for the read-path relevance floor applied on unified search (/api/search). Retrieved candidates are reranked by a cross-encoder, and any result whose relevance score falls below the per-arm floor is dropped. Because filtering happens after retrieval, a search arm can return fewer than top_k results — including zero — when nothing clears its floor.
Floors are raw, model-specific cross-encoder logits, not probabilities, so they are not bounded to [0, 1] and can be negative. Leave a floor null to use the calibrated default for the reranker discovered from the private inference service; a numeric value, including 0.0, is preserved exactly.
| Prop | Type | Default | Description |
|---|---|---|---|
enabled? | boolean | false | Master switch for the relevance floor. When false, no cross-encoder rerank/floor is applied. |
pool_size? | integer | 30 | Number of candidates retrieved and passed to the cross-encoder reranker before the floor is applied. Must be greater than 0. |
profile_floor? | float | null | null | Minimum raw cross-encoder logit for a profile result to be kept. Null selects the discovered reranker's calibrated default. |
user_playbook_floor? | float | null | null | Minimum raw cross-encoder logit for a user-playbook result to be kept. Null selects the discovered reranker's calibrated default. |
agent_playbook_floor? | float | null | null | Minimum raw cross-encoder logit for an agent-playbook result to be kept. Null selects the discovered reranker's calibrated default. |
PlaybookOptimizerConfig
Opt-in (disabled by default) GEPA-backed optimizer for playbook content. Requires exactly one assistant backend — webhook_url or assistant_script_path, not both.
| Prop | Type | Default | Description |
|---|---|---|---|
enabled? | boolean | false | Master switch for the optimizer. |
optimize_agent_playbooks? | boolean | false | Optimize agent playbooks. |
user_playbooks_enabled? | boolean | false | Enable user-playbook optimization and adoption. Also requires the master enabled switch. |
auto_update_pending_agent_playbooks? | boolean | true | Automatically apply optimized content to pending agent playbooks. |
max_metric_calls? | integer | 20 | GEPA budget: maximum metric evaluations per run. |
max_turns? | integer | 4 | GEPA budget: maximum optimization turns. |
early_stop_score? | float | 0.9 | Stop early once this score is reached (0.0–1.0). |
reflection_minibatch_size? | integer | 2 | Minibatch size for GEPA reflection. |
max_validation_windows? | integer | 2 | Maximum validation windows. |
min_commit_windows? | integer | 2 | Minimum windows required before committing a change. |
min_commit_score? | float | 0.75 | Minimum score required to commit a change (0.0–1.0). |
min_commit_likert? | integer | 4 | Minimum Likert rating required to commit (1–5). |
max_merge_invocations? | integer | 5 | Maximum merge invocations; zero disables merging. |
reflection_model? | string | — | Optional model override for the GEPA reflection step. |
webhook_url? | string | — | Assistant backend: webhook URL the optimizer posts rollouts to. |
webhook_auth_header? | string | — | Optional Authorization header value for the webhook. |
webhook_timeout_seconds? | integer | 60 | Request timeout (applies to both backends). |
webhook_max_retries? | integer | 3 | Maximum retries on failure. |
webhook_backoff_base_seconds? | float | 1.0 | Base backoff between retries. |
assistant_script_path? | string | — | Assistant backend: absolute path to a local executable invoked per turn (stdin payload, stdout `{"content": "..."}`). |
assistant_script_args? | array[string] | [] | Extra arguments passed to the local assistant script. |
Scheduler timing is owned by Reflexio: up to one second of jitter and a one-hour
cooldown after two consecutive aborts. Successful or skipped runs reset the abort
counter. These timings are no longer org configuration fields. Legacy
scheduler_jitter_seconds=1.0, abort_cooldown_threshold=2, and
cooldown_after_aborts_seconds=3600 are accepted and removed on save. Other or
malformed legacy values stop configuration loading with a migration error,
even when optimization is disabled. Remove those fields explicitly to adopt
this policy; remain on the previous release if custom retry timing is required.
No saved custom values are automatically overwritten.
PendingToolCallConfig
Configuration for non-blocking pending tool calls (async information tools) during classic extraction.
| Prop | Type | Default | Description |
|---|---|---|---|
enabled? | boolean | false | Master switch for pending tool calls. |
max_pending_followups_per_scope? | integer | 10 | Maximum concurrent pending follow-ups per scope. |
pending_ttl_seconds? | integer | 86400 | How long a pending call remains valid before expiry. |
dedup_cache_seconds? | integer | 300 | Window for de-duplicating identical pending calls. |
prior_answer_valid_seconds? | integer | 2592000 | How long a prior answer is reused before re-asking. |
similarity_threshold? | float | 0.0 | Similarity threshold for matching prior answers (0.0–1.0). |
max_resume_attempts? | integer | 3 | Maximum resume attempts. |
max_finalization_attempts? | integer | 3 | Maximum finalization attempts. |
hmac_secrets? | array[string] | [] | HMAC secrets used to sign/verify resume callbacks. |
tool_overrides? | dict[str, PendingToolCallToolOverrideConfig] | — | Optional per-tool overrides keyed by exact tool name. Each override may set any of the limit fields above; unset fields fall back to the base values. |
Resume execution timing is owned by Reflexio: five-second polling and 600-second
claims shared by workers, discovery and recovery. Legacy
resume_poll_interval_seconds=5.0 and resume_claim_ttl_seconds=600 are accepted
and removed from canonical saves. Custom or malformed values stop configuration
loading, even when pending tools are disabled. Explicitly remove the old fields
to adopt this policy, or stay on the previous release if custom timing is needed.
Waiting-call expiry, cached-answer freshness, per-tool overrides and resume versus
finalization retry budgets remain independent settings.
LineageGCConfig
Controls reclamation of retired profile and playbook tombstones after the audit and rollback window.
| Prop | Type | Default | Description |
|---|---|---|---|
enabled? | boolean | true | Run lineage tombstone garbage collection. |
tombstone_grace_window_days? | integer | 90 | Days to retain tombstone content after its retirement time. |
Housekeeping cadence is code-owned (daily). Legacy poll_interval_seconds=86400 is
accepted and omitted from canonical configuration; custom values require migration.
ExpiryReclamationConfig
| Prop | Type | Default | Description |
|---|---|---|---|
enabled? | boolean | false | Directly reclaim expired non-audited rows such as share links and pending tool calls. |
GovernanceRetentionConfig
Hosted Enterprise retention policy for audit events. These fields are accepted but do not perform audit-event reclamation in Local OSS.
| Prop | Type | Default | Description |
|---|---|---|---|
audit_events_retention_enabled? | boolean | false | Enable audit-event retention enforcement. |
audit_events_retention_days? | integer | 365 | Maximum audit-event age before reclamation. |
Audit reclamation uses code-owned batches of up to 500 rows per table per sweep.
Legacy audit_events_delete_batch_limit=500 is accepted and omitted; custom values
require explicit migration. Retention enablement and age remain configurable.
AgentSuccessConfig
Configuration for agent success evaluation. Evaluation judges the complete
source-filtered session, or an explicitly requested cutover prefix. It does not
use extraction window/stride overrides. Legacy override fields and their
batch_*_override / extraction_window_* aliases are accepted as ignored input
and omitted from schemas and canonical saves. Profile and playbook extraction
windows remain configurable.
Legacy extractor/evaluation names are accepted and discarded when loading older configurations. They are absent from the current schema and saved configuration; runtime identities are fixed.
| Prop | Type | Default | Description |
|---|---|---|---|
success_definition_prompt | string | — | Prompt defining what constitutes a successful agent interaction. Config defaults include a built-in AI-agent success rubric. |
tagging_definition_prompt? | string | — | Prompt defining tags applied asynchronously to persisted evaluation summaries. On stored-config reads, the retired `metadata_definition_prompt` field is discarded and does not become tagging instructions; new writes reject that retired field. |
request_sources_enabled? | list[string] | — | Only evaluate requests from these sources. If not set, evaluates all sources. |
sampling_rate? | float | 0.05 | Fraction of sessions to evaluate automatically (0.0–1.0) |
evaluation_only_sampling_rate? | float | null | null (inherits sampling_rate) | Fraction of evaluation-only sessions to evaluate automatically with the session-success judge (0.0–1.0). When null, inherits the current sampling_rate. |
retrieved_learning_sampling_rate? | float | null | null (inherits sampling_rate) | Fraction of sessions to judge for retrieved-learning relevance and impact (0.0–1.0). When null, inherits sampling_rate. Set it independently when the retrieved-learning verdicts feed a downstream consumer that needs denser coverage than the session-success judge. |
ExtractionPreset
Named presets that bundle window_size and stride_size. Accepts a string.
quick_chat— short conversations (support bots, quick Q&A).window_size=5,stride_size=3.standard— general-purpose conversational agents.window_size=10,stride_size=8. (default)long_form— long conversations (coding assistants, research).window_size=25,stride_size=10.high_volume— high-traffic agents (1000+ daily interactions).window_size=15,stride_size=8.
APIKeyConfig
API key configuration for LLM providers. When custom_endpoint is configured, it takes priority over all other providers for LLM completion calls (but not embeddings).
| Prop | Type | Default | Description |
|---|---|---|---|
custom_endpoint? | CustomEndpointConfig | — | Custom OpenAI-compatible endpoint |
openai? | OpenAIConfig | — | OpenAI API configuration (direct or Azure) |
anthropic? | AnthropicConfig | — | Anthropic API configuration |
openrouter? | OpenRouterConfig | — | OpenRouter API configuration |
gemini? | GeminiConfig | — | Google Gemini API configuration |
minimax? | MiniMaxConfig | — | MiniMax API configuration |
deepseek? | DeepSeekConfig | — | DeepSeek API configuration |
dashscope? | DashScopeConfig | — | Alibaba DashScope (Qwen) API configuration |
zai? | ZAIConfig | — | Zhipu AI (GLM) API configuration |
moonshot? | MoonshotConfig | — | Moonshot (Kimi) API configuration |
xai? | XAIConfig | — | xAI (Grok) API configuration |
CustomEndpointConfig
OpenAI-compatible custom endpoint. Validated against SSRF: cloud metadata endpoints are always blocked, and when REFLEXIO_BLOCK_PRIVATE_URLS=true, literal private IPs plus hostnames resolving to private, loopback, link-local, reserved, multicast, or unspecified IPs are blocked.
| Prop | Type | Default | Description |
|---|---|---|---|
model | string | — | Model name to use (e.g., 'openai/mistral', 'mistral'). Passed as-is to LiteLLM. |
api_key | string | — | API key for the custom endpoint. |
api_base | string | — | Base URL of the custom endpoint (e.g., 'http://localhost:8000/v1'). |
OpenAIConfig
OpenAI API configuration. At least one of api_key or azure_config must be provided.
| Prop | Type | Default | Description |
|---|---|---|---|
api_key? | string | — | Direct OpenAI API key. |
azure_config? | AzureOpenAIConfig | — | Azure OpenAI configuration (use instead of `api_key` for Azure-hosted OpenAI). |
AzureOpenAIConfig
| Prop | Type | Default | Description |
|---|---|---|---|
api_key | string | — | Azure OpenAI API key. |
endpoint | string | — | Azure resource endpoint (e.g. `https://your-resource.openai.azure.com/`). |
api_version? | string | "2024-02-15-preview" | API version. |
deployment_name? | string | — | Deployment name. Optional — can be specified per request instead. |
AnthropicConfig
| Prop | Type | Default | Description |
|---|---|---|---|
api_key | string | — | Anthropic API key. |
OpenRouterConfig
| Prop | Type | Default | Description |
|---|---|---|---|
api_key | string | — | OpenRouter API key. |
GeminiConfig
| Prop | Type | Default | Description |
|---|---|---|---|
api_key | string | — | Google Gemini API key. |
MiniMaxConfig
| Prop | Type | Default | Description |
|---|---|---|---|
api_key | string | — | MiniMax API key. |
DeepSeekConfig
| Prop | Type | Default | Description |
|---|---|---|---|
api_key | string | — | DeepSeek API key. |
DashScopeConfig
| Prop | Type | Default | Description |
|---|---|---|---|
api_key | string | — | Alibaba DashScope (Qwen) API key. |
api_base? | string | — | Base URL. If unset, the default is used — override for intl vs. China endpoints. |
ZAIConfig
| Prop | Type | Default | Description |
|---|---|---|---|
api_key | string | — | Zhipu AI (GLM) API key. |
MoonshotConfig
| Prop | Type | Default | Description |
|---|---|---|---|
api_key | string | — | Moonshot (Kimi) API key. |
XAIConfig
| Prop | Type | Default | Description |
|---|---|---|---|
api_key | string | — | xAI (Grok) API key. |
LLMConfig
LLM model configuration overrides. If a field is None, the system default is used.
| Prop | Type | Default | Description |
|---|---|---|---|
should_run_model_name? | string | — | Model for "should run extraction" checks |
generation_model_name? | string | — | Model for generation and evaluation tasks |
embedding_model_name? | string | — | Model for embedding generation |
pre_retrieval_model_name? | string | — | Model for pre-retrieval query reformulation |