Skip to main content
Several SDK methods take the same option values or return the same statuses. This page lists each set once, so the method pages can link here instead of repeating it.

How to read this page

  • Values are identical in Python and JavaScript. Only option names can differ.
  • JavaScript option names. Most JavaScript methods take an options object that accepts a multi-word option in snake_case or camelCase, so scope_path and scopePath both work. The cross-scope sdk.fetch() reads snake_case names only. The tables use snake_case, which works everywhere.
  • Where a bad value is caught. “SDK” means the call fails before any request is sent. “Server” means the request goes out and the server refuses it; both SDKs raise a 400 or 422 answer as InvalidInputError. “Not checked” means nothing refuses the value, and the section says what happens instead.
  • Python errors. Most refused values raise InvalidInputError. A few Python checks raise ValueError, or pydantic’s ValidationError (a ValueError subclass), which an except SynapError block does not catch. The sections name them. See Errors for the full hierarchy.
Both SDKs export most of these sets as constants, which you can use to validate input or build a menu:

Document type

document_type tells the server what kind of content it is reading, and extraction depends on it: conversational text sent as document yields less than the same text sent as ai-chat-conversation. Label each write for what it is. Used by memories.create, memories.batch_create (on each document), memories.create_from_file and memories.update.

Ingestion mode

mode on a write. Used by memories.create, memories.batch_create (on each document) and memories.create_from_file. The server accepts either value, and in the current release both run the same ingestion pipeline, so the choice does not change what is extracted.

Ingestion status

The status of an ingestion job. The write methods return it on their result, and you poll it with memories.status and memories.wait_for_completion. conversation.ingest_transcript returns its own status (queued or duplicate) together with an ingestion_id that you poll with these values. wait_for_completion polls status for you, and the two SDKs stop at different points:
  • Python returns at completed, failed or partial_success. If none arrives within timeout_seconds (default 300, polling every poll_interval_seconds, default 2), it raises the built-in TimeoutError.
  • JavaScript returns at completed or failed. It does not stop at partial_success, so a job that ends that way is polled until the timeout. At the timeout it returns the last status instead of throwing, so check status on what it returns.
Constants: Python IngestStatus. JavaScript has none; status is a string.

Retrieval mode and precision

Two independent settings on every context fetch: sdk.fetch, user.context.fetch, customer.context.fetch, client.context.fetch and conversation.context.fetch. The tool from as_tool lets the model pick them from the same values. Both are ignored in conversation-summary mode. For when to use which, see Retrieval modes. mode: precision_level:
JavaScript SDK 0.5.9 and earlier do not check mode, and the server runs accurate for any value other than fast. On those versions a typo such as "Fast" switches to the slower mode without an error. A bad precision_level is still refused by the server.

Memory types

The five kinds of memory Synap extracts. The same names are used for the types filter on fetches, for the lists in a fetch response, for memory_type on memories.get, and for the context_types hint on instance.send_message. A ranked response adds one more category, excerpts: quotes from source documents rather than extracted memories. See Response shape. The types filter on sdk.fetch and the four scoped fetches narrows a fetch to some of the five. Leave it out to get all five; the SDKs then send ["all"], and any list that contains "all" means all five.
Python’s exported ContextType enum spells the last type temporal (ContextType.TEMPORAL). The server does not know that name, so filtering with it returns no temporal events. Use the string "temporal_events" or MEMORY_TYPES.

Response shape

response_shape sets how a fetch returns its items. Used by sdk.fetch and the four scoped fetches.

Context mode

context_mode switches a user-scope fetch between normal retrieval and a summary for the start of a call or session. Used by user.context.fetch and sdk.fetch. sdk.fetch passes it only to its user-scope part, so it needs user_id. Two options apply in summary mode only: The server refuses summary mode on the customer, client and conversation fetches, which is why the SDKs send it only with a user-scope fetch.

Fetch scopes

scopes on sdk.fetch limits which scopes are queried. Left out, scopes means every scope you passed an id for. A listed scope whose id you did not pass is skipped. An unknown name is ignored without an error in both SDKs, so check the spelling. The response’s scopes_queried and scope_map use the same names. Constants: Python ContextScope. JavaScript type Scope.

Scope paths

