Skip to content

Production controls: determinism, precision & latency

Riptide's defaults lean exploratory — self-learning memory, reflection, optional self-consistency voting. For deterministic, latency-sensitive, precision-sensitive deployments (think a field-support assistant that must give the same grounded answer to the same question, fast) those defaults are the wrong shape. These three opt-in, additive controls flip the framework into that mode without changing any default.

Deterministic / reproducible mode

--deterministic makes a run reproducible — same task → same answer, best-effort:

riptide run "summarize asset AB-12's last service" --deterministic --seed 7

What it does:

  • Pins sampling: temperature=0 on every model call, and threads --seed to the provider (LiteLLM passes it through, e.g. OpenAI's seed).
  • Disables self-consistency voting (vote_k is forced to 1 — sampling at temperature 0 would make the votes identical anyway).
  • Runs memory read-only: recall still injects past lessons (deterministic given a fixed store), but the reflect and skill_forge write stages are skipped so the lesson store can't drift between runs.
  • Stable tool-call IDs: when a provider omits a tool-call id, the fallback id is derived from the call's content + position (not a random UUID), so an identical response replays identically.

Best-effort, not byte-guaranteed. Reproducibility holds to the extent the provider honors seed/temperature. Riptide does not add a response cache; if you need byte-identical replay across providers that ignore seed, cache at your gateway.

Settings equivalents (env / .env): DETERMINISTIC=1, RANDOM_SEED=7. Programmatic: service.run_task(..., deterministic=True, seed=7).

Latency controls

--fast preset

Drops the expensive optional stages and caps iteration in one switch:

riptide run "what's the torque spec for pump P-9?" --fast

Equivalent to: critic off, supervisor off, memory read-only (no reflect/skill writes), max_steps=1, vote_k=1. Recall still runs. Env: FAST_MODE=1.

--max-calls ceiling

A hard cap on model calls per run — a runaway swarm/critic/supervisor/reflect loop fails fast instead of silently burning latency and cost:

riptide run "<complex task>" --max-calls 12

Exceeding the ceiling raises CallBudgetExceeded (the CLI exits with code 2). The cap counts every consumer's calls (orchestrator, workers, critic, reflector, …) via a MeteredGateway wrapper composed around the real gateway. Env: MAX_LLM_CALLS=12. 0 = unlimited (the default).

Retrieval-precision

Riptide's retrieval is lexical BM25(+RRF) over tool name/description and lesson text (there is no document retrieval). Three precision controls sharpen it:

Quoted phrases & +required terms — parse a query and drop candidates that don't match:

from riptide_watergraph.memory import hybrid_rank, parse_query

# Require the exact phrase "asset code" AND the code AB-12 (which the tokenizer would split):
spec = parse_query('service history "asset code" +AB-12')
hits = hybrid_rank("service history", records, require=spec)

Metadata filters on memory — restrict candidates before ranking (equality, or key__contains for list/tag fields):

await memory.retrieve("indexing tips", filters={"type": "procedural"})
await memory.retrieve("indexing tips", filters={"tags__contains": "sql"})

Tag filters on tools — restrict tool retrieval to a capability area:

await registry.retrieve("fetch the page", tags={"web"})

All three are optional keyword arguments — omitting them preserves the existing behavior.