Query pipeline · Bring your own model
Synthesis
Keep retrieval independent while giving applications a typed, authorized, and evaluable way to invoke their own model.
The boundary
CoreCortex returns ranked evidence by default. A response plan is an optional query-time pipeline layered over a retrieval plan and remains separate from dataset ingestion.
The application owns the selected model, prompt, structured output, release cadence, and provider account. Core owns the LanguageModelProvider boundary, authorized evidence envelope, fragment citation contract, trace identity, and reproducibility fields.
Configure the hook
- responsePlans is optional; retrieval works without it.
- A local model may omit connectionSecret.
- The public OpenAI-compatible provider supports LiteLLM Rust, TensorZero, current LiteLLM, and compatible customer gateways.
- The open with object can hold endpoint, prompt revision, decoding, tools, or output schema.
yamlCoreCortex Core
responsePlans:
- name: evidence-summary
retrievalPlan: topic-investigation
evidenceLimit: 12
requireCitations: true
synthesis:
use: openai-compatible
gateway: litellm-rust
model: customer-model
revision: deployment-2026-08
connectionSecret: secret://customer/synthesis
with:
temperature: 0
outputSchema: cited_answer_v1End-to-end flow
| Step | Owner | Result |
|---|---|---|
| 1. Retrieve | CoreCortex | Ranked evidence from the named retrieval plan |
| 2. Authorize | CoreCortex | Only permitted fragments enter the hook envelope |
| 3. Generate | Application worker | Answer or explicit abstention from the customer model |
| 4. Validate | Public Core contract | Citations must name supplied fragment IDs |
| 5. Evaluate | Enterprise runner or customer tooling | Faithfulness, coverage, abstention, latency, and cost |
Model-neutral request envelope
jsonCoreCortex Core
{
"query": "What guide applies to the repeated topic on RECORD-104?",
"responsePlan": "evidence-summary",
"requireCitations": true,
"evidence": [{
"fragmentId": "GUIDE-17@4::inspection",
"recordId": "GUIDE-17@4",
"content": "Confirm the source version, then compare canonical identity and derived evidence.",
"source": {"url": "https://example.test/guides/GUIDE-17/revisions/4"},
"attributes": {"status": "approved", "topic_code": "TOPIC-07"}
}],
"traceId": "trace-123"
}Validated worker response
jsonCoreCortex Core
{
"answer": "Use approved guide GUIDE-17 revision 4: confirm the source version, then compare canonical identity and derived evidence.",
"abstained": false,
"citations": [{"fragmentId": "GUIDE-17@4::inspection"}],
"model": "customer-model@revision",
"usage": {"inputTokens": 842, "outputTokens": 37}
}Continue readingArchitecture→