Query pipeline · Bring your own model
External synthesis, with a first-class hook
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; it is not an ingestion processor and it does not make a model provider part of the retrieval core.
The application owns the worker, model, prompt, structured output, release cadence, and provider account. Core owns the 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 hook ID names customer or worker code, not a built-in provider.
- The open with object can hold endpoint, prompt revision, decoding, tools, or output schema.
yamlCoreCortex Core
responsePlans:
- name: support-cited-answer
retrievalPlan: support-hybrid
evidenceLimit: 10
requireCitations: true
synthesis:
use: io.customer.synthesis.openai-compatible
model: customer-model@revision
connectionSecret: secret://customer/synthesis
with:
endpoint: https://models.customer.example/v1
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": "How do I rotate an API token?",
"responsePlan": "support-cited-answer",
"requireCitations": true,
"evidence": [{
"fragmentId": "support-004::f0001",
"recordId": "support-004",
"content": "Create a replacement token, update clients, then revoke the old token.",
"source": {"url": "https://support.example/token-rotation"},
"attributes": {"category": "api"}
}],
"traceId": "trace-123"
}Validated worker response
jsonCoreCortex Core
{
"answer": "Create the replacement first, update clients, and then revoke the old token.",
"abstained": false,
"citations": [{"fragmentId": "support-004::f0001"}],
"model": "customer-model@revision",
"usage": {"inputTokens": 842, "outputTokens": 37}
}Continue readingEvaluate retrieval and generation→