Documentation Index
Fetch the complete documentation index at: https://docs.maximem.ai/llms.txt
Use this file to discover all available pages before exploring further.
fetch() queries every scope you provide an identifier for in parallel, deduplicates the merged items (first scope wins), attributes each item to its source scope, optionally folds in the conversation’s compacted history plus recent messages, and returns a ready-to-inject formatted_context string. Pass it the identifiers you have on hand for the current turn — conversation, user, customer — and use the resulting formatted_context directly in your LLM prompt.
Parameters
Conversation scope identifier. When provided, the conversation scope is queried and (unless disabled) the conversation’s compacted history is included.
User scope identifier. Threaded into the conversation-scope sub-fetch so per-user privacy filtering applies.
Customer scope identifier. Required for B2B deployments where customer-scoped context is in use.
Search queries applied to all queried scopes. Defaults to
None (no query-side filtering).Maximum results per scope. The merged total may be higher across scopes. Defaults to
20.Memory types to include. Defaults to
None, which means all types.Retrieval mode.
"fast" (default) or "accurate".Include the conversation’s compacted history plus recent messages in the result. Defaults to
True. Only effective when conversation_id is also provided.Explicitly limit which scopes to query (e.g.
["user", "customer"]). Defaults to None, which queries every scope for which an identifier was provided.Annotate each item with its source scope in the
formatted_context output. Defaults to False.Returns
AUnifiedContextResponse with merged items, scope attribution, and a formatted_context string ready for LLM injection.
Pre-formatted context block you can drop straight into an LLM prompt. Honors
include_scope_labels and include_conversation_context.The scopes that were actually queried for this call, in order.
Mapping from item ID to the scope that produced it after deduplication.
When
include_conversation_context=True and a conversation_id was supplied, the conversation’s compacted history and recent messages. None otherwise.Example
Raises
AuthenticationError— when the SDK has not been initialized (callawait sdk.initialize()first).
See also
- initialize — required before calling
fetch. - as_tool — expose
fetchto an LLM as a tool definition.