Skip to content

Reference

Configuration

Each SurrealDB Agent Memory Context has its own configuration: the models and provider keys it uses, its token budget, and its extraction, cache, retention, scope and key settings. This page lists the fields a Context has and their defaults.

On SurrealDB Cloud, admins and owners change a Context's configuration in SurrealDB Studio under Settings → configuration. Changes apply immediately to new requests.

Each Context stores a config object. It is set when the Context is created and can be changed at any time afterwards.

{
  "token_limit": 1000000,
  "models": {
    "extraction": { "provider": "google", "model": "gemini-3.5-flash-lite" },
    "synthesis": { "provider": "anthropic", "model": "claude-opus-4-8" },
    "elaboration_consolidation": { "provider": "google", "model": "gemini-3.8-flash" },
    "embedding": "gemini-embedding-2"
  },
  "providers": {
    "google": "…",
    "openai": "sk-…",
    "anthropic": "sk-ant-…"
  }
}
FieldTypeDescription
token_limitinteger (optional)Soft monthly token cap for metering and billing. Does not reject requests while enforcement_blocked is false. null = no cap. 0 clears the cap.
billing_anchor_dayinteger (optional)Day of the month (1-31) on which the monthly budget period starts. A day past the end of a month moves back to that month's last day. Unset means day 1. 0 clears it.
ingestion_profilestringDocument ingest dial: TextOnly, TextPlusKeyword, StandardMultimodal, or MultimodalFull (default). See Multimodal content.
models.extraction{provider, model}LLM for turn and document extraction.
models.reconciliation{provider, model} (optional)Stored and validated, but not yet applied.
models.synthesis{provider, model}Stored and validated, but not yet applied: /chat and /reflect use the deployment default.
models.elaboration_consolidation{provider, model}LLM for worker elaboration and consolidation.
models.embeddingstringMust be gemini-embedding-2 when set (3072-dim; deployment-fixed).
providers.googlestringGoogle (Gemini) API key for this Context.
providers.openaistringOpenAI API key for this Context. Overrides the deployment default.
providers.anthropicstringAnthropic API key for this Context.
providers.cerebrasstringCerebras API key for this Context.
providers.openrouterstringOpenRouter API key for this Context.

Each stage takes an object with a provider (openai, anthropic, google, cerebras or openrouter) and a model. The provider must have a key available to the Context. For OpenAI and Google, the model must be one the server knows for that provider, so an id such as gemini-2.5-pro is rejected with 400. Anthropic accepts any non-empty id, OpenRouter needs a vendor/model id, and Cerebras needs an id with no /.

A stage with no selection uses the deployment default model. With Google as the provider, that is gemini-3.5-flash-lite for extraction and reconciliation and gemini-3.8-flash for synthesis, elaboration and consolidation, and for /chat and /reflect. The Google models the server accepts are gemini-3.1-flash-lite, gemini-3.5-flash-lite, gemini-3.6-flash, gemini-3.8-flash and gemini-4-argon, as well as gemini-2.5-flash and gemini-2.5-flash-lite, which Google no longer offers to new API users. The embedding model is fixed to gemini-embedding-2 (3072 dimensions) for the whole deployment, so models.embedding accepts no other value.

The deployment provides default provider keys, so a Context can use a stage without storing a key of its own. A key set in providers.* applies to this Context only and takes precedence over the deployment default for that provider. Embeddings always use Gemini.

Cross-encoder reranking for /documents/query with use_reranker=true depends on the deployment having a reranker provider. Without one, requests fall back to bi-encoder ordering.

OCR, visual embeddings (CLIP) and speech-to-text during document ingestion depend on the providers available to the deployment. They are not Context configuration fields. The ingestion_profile field decides which of these steps run for a Context. See Multimodal content.

Provider API keys are write-only on the API surface. The read projection for a Context replaces the key values with a providers_configured summary - names of providers for which this Context stores its own key:

{
  "config": {
    "providers_configured": ["google", "openai", "anthropic"]
  }
}

The raw key values never appear in read responses.

These fields live on the Context record itself, not inside the config object, so changing the configuration does not change them.

