Type-specific field names. The Pydantic models below intentionally use type-specific field names (
Preference.strength, not confidence, and Episode.summary, not content) because each memory type has different semantics. The SDK handles transport-level field mapping internally; you only work with these typed models in application code.maximem_synap and are importable from the top-level package:
Memory item types
These are the atomic units of structured memory. AContextResponse is a bag of these.
Fact
Preference
Episode
Emotion
TemporalEvent
Context responses
ContextResponse
Returned byconversation.context.fetch, user.context.fetch, customer.context.fetch, client.context.fetch.
conversation_context carries the rolling session view (compacted summary plus recent turns) as a single coherent block rather than atomized items. It is None unless the conversation has a compaction available.
ConversationContextModel
The current-session context attached to aContextResponse as conversation_context. It bundles the compacted narrative summary, current state, key extractions, and the most recent raw turns together, instead of splitting them into the typed item lists. It is None when no compacted/session context exists for the conversation (e.g. a fresh conversation).
conversation_context is the coherent-block view; facts / preferences / episodes / emotions / temporal_events are the atomized view of retrieval. Most integrations read the atomized lists; reach for conversation_context when you want the pre-assembled session narrative. For prompt-ready compacted text specifically, prefer get_context_for_prompt() (see Context Compaction).UserProfileModel
The caller profile returned inline by conversation-summary fetches (asContextResponse.profile / UnifiedContextResponse.profile) and directly by user.get_profile. It bundles client-defined critical attributes with a short free-text overview.
ConversationSummaryModel
One previous-conversation summary, returned in theconversations list of a conversation-summary fetch: what a prior call was about and how it progressed.
A conversation whose summary hasn’t been produced yet returns
summary=None, summary_status="pending"; one whose compaction failed returns "failed". Callers still see that the call happened either way. UnifiedContextResponse.format_for_prompt() renders these under a ## Previous Conversations section (and the profile under ## Caller Profile).ResponseMetadata
compaction_applied is not a bool. It’s None when no compaction ran, or a CompactionLevel enum value when one did. Test with if meta.compaction_applied is not None.
Ingestion responses
CreateMemoryResponse
Returned bymemories.create. Ingestion is async: this comes back immediately with an ingestion_id you can poll.
TranscriptIngestResponse
Returned byconversation.ingest_transcript. Like CreateMemoryResponse, ingestion is async: poll ingestion_id with memories.status().
IngestStatus enum
MemoryStatusResponse
Returned bymemories.status(ingestion_id).
Compaction responses
CompactionTriggerResponse
Returned byconversation.context.compact. This call kicks off a compaction job asynchronously and returns this trigger confirmation, not the compacted content. To get the actual compacted text, call get_compacted() once the job completes (or poll get_compaction_status()).
CompactionResponse
Returned byconversation.context.get_compacted. Carries the actual compacted text and typed extractions.
CompactionStatusResponse
Returned byget_compaction_status. This is a Pydantic model: access fields as attributes, not dict keys.
ContextForPromptResponse
Returned byget_context_for_prompt. Optimized for direct injection into an LLM system prompt.
CompactionLevel enum
Type-checking tips
- Only
ContextResponseandCompactionResponsehavemodel_config = {"extra": "allow"}and expose the raw cloud payload via a.rawproperty; other models silently drop unknown fields. When the cloud adds a new field on those two models, you can read it fromresponse.rawuntil a typed attribute ships. - Datetime fields are timezone-aware (UTC). When comparing, use
datetime.now(timezone.utc), notdatetime.utcnow(). - For runtime validation (e.g., in your application boundary), call
.model_validate(...)rather than constructing manually: Pydantic enforces all constraints.