Skip to content

Enterprise

Enterprise configuration

This page lists what you can configure on an Agent Memory Enterprise deployment, and what stays the same on every deployment. Use it to plan a single-tenant or self-hosted deployment, or to check whether a behaviour you want to change is a setting at all.

LevelApplies toWho changes itPlans
Per-Context settingsOne ContextAdmins and owners, in SurrealDB Studio under Settings → configuration on SurrealDB CloudEvery plan
Deployment settingsEvery Context on one deploymentSurrealDB on a single-tenant deployment, as agreed with you. You on a self-hosted deployment, as environment variablesEnterprise
Fixed behaviourEvery deploymentNobody. It is part of the productEvery plan

Each Context stores its own configuration. These settings are the same on every plan, and the Configuration reference lists each field with its default.

AreaFieldsReference
Models and provider keysmodels.extraction, models.elaboration_consolidation, models.synthesis, models.reconciliation, models.embedding, providers.*Config fields
Token budgettoken_limit, billing_anchor_dayConfig fields
Document ingest and extractioningestion_profile, chunking_strategy, pii_redaction_enabled, injection_scan.*, reconciliation.confidence_floorExtraction tuning
Response cacheresponse_cache.*Cache settings
Trace retentiontrace_retention.*Trace retention
Scopes and labelsscope_limits.*, label_limits.*, label_dimensionsScope and label limits
API keysallow_self_service_keys, max_token_ttl_secondsKey policy

Not every stored model setting is applied yet. Which settings are applied shows the stages that use their per-Context model.

Deployment settings apply to every Context on a deployment. On a single-tenant deployment, SurrealDB applies the values agreed with you. On a self-hosted deployment, you set them as environment variables on the Agent Memory processes, and the tables below give each variable's name.

A self-hosted deployment runs four kinds of process from one service image:

  • API: serves the REST API and the MCP server. Run as many as you need.

  • Worker: runs document ingest and the background passes. Run as many as you need.

  • Scheduler: queues the background passes. Run exactly one. It holds a lease in the database, so a second instance waits.

  • Management API: creates and manages Contexts, principals and keys.

The API and the management API both answer GET /api/v1/health for health checks.

Give every process the same model and provider settings. The API calls a model for /chat, /reflect and extraction on POST /facts, and the worker calls one for document ingest and the background passes.

SettingEnvironment variableDefaultNotes
Default providerSPECTRON_LLM_PROVIDERNoneOne of google, openai, anthropic, cerebras, openrouter or openai_compatible. With no value, the API uses Google when a Google key is set, and the worker runs language-model stages only for Contexts that store a provider key of their own. An unknown value does not fall back to another provider: requests that need the default model fail instead.
Default modelSPECTRON_LLM_MODELThe provider's built-in modelReplaces the built-in model of the default provider. Required when the default provider is cerebras, openrouter or openai_compatible, which have no built-in model.
Provider keySPECTRON_PROVIDER_<PROVIDER>_API_KEYNone<PROVIDER> is GOOGLE, OPENAI, ANTHROPIC, CEREBRAS, OPENROUTER or OPENAI_COMPATIBLE. A key stored on a Context overrides the deployment key for that Context.
Extra request fieldsSPECTRON_PROVIDER_<PROVIDER>_EXTRA_BODYNoneA JSON object merged into every request body sent to that provider, for example to pin OpenRouter routing. Anthropic ignores it.

The API uses one model for /chat, /reflect, extraction on POST /facts, and on-demand POST /elaborate and POST /consolidate calls. The worker chooses a model for each stage. The built-in models are:

ProviderAPIWorker: document extractionWorker: elaboration and consolidation
Googlegemini-3.8-flashgemini-3.5-flash-litegemini-3.8-flash
OpenAIgpt-5.1gpt-5-minigpt-5-mini
Anthropicclaude-opus-4-8claude-haiku-4-5-20251001claude-sonnet-4-6

A Context can choose its own model for the two worker stages. The deployment default applies to every stage that a Context leaves unset. See Which settings are applied.

The openai_compatible provider sends language-model calls to an endpoint that speaks the OpenAI chat API, such as a model gateway or a model server you run. It replaces the language-model stages only. The embedding model stays fixed, as Fixed behaviour shows.

SettingEnvironment variableNotes
EndpointSPECTRON_PROVIDER_OPENAI_COMPATIBLE_BASE_URLMust be an https:// URL. Any other scheme is ignored with a warning, and the provider is then unavailable. A URL with a user name or password in it is refused.
KeySPECTRON_PROVIDER_OPENAI_COMPATIBLE_API_KEYRequired. The provider is available only when the key and the endpoint are both set.
Private networksSPECTRON_PROVIDER_OPENAI_COMPATIBLE_ALLOWED_NETWORKSComma-separated CIDR ranges inside the private address ranges that the endpoint may resolve to.