FieldTypeDefaultDescription
enforcement_blockedbooleanfalseWhen true, gated LLM-backed requests return 429 regardless of the soft token_limit. When false, usage may exceed token_limit (pay-as-you-go). SurrealDB Cloud sets it, for example when organisation credit enforcement applies.

Additional per-Context settings control extraction behaviour:

FieldTypeDefaultDescription
llm_extraction_enabledbooleanfalseHas no effect. It is kept so stored values still load. Document fact extraction runs for every ingestion_profile above TextOnly
pii_redaction_enabledbooleanfalseRedact detected personal data during ingest
reconciliation.confidence_floorfloat0.7Posterior-confidence floor for auto-supersession. Below it, a conflicting assertion records an uncertainty instead of replacing the prior value
ingestion_profilestringMultimodalFullWhich pipeline steps run during document ingest
chunking_strategystringrecursiveHow document text is split before embedding: recursive, sentence, paragraph or token_limit
injection_scan.enabledbooleantrueRun the ingest-time prompt-injection scanner
injection_scan.thresholdfloat0.7Scanner score at or above which a write is rejected with 400. Findings below it are recorded as uncertainty records

There is no setting that constrains which entity types, attribute keys, or relation labels extraction may produce. Entity types come from a fixed vocabulary; keys and labels converge through reuse. See Extraction vocabulary.

FieldTypeDefaultDescription
response_cache.enabledbooleantrueMaster switch. With it false, every /chat and /reflect call skips the cache tier
response_cache.similarity_thresholdfloat0.92Cosine-similarity floor a prior query must score against the new one before its answer is reused
response_cache.freshness_window_secondsinteger3600Soft cap on how old a reusable response may be
FieldTypeDefaultDescription
trace_retention.decision_trace_daysinteger (optional)noneDays of decision_trace history to keep. Unset keeps it indefinitely
trace_retention.retrieval_trace_daysinteger (optional)90Days of retrieval_trace history to keep
trace_retention.response_trace_daysinteger (optional)90Days of response_trace history to keep
FieldTypeDefaultDescription
scope_limits.max_nodesinteger100000Maximum number of registered custom scope nodes
scope_limits.max_depthinteger16Maximum scope path depth
label_limits.max_labels_per_factinteger32Maximum labels on one fact
label_dimensionsarray[]Declared label keys. Each entry has a key, a value_policy (open or closed), and an optional max_values and description. Undeclared keys are still accepted

A write that passes a scope or label limit returns 409. A change to scope_limits, label_limits or label_dimensions replaces the stored value as a whole.

FieldTypeDefaultDescription
allow_self_service_keysbooleantrueWhen false, members cannot mint keys via POST /{ctx}/keys; use Cloud-brokered access tokens only.
max_token_ttl_secondsinteger (optional)noneMaximum TTL clamp applied to every key mint (SurrealDB Studio, Cloud-brokered, self-service). null = no clamp.

Every data-plane API key must be bound to a principal. Keys with no principal binding are rejected with 401 - there is no unscoped passthrough mode. Mint keys under a principal in SurrealDB Studio, or with self-service POST /{ctx}/keys.

These limits apply to the whole deployment:

LimitValue
Default page size100 when limit is omitted on list routes such as session turns
Maximum list size500 records per list response (list_turns, traces, audit)
Default k / limit10 on /query, /context, document query, and MCP recall / context
Maximum k / limit50 on the same routes and tools
Document upload sizeSet for the deployment, 4 GiB by default

Raising k only returns more of the fused answer. The candidate pool that retrieval searches is internal and does not grow with k. Section expansion is on by default.

Requests above the query ceiling return 400 Bad Request.

FieldTypeDefaultDescription
reconciliation.confidence_floorfloat0.7Minimum confidence required for same-provenance supersession

When a per-Context field is not set, the default applies. SurrealDB Studio shows a Context's configuration under Settings → configuration. A field the Context has not set shows its default value. The one exception is models: a stage with no selection is left out, and resolves to the deployment default when it is used.

Was this page helpful?