Agent integration
Use Enterprise routing to translate an agent question into an explicit retrieval request, then give the agent only authorized evidence and validate its citations.
Integration flow
| Step | Owner | Contract |
|---|---|---|
| 1. Establish scope | Application authentication boundary | Tenant, user, workspace, matter, document, and dataset permissions |
| 2. Route | Enterprise query hook | Intent, retrieval plan, evidence plan, filters, limit, confidence, review signal |
| 3. Retrieve | CoreCortex query API | Authorized ranked Evidence with trace identity |
| 4. Act or synthesize | Application agent | Tool result or answer over supplied evidence |
| 5. Validate and log | Application + Core contracts | Citation membership, abstention, request ID, trace ID, model identity |
Call the routing hook
cat > request-scope.json <<'JSON'
{"matter_id": "matter-482", "jurisdiction": "federal"}
JSON
corec query route \
"What authorities does this matter cite?" \
--dataset authorities \
--filters request-scope.json \
--output routing-decision.jsonRead the routing decision
The decision is advisory and inspectable. The application intersects its filters with authenticated policy before retrieval. A routing confidence score never grants access and never acts as answer confidence.
{
"apiVersion": "corecortex.io/enterprise/v1alpha1",
"kind": "QueryRoutingDecision",
"request": {
"query": "What authorities does this matter cite?",
"intent": "relationship",
"retrievalPlan": "bounded_graph_then_evidence",
"scope": "matter",
"evidencePlan": "graph_path",
"filters": {"dataset": "authorities", "matter_id": "matter-482", "jurisdiction": "federal"},
"limit": 10,
"explain": false
},
"routing": {"signals": ["matter_filter", "relationship_language"], "confidence": 0.85, "requiresAgentReview": true}
}Translate routing into the query API
CoreCortex applies tenant and record policy at candidate generation and again before evidence leaves the retrieval boundary. The response gives the agent evidence IDs, source identity, content hashes, processor revisions, and trace information.
POST /v1/corpora/{corpusId}/query
Authorization: Bearer <token>
X-CoreC-Tenant-Id: <tenant-uuid>
Content-Type: application/json
{
"query": "What authorities does this matter cite?",
"retrievalPlan": "bounded_graph_then_evidence",
"intent": "relationship",
"filters": {"dataset": "authorities", "matter_id": "matter-482", "jurisdiction": "federal"},
"limit": 10,
"explain": true
}Supported deterministic routing intents
| Intent | Detected signal | Suggested strategy |
|---|---|---|
| lookup | Structured identifier such as record key, external identifier, or version code | Lexical single passage |
| exact | Quoted or explicitly verbatim language | Lexical single passage |
| comparison | Compare, difference, changed, versus, or timeline | Hybrid multi-passage |
| relationship | Cites, connected, between, path, authority, treatment, or linked | Bounded graph then source evidence |
| semantic | Detopic natural-language question | Hybrid evidence retrieval |
Add customer-owned synthesis
Set responsePlan when the agent needs a generated answer. The Synthesis page defines the request, response, citation, and abstention rules; the Evaluation page defines the answer tests.
Agent safety invariants
- Authentication and tenant context come from the trusted application boundary.
- Routing hints can narrow scope and choose a strategy; they cannot expand permissions.
- Relationship paths require agent review and resolve back to source evidence before use.
- The agent receives stable evidence identities and cites only supplied fragments.
- Expected-empty and unavailable-source cases lead to explicit abstention behavior.
- Request, trace, configuration, index, model, and judgment identities remain available for replay and evaluation.