Authentication and Security
Credential management is the foundation of a secure Synap integration. A compromised API key gives an attacker full access to your instance’s memory store.API key stored in a secrets manager
- AWS: Secrets Manager or SSM Parameter Store
- GCP: Secret Manager
- Azure: Key Vault
- Self-hosted: HashiCorp Vault
.env files, or container images)API key rotation schedule established
- Recommended rotation cadence: every 90 days for standard deployments, every 30 days for high-security environments
- Document the rotation procedure in your team’s runbook
- Automate rotation if possible. With the CLI, run
api-keys createandapi-keys revokeas two steps so you keep the grace period:api-keys rotaterevokes the old key at once.
MaximemSynapSDK(api_key=...), the new key produces a new SDK and takes effect immediately. Switch your code to the new SDK, then await old_sdk.shutdown(). The same applies to SynapClient in JavaScript. If you construct with an explicit instance_id, that id is the identity and you get the existing SDK back (still on the old key), so await sdk.shutdown() before reconstructing, or restart the worker. Do that before revoking the old key, or in-flight requests will start failing authentication.shutdown(), or restart), and that this happens before the old key is revokedOne API key per SDK, on a supported version
maximem-synap ≥ 0.4.1.On 0.4.0 and earlier, the second and later SDKs constructed in one process silently adopted the first one’s credentials, so their reads returned the first key’s memory and their writes were committed against that instance. It produced no error and no log line. A process that uses a single API key was never affected.maximem-synap is 0.4.1 or later (we recommend the latest release) if any process uses more than one API keySDK Configuration
Proper SDK configuration ensures your integration performs well under production load and does not generate excessive logging or resource usage. These settings are Python. Create the SDK with them once:Log level set appropriately
"WARNING", is right for production. Avoid "DEBUG" and "INFO": they log user, customer and conversation ids. "ERROR" also hides the SDK’s retry warnings. In JavaScript, pass a logger function instead.log_level is "WARNING"Timeouts configured for your SLA
read takes effect, and it limits the whole request.Retry policy tuned
- High-throughput systems: Reduce
max_attemptsto 2 to avoid retry storms - Critical operations: Increase
max_attemptsto 5 for reliability - Low-latency paths: Reduce
backoff_maxto limit total retry time
Cache backend enabled
storage_path at a writable folder; in a container, use a mounted or temporary path. On a read-only path, Python 0.6.4 and later turn the cache off with a warning; earlier versions fail on the first fetch. To run without a local cache, set cache_backend=None.storage_path) is writable, or the cache is turned off on purpose with cache_backend=NoneMemory Architecture
Synap generates each Instance’s memory configuration automatically from the use-case file you upload. Before going to production, make sure that file reflects the agent you are actually deploying.Use-case file accurately describes the production agent
Verify retrieval quality on representative queries
Wait for the memory architecture build
InstanceNotReadyError.
Sensitive Data
Synap detects sensitive values in the content you send and applies the policy you set. Until somebody reviews and approves that policy, your account is watching only: values are counted and reported, and nothing is changed. Watching is a reasonable place to start, but it should be a decision rather than an oversight.Detection findings reviewed against real traffic
Policy set, tested, and approved by a named person
Policy scope matches your instance layout
Restricted keys issued where a tool does not need values
masked or none key rather than a full one. Set it with the CLI: privacy credential-grant --credential-id <id> --grant masked.Allow up to about a minute for a grant change to take effect on live traffic.Audit export and erasure path tested once, before you need them
user_id or customer_id.Error Handling
Robust error handling ensures your application degrades gracefully when Synap encounters issues, rather than crashing or returning empty responses.Transient and permanent errors handled
Transient errors logged with correlation_id
SynapError has a correlation_id attribute. It is set for errors that came back from Synap and is None for errors the SDK raised before sending anything. Always log it: this is the primary identifier Synap support uses to trace issues.correlation_id from the Synap errorGraceful degradation implemented
Rate limit handling with retry_after
RateLimitError reaches you after the SDK has already retried. If e.reason is set, your credits or trial cap are used up: do not retry; top up or contact us. Otherwise wait and retry once.Monitoring
Observability is critical for understanding how your Synap integration performs in production and catching issues before they impact users.Dashboard analytics reviewed regularly
- The Dashboard Overview shows total memories, requests, active instances and token savings.
- The Requests page lists each call with its status, latency and correlation ID.
- Credits & Usage → Usage shows credits by operation and a P95 latency over recent requests.
P95 latency baseline established
- Run a representative mix of
memories.create(),context.fetch()(bothfastandaccurate), andmemories.batch_create()against your staging Instance. - Record P50 / P95 / P99 for each operation over a representative window (at least 1 hour of realistic traffic).
- Set production alert thresholds at a multiple of your staging P95 (e.g., 2-3× P95) so normal variance doesn’t page you.
- Re-baseline after any MACA change, SDK upgrade, or significant traffic-pattern shift.
Error rate alerts configured
- Synap API error rate exceeding 1% over 5 minutes
- Authentication failures (any occurrence)
- Rate limit hits exceeding your expected threshold
- Retrieval returning zero results when memories are expected
Cost tracking enabled
sdk.credits.get_balance(). A fast fetch costs 1 credit per search query and an accurate one costs 3.
Performance
Optimization ensures your integration meets latency requirements and minimizes unnecessary resource usage.Using fast mode for latency-sensitive paths
mode="fast" for any operation in the critical path of user-facing requests. Reserve mode="accurate" for background tasks, research queries, or paths where the user is willing to wait.Batch ingestion for bulk operations
batch_create() instead of multiple create() calls:Compaction for long conversations
compact() only to force it: it finishes in the background, so read the result with get_compacted() afterwards.Cache is enabled
cache.stats() is synchronous and returns a dict with enabled, client_id, base_path, total_entries, total_bytes, and per-backend stats under backends. If enabled is False or total_entries stays at 0 over time, your cache backend isn’t engaged; check SDKConfig.cache_backend. In JavaScript, cache.stats() returns the number of cached bundles and items; the JavaScript cache only holds prefetched context.
Operational Readiness
Beyond code and configuration, production readiness requires documented procedures and team alignment.Team roles assigned appropriately
Credential rotation runbook documented
- Generate new key in Dashboard
- Update secrets manager with new key
- Deploy application with updated secret reference
- Verify the new key with a real test call from one worker before revoking the old key.
- Revoke old key after grace period (48 hours). A revoked key can keep working for up to a minute.
Shut the SDK down on exit
await sdk.shutdown() when your process stops. It sends pending telemetry and closes connections.await sdk.shutdown() runs when the process stopsSupport channel documented
- Synap Documentation: docs.maximem.ai
- Community Discord: discord.gg/synap
- GitHub Issues: github.com/maximem-ai/maximem_synap_sdk/issues
- Email Support: [email protected] (include
correlation_idin all reports)