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.
Per-Context configuration
Each Context stores a config object. It is set when the Context is created and can be changed at any time afterwards.
Full config schema
{
"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-…"
}
}Config fields
| Field | Type | Description |
|---|---|---|
token_limit | integer (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_day | integer (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_profile | string | Document 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.embedding | string | Must be gemini-embedding-2 when set (3072-dim; deployment-fixed). |
providers.google | string | Google (Gemini) API key for this Context. |
providers.openai | string | OpenAI API key for this Context. Overrides the deployment default. |
providers.anthropic | string | Anthropic API key for this Context. |
providers.cerebras | string | Cerebras API key for this Context. |
providers.openrouter | string | OpenRouter 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.
Default provider API keys
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.
Reranker (optional)
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.
Multimodal providers (optional)
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 key visibility
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.
Top-level Context fields (outside config)
These fields live on the Context record itself, not inside the config object, so changing the configuration does not change them.
| Field | Type | Default | Description |
|---|---|---|---|
enforcement_blocked | boolean | false | When 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. |
Extraction tuning
Additional per-Context settings control extraction behaviour:
| Field | Type | Default | Description |
|---|---|---|---|
llm_extraction_enabled | boolean | false | Has no effect. It is kept so stored values still load. Document fact extraction runs for every ingestion_profile above TextOnly |
pii_redaction_enabled | boolean | false | Redact detected personal data during ingest |
reconciliation.confidence_floor | float | 0.7 | Posterior-confidence floor for auto-supersession. Below it, a conflicting assertion records an uncertainty instead of replacing the prior value |
ingestion_profile | string | MultimodalFull | Which pipeline steps run during document ingest |
chunking_strategy | string | recursive | How document text is split before embedding: recursive, sentence, paragraph or token_limit |
injection_scan.enabled | boolean | true | Run the ingest-time prompt-injection scanner |
injection_scan.threshold | float | 0.7 | Scanner 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.
Cache settings
| Field | Type | Default | Description |
|---|---|---|---|
response_cache.enabled | boolean | true | Master switch. With it false, every /chat and /reflect call skips the cache tier |
response_cache.similarity_threshold | float | 0.92 | Cosine-similarity floor a prior query must score against the new one before its answer is reused |
response_cache.freshness_window_seconds | integer | 3600 | Soft cap on how old a reusable response may be |
Trace retention
| Field | Type | Default | Description |
|---|---|---|---|
trace_retention.decision_trace_days | integer (optional) | none | Days of decision_trace history to keep. Unset keeps it indefinitely |
trace_retention.retrieval_trace_days | integer (optional) | 90 | Days of retrieval_trace history to keep |
trace_retention.response_trace_days | integer (optional) | 90 | Days of response_trace history to keep |
Scope and label limits
| Field | Type | Default | Description |
|---|---|---|---|
scope_limits.max_nodes | integer | 100000 | Maximum number of registered custom scope nodes |
scope_limits.max_depth | integer | 16 | Maximum scope path depth |
label_limits.max_labels_per_fact | integer | 32 | Maximum labels on one fact |
label_dimensions | array | [] | 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.
Key policy
| Field | Type | Default | Description |
|---|---|---|---|
allow_self_service_keys | boolean | true | When false, members cannot mint keys via POST /{ctx}/keys; use Cloud-brokered access tokens only. |
max_token_ttl_seconds | integer (optional) | none | Maximum 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.
Request and list limits
These limits apply to the whole deployment:
| Limit | Value |
|---|---|
| Default page size | 100 when limit is omitted on list routes such as session turns |
| Maximum list size | 500 records per list response (list_turns, traces, audit) |
Default k / limit | 10 on /query, /context, document query, and MCP recall / context |
Maximum k / limit | 50 on the same routes and tools |
| Document upload size | Set 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.
Reconciliation
| Field | Type | Default | Description |
|---|---|---|---|
reconciliation.confidence_floor | float | 0.7 | Minimum confidence required for same-provenance supersession |
Defaults reference
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.