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_v1

End-to-end flow

StepOwnerResult
1. RetrieveCoreCortexRanked evidence from the named retrieval plan
2. AuthorizeCoreCortexOnly permitted fragments enter the hook envelope
3. GenerateApplication workerAnswer or explicit abstention from the customer model
4. ValidatePublic Core contractCitations must name supplied fragment IDs
5. EvaluateEnterprise runner or customer toolingFaithfulness, 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}
}