Inference Overview
How inference queries work. You ask one question and Syncropel sends it to a mix of AI models, saved patterns, systems, and people, then combines their answers into one.
Overview
A query is a record with body.kind: "infer.query.v1". Syncropel sends it to a set of responders, collects their answers, combines them into one result, and saves that result as a KNOW record on the query's thread.
Queries use the same things you already use: queries are INTEND records, responders are actors or system adapters you have registered, and the answer is a KNOW record that other records can cite.
With a chat model, you ask one model at a time. Inference lets you ask many responders of different kinds (AI models, patterns, system adapters, and people) in one query, with a rule for how their answers combine.
Why queries are records
A query is an INTEND record whose body follows the infer.query.v1 format. When one is saved, Syncropel picks the responders, ranks them, sends them the question, waits for their answers, combines and checks the result, and saves it as a new KNOW record on the same thread. There is no separate service to set up.
This means:
- Everything is auditable. Every request sent, every answer returned, and every contributor to the result is a record you can inspect with
spl thread records. - Everything can be replayed. The same answers always combine into the same result.
- Everything chains. A query's answer can be the input of another query.
Query anatomy
An infer.query.v1 body has four required parts and several optional ones.
infer.query.v1
├── input (required): what you want answered
├── responders (required): who may answer
├── answer_shape (required): what the answer must look like
├── fold (required): how multiple answers become one
├── dial (optional): how much novelty is acceptable
├── orchestration (optional): multi-step pattern (verify, waterfall, escalate…)
├── side_effects (optional): reversibility, cost ceiling, timeout
├── relevance (optional): keeps only the best-ranked responders
└── metadata (optional): trace/correlation string bagSee Query Anatomy for the full schema with every field.
Heterogeneous responders
A responder is anything that can answer a request with a DO record. It doesn't matter whether the answer comes from an AI model, a saved pattern, a system adapter, or a person typing into a form. The four responder kinds:
| Kind | What it is | Typical latency |
|---|---|---|
pattern | A match against saved patterns | ~100ms |
system | A system adapter: a registered program or HTTP service | seconds |
llm | An AI model provider (Anthropic, OpenAI, etc.) | seconds to minutes |
actor | A person, reached by live notification, webhook, digest email, or polling | hours to days |
You choose responders with conditions. Each entry in the responders array describes a group of responders, and a responder that matches any entry is eligible. For example, kind: "llm", model: "~sonnet", budget_usd: 0.05 selects any Claude Sonnet variant that costs under 5 cents. For complex cases, add a CEL expression. See the Responder Predicates section.
Relevance
A query can match many responders, but you usually don't want to ask all of them. Syncropel ranks the eligible responders and asks only the top few (top_k).
The ranking is a score between 0 and 1 built from four things:
score = 0.35·trust
+ 0.25·pattern_match
+ 0.15·recency
+ 0.25·semantic_simTrust never counts for less than 0.05, so a brand-new responder with no history can still be chosen.
You can change the weights and the cutoff with a syncropel.config.relevance_scorer.v1 setting. See the relevance section for details.
Fold and orchestration
Two settings control how a query runs. They are separate.
Fold decides how answers combine. Given the answers, it produces one result. There are five fold functions: consensus, best_of, waterfall_first, ensemble_weighted, and expression. The same answers always give the same result. See Fold Functions.
Orchestration decides who is asked, when, and how many times. Patterns such as verify (a primary, a verifier, and a tiebreaker), waterfall (try cheaper responders first), escalate (move up to more authoritative responders, ending with a person), and ensemble_with_audit (ask several in parallel, then have a trusted auditor check the result) all use fold to combine the answers they collect. See Orchestration Patterns.
The default pattern, single_shot, asks the top-ranked responders once and combines their answers. Every pattern ends with a fold, even if it is best_of over a single answer.
When to reach for inference
If you're deciding whether a request should be an infer.query.v1 or a plain dispatch, the split is:
- Use a query when you care about which answer is best across multiple responders. Consensus of 3 LLMs, verify with a human tiebreaker, cost waterfall from cheap to expensive: all queries.
- Use plain dispatch when you know exactly who answers and you just want their output. A task routed to a specific dev agent via a routing rule is plain dispatch.
With a query, you describe what you want and Syncropel picks the participants and combines their answers. With dispatch, you pick the participant and get back what they say.
What inference doesn't do
- It doesn't make the responders faster. If you ask 3 AI models that each take 5 seconds, the query takes at least 5 seconds. Combining answers is quick. You wait for the slowest responder you need to reach
min_quorum. - It doesn't magically aggregate open-ended text.
consensuscompares answers exactly, so it works best with structured answers. For long-form prose, usebest_oforensemble_weightedwith a custom weight expression. - It doesn't replace your evaluation loop. Combining answers is one part. Trust tells you which responders to weight. You still need KNOW records with verdicts to build trust.
See also
- Query Anatomy: every field of
infer.query.v1. - Fold Functions: the 5 ways to combine answers.
- Orchestration Patterns: the 6 multi-step flows.
spl inferCLI: run queries from the shell.- Records: the record format queries use.
- Trust: how trust feeds combining and ranking.
Hooks
Show a running actor a lesson after one of its tool calls returns, by saving a hook. Also covers spl session hooks, which record an external agent's session.
Query Anatomy
Every field of an infer.query.v1 query, with types and defaults, and worked examples for a single model, a consensus ensemble, and the verify pattern.