Skip to content
Browse documentation

Concepts

Query & the AegisQuery AST

Search requests are a small, validated query object — the AegisQuery AST. The caller proposes it; the engine clamps scope, intersects grants, and ACL-filters before running it.

The query object#

The body of POST /v1/search is an AegisQuery. Only q is required; everything else has a safe default. It is validated with a strict schema — out-of-range values return 400.

FieldTypeDefaultDescription
qstring— (required)Natural-language query text.
planesPlane[]["text"]Retrieval planes to search.
top_kint 1–5020Number of hits to return.
rrf_kint > 060RRF rank constant (higher = flatter).
rerankbooleantrueApply the cross-encoder reranker.
granularityfile | sub_unitsub_unitReturn whole files or sub-unit spans.
consistencystrong | eventualstrongRead consistency preference.
filtersFilterClause[][]Structured metadata filters.
modalitiesModality[]unsetRestrict to specific modalities.
answerbooleanfalseRequest a synthesized cited answer (roadmap).
budgetBudgetunsetMachine-checked execution guardrails.

Scope is not a body field

Although the schema carries a scope field, the search endpoint overrides it with the value from X-Aegis-Scope / ?scope=. Always set scope via the header or query parameter. See Authentication.

Filters & operators#

A filter clause is { field, op, value }. Values may be a string, number, boolean, or an array (for in / nin). Supported operators:

  • eq, neq — equality / inequality.
  • in, nin — membership against an array value.
  • lt, lte, gt, gte — numeric / ordinal comparisons.
  • prefix, contains — string matching.
a filtered query
{
  "q": "revenue guidance",
  "planes": ["text"],
  "top_k": 10,
  "rerank": true,
  "filters": [
    { "field": "modality", "op": "eq", "value": "asr" },
    { "field": "t_bucket", "op": "gte", "value": 480000 }
  ]
}

Execution budget#

The optional budget object bounds an agentic run so cost stays predictable. All fields have defaults and are enforced by the executor.

FieldDefaultMeaning
max_rounds3Max retrieve → refine iterations.
max_mllm_calls2Max vision/LLM verification calls.
max_neurons8000Inference-unit spend ceiling.
max_latency_ms15000Wall-clock ceiling.

Validation

Requests are validated before execution. For example {"q":"x","top_k":999} is rejected because top_k exceeds 50:

400 Bad Request
{ "error": "bad_request", "detail": "...top_k...", "status": 400 }