Runtime Contract
Last Updated: 2026-04-09Purpose
Define which file is authoritative for each runtime concern. This file is for engineering only. It prevents duplicated logic across config files and prompt files.Source of Truth by Concern
1. Model invocation
Authoritative file:model_config.json
- provider
- model name
- temperature
- max tokens
- top_p
2. Prompt assembly
Authoritative file:model_config.json
- instruction file order
- whether conversation memory is included in prompt
- max history turns included in prompt
3. Retrieval behavior
Authoritative file:retrieval_config.json
- intent classification
- query rewrite
- metadata prefiltering
- hybrid search
- reranking
- conflict detection
- top-k selection
- confidence thresholds
- follow-up trigger rules
- escalation trigger rules
- retrieval logging
4. Knowledge and behavior instructions
Authoritative files:system_behavior.mdaudience_rules.mdadvisor_behavior.mdresponse_rules.mdescalation_rules.mdretrieval_rules.md
5. Knowledge content
Authoritative location:/knowledge/**
Precedence Rules
If two sources overlap, use this order:- Runtime contract
- JSON runtime config
- Prompt instruction files
- Retrieved knowledge chunks
- Prompt files may shape wording and behavior.
- Prompt files must not be parsed as backend config.
- Retrieved knowledge may answer user questions.
- Retrieved knowledge must not change runtime pipeline settings.
Engineering Rule
Do not define the same operational setting in both:model_config.jsonretrieval_config.json
- it belongs in
retrieval_config.json
- it belongs in
model_config.json