To use your own model as the default, set SPECTRON_LLM_PROVIDER to openai_compatible and SPECTRON_LLM_MODEL to the model ID your endpoint expects.

Agent Memory checks every connection to this endpoint:

  • A public address is allowed.

  • A private address is allowed only inside a range listed in SPECTRON_PROVIDER_OPENAI_COMPATIBLE_ALLOWED_NETWORKS.

  • Loopback and link-local addresses are always refused, whatever the list says. So is any host name that resolves to a refused address.

  • Redirects are not followed, and no proxy is used.

A model server on the same machine, or one that serves plain HTTP, therefore needs an HTTPS address on your network in front of it.

A Context cannot store its own key for openai_compatible. The key is set for the deployment only.

Document ingest can read text in images, transcribe audio and video, embed images, parse whole documents and rerank passages. Each capability is off until you configure it. The ingestion_profile of each Context then decides which of the configured steps run for that Context.

CapabilityUse GeminiUse your own service
Text in images (OCR)SPECTRON_OCR_PROVIDER=geminiSPECTRON_OCR_URL, SPECTRON_OCR_MODEL, SPECTRON_OCR_API_KEY
Speech-to-textSPECTRON_STT_PROVIDER=geminiSPECTRON_STT_URL, SPECTRON_STT_MODEL, SPECTRON_STT_API_KEY
Image embeddingsSPECTRON_CLIP_PROVIDER=geminiSPECTRON_CLIP_URL, SPECTRON_CLIP_MODEL, SPECTRON_CLIP_API_KEY
Whole-document parsingSPECTRON_DOC_PARSER_PROVIDER=gemini, with SPECTRON_DOC_PARSER_MODEL (default gemini-2.5-flash)Not available
RerankingSPECTRON_RERANKER_PROVIDER=gemini, or openrouter with SPECTRON_RERANKER_MODELSPECTRON_RERANKER_URL, SPECTRON_RERANKER_MODEL, SPECTRON_RERANKER_API_KEY

A Google key alone does not turn on any of these capabilities. Set the _PROVIDER variable for each one you want. gemini (or google) is the only value these variables accept, apart from openrouter for the reranker, and any other value is an error at startup. gemini also needs SPECTRON_PROVIDER_GOOGLE_API_KEY. To use your own service instead, leave _PROVIDER unset and set _URL.

Without a document parser, Agent Memory reads hard-to-parse PDFs by rasterising each page and running OCR on it.

Your own service can use HTTP or HTTPS. _MODEL is required with _URL, and _API_KEY is optional: when it is set, Agent Memory sends it as Authorization: Bearer <key>. Each service answers a POST with JSON in these shapes:

ServiceRequest bodyResponse
OCRThe image bytes, with an image/... content type{ "text": "...", "confidence": 0.95 }, where confidence is optional
Speech-to-textThe audio or video bytes, with an audio/... or video/... content type{ "text": "...", "language": "en", "confidence": 0.9, "segments": [...] }, where only text is required
Image embeddingsThe image bytes, with an image/... content type{ "embedding": [...] }, with 3072 values
Reranker{ "query": "...", "passages": ["...", "..."] }{ "scores": [...] }, one score for each passage, in the same order

Each segment in a speech-to-text response has text, start_seconds, end_seconds and an optional confidence.

Note

Images embedded by your own service are stored in that model's vector space. A text query searches with the text embedder, so it does not return those images. Text-to-image recall needs SPECTRON_CLIP_PROVIDER=gemini.

SettingEnvironment variableDefaultNotes
SurrealDBSURREALDB_CONNECTIONRequired<endpoint>;<username>;<password>, or <endpoint> alone for a database without authentication. Agent Memory signs in as a root user, and connects to a SurrealDB server over the network.
Object storageSPECTRON_OBJECT_STORE_URLRequiredWhere uploaded documents are stored. See the URL forms below.
Unreferenced object grace periodSPECTRON_GC_GRACE_SECONDS86400 (24 hours)How long an object that no document refers to is kept before document clean-up deletes it.

The object storage URL takes one of these forms. The path after the bucket or container becomes a key prefix.

BackendURL
Amazon S3s3://<bucket>/<prefix>?region=<region>
S3-compatible services3://<bucket>/<prefix>?endpoint=<url>. An endpoint also allows plain HTTP.
Google Cloud Storagegs://<bucket>/<prefix>
Azure Blob Storageazure://<container>/<prefix>
Local file systemfile:///<path>. Use it only when every API and worker process reads the same directory.

Credentials for S3, Google Cloud Storage and Azure come from the standard environment variables of each cloud provider.