On an account whose scope ladder has a level between customer and user, customer_id and user_id cannot say which level a request belongs to; a scope path names it. On the default three levels you do not need one. Both names carry the same thing and reach the server as scope. The shape is a flat map from level key to your id, both strings: {"customer": "acme", "team": "payments", "user": "dana"}. Neither SDK checks the shape. The server enforces these rules and refuses a path that breaks one (400, raised as InvalidInputError):
  • Use the level keys from your ladder. Leave out the top level; it is your account and is implied.
  • Name every level from the first one below your account down to the level you mean. A path with a gap is refused, and the error names the missing level.
  • A key that is not a level on your ladder is refused.
  • Key order does not matter.
  • If nested scoping is not enabled for your instance, a path is refused rather than ignored, because ignoring it would widen the request.
  • For a conversation, sending the path once is enough: the server fills in a missing path and never overwrites one.
sdk.fetch takes no path in either SDK. Python’s create_from_file has no scope option, and although the JavaScript type definitions accept one there, the SDK does not send it. JavaScript SDK 0.5.9 and earlier send scope_path on user.context.fetch only and drop it on the other three fetches. For worked examples, see Sending a scope path.

Message roles

On the stream, the helper methods set the role for you: record_tool_call sends assistant, record_tool_result sends tool, and record_thinking sends none. Use them rather than setting role yourself for those events. If you pass ingest_transcript a plain string, the server splits it at lines that start with a speaker label and a colon: user, assistant, human, ai, system or bot, in any case. user and human become user turns; every other label becomes an assistant turn. Text before the first label is kept as a user turn, and text with no labels becomes one user turn.

Stream event types

event_type on instance.send_message says what a stream event is. The stream must be open (instance.listen), or the call raises ListeningNotActiveError. Both SDKs refuse any other value before sending: Python raises ValueError, JavaScript raises SynapError. Neither exports the list from the package root; Python keeps it in maximem_synap.sdk.KNOWN_EVENT_TYPES.

Compaction values

Strategy

strategy on conversation.context.compact names the compaction strategy for one run. Leave it out to use the strategy configured for your instance. The server knows four names: aggressive, balanced, conservative and adaptive. The strategy that ran comes back as strategy_used on get_compacted, and Python also parses it into level_applied. compaction_level is an older name for the same option; strategy wins when you pass both. The SDK lists for it (Python CompactionLevel, JavaScript COMPACTION_LEVELS) also include low, medium and high, which are not server strategy names. Neither SDK checks the value, and the server does not refuse an unknown one: it logs it and keeps the configured strategy. A typo, or low, medium or high, changes nothing and raises no error.

Compaction status

status from get_compaction_status: Python can answer completed without a request when a compaction update for the conversation has already arrived on the listen stream.

Layout: format and style

format on get_compacted and style on get_context_for_prompt take the same three values: Neither SDK checks the value, and the server does not validate it up front, so stay with these three. The Python docstring for get_compacted mentions injection; the server has no such format.

Forget mode and status

memories.forget finds memories that match a description in the user’s own words (3 to 500 characters) and removes them. mode: status on the result: The result also carries failed_ids (memories that could not be deleted) and may_be_incomplete (true when a search limit stopped the matching early). Each candidate’s store says where the matched text lives: memory for the memory itself, or chunk, sentence, entity, triple, profile or candidate for a copy kept elsewhere.

Tool scope and style

as_tool returns a tool definition that fetches Synap context when the model calls it. The ids you pass are fixed inside the tool, so the model cannot choose whose memory to read. scope (case-insensitive): style: Both shapes carry a handler that runs the fetch, and the default tool name is synap_fetch_<scope>_context. Both SDKs raise InvalidInputError for an unknown scope or style, or a missing required id. JavaScript exports the types ToolScope and ToolStyle.

Retrieval health

When part of a retrieval fails, a fetch can still succeed with fewer items. The response’s retrieval block says so, and it is absent on a healthy fetch. In Python, read response.retrieval on the four scoped fetches; it is None when the fetch was healthy, and the merged sdk.fetch response does not carry it. In JavaScript, the namespaced fetches return the context without this block; only the deprecated camelCase methods, such as fetchUserContext, expose it as retrieval.

ID formats

On a B2C instance, send user_id only. Both SDKs refuse a customer_id before sending, with CustomerIdNotAcceptedError, a subclass of InvalidInputError. Before Python 0.5.12 it is a ValueError subclass only, so except InvalidInputError does not catch it there. The SDK learns whether the instance is B2C from initialize(); JavaScript runs that step on the first request if you skip it. See B2C vs B2B.