SettingEnvironment variableDefaultNotes
Concurrent requests per API processSPECTRON_HTTP_MAX_CONCURRENT_REQUESTS1000A request over the limit gets 503 with Retry-After: 1. 0 removes the limit.
Maximum upload sizeSPECTRON_MAX_UPLOAD_BYTES4 GiBThe largest document POST /documents accepts.
Default page sizeSPECTRON_DEFAULT_PAGE_SIZE100Used when a list request has no limit.
Maximum page sizeSPECTRON_MAX_LIST_LIMIT500A larger limit is clamped to it.
Maximum kSPECTRON_MAX_QUERY_K50The most results one recall returns. You can lower it, but not raise it above 50.
Ingest jobs per workerSPECTRON_INGEST_CONCURRENCY1024Ingest jobs one worker process holds at once, across all Contexts. Raise it only together with the worker's memory, because each job holds a document's text, chunks and vectors.
Ingest jobs per ContextSPECTRON_INGEST_CONTEXT_CONCURRENCY64Ingest jobs one Context holds at once on a worker, so one Context's backlog cannot take every slot.
Provider calls during ingestSPECTRON_INGEST_PROVIDER_CONCURRENCY64Model and embedding calls in flight at once from one worker. Set it from your provider's rate limit.
Database connectionsSPECTRON_DB_POOL_MAX10Connections in each process's pool.

Agent Memory has no per-key request rate limit. The concurrency limit above and the token budget below are the controls on load.

These settings decide how a Context's token_limit is enforced on a deployment.

SettingEnvironment variableDefaultNotes
Counted modelsSPECTRON_TOKEN_BUDGET_MODELSNoneComma-separated model IDs whose usage counts towards token_limit. * matches any characters, so gemini-* counts every Gemini model. With no value, no model counts.
EnforcementSPECTRON_TOKEN_BUDGET_ENFORCEMENTsoftsoft allows every call and records that the Context is over its limit. hard rejects new calls once the Context's total reaches token_limit. Calls already running finish.
Background workSPECTRON_TOKEN_BUDGET_ENFORCE_SYSTEMfalseWith false, model calls from background work, such as document ingest and the scheduled passes, are recorded but not limited. With true, they are limited too.
SettingEnvironment variableDefaultNotes
API addressSPECTRON_BIND_ADDRESS0.0.0.0:9090Where the API listens for REST and MCP.
Management API addressesSPECTRON_MANAGEMENT_BIND_ADDRESS, SPECTRON_MANAGEMENT_GRPC_BIND_ADDRESS0.0.0.0:9090, 0.0.0.0:9091REST and gRPC. The API and the management REST server have the same default port, so change one of them when both run on one host.
Management keySPECTRON_MANAGEMENT_API_KEYRequiredThe operator key for the management API. Keep it out of application code.
Browser originsSPECTRON_CORS_ALLOWED_ORIGINS, SPECTRON_MANAGEMENT_CORS_ALLOWED_ORIGINSNoneComma-separated origins that browsers may call from. An entry can use * inside an origin, for example for preview deployments, but a bare * is refused. With no value, browsers can call only from the same origin.

Every listener serves plain HTTP or gRPC. Terminate TLS in a load balancer, ingress or gateway in front of the API and the management API.

SettingEnvironment variableDefaultNotes
Prometheus metricsSPECTRON_PROMETHEUS_BIND_ADDR127.0.0.1:9464Serves /metrics. Set 0.0.0.0:9464 to scrape from another host, or an empty value to turn metrics off.
OpenTelemetry exportOTEL_EXPORTER_OTLP_ENDPOINTNoneSends traces, logs and metrics over OTLP gRPC. The other standard OTEL_* variables also apply.
Service nameOTEL_SERVICE_NAMEspectronThe service name on exported telemetry.
Environment nameSPECTRON_DEPLOYMENT_ENVdevThe deployment.environment attribute on exported telemetry.
Log filterRUST_LOGspectron=info and a few library filtersLogs are written as text to standard error.
Quiet routesSPECTRON_HTTP_QUIET_ROUTESNoneComma-separated route templates, such as /api/v1/health, whose access logs drop to debug level. Their metrics are still recorded.

This behaviour is the same on every deployment, and no setting changes it:

BehaviourValue
Embedding modelgemini-embedding-2, at 3072 dimensions. A Context's models.embedding accepts only this value.
Expiry of context facts7 days after the fact's known time, checked every hour. See Expiry of context facts.
Importance decayOnce a day: context × 0.95, knowledge × 0.995, identity unchanged.
Background passes every hourContext-fact expiry, consolidation, elaboration, removal of duplicate conversation chunks, document clean-up and trace retention.
Background passes every dayImportance decay and document reconciliation.

To keep a fact past the 7-day expiry, write it with the knowledge or identity category when your application learns it. Setting the category shows how.

Was this page helpful?