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.
formatted_context string that stitches together the compacted history with any messages that arrived after the last compaction cutoff. Drop the result straight into your prompt — no further assembly required.
If no compaction has run yet, every recorded message comes back as a recent message, so this method is useful from the very first turn.
Parameters
The conversation to assemble context for.
Formatting style for the compacted portion:
"structured"— labelled sections (facts, decisions, preferences, current state)"narrative"— prose summary"bullet_points"— bulleted list
Returns
AContextForPromptResponse ready for prompt injection.
The combined compacted + recent context, formatted per
style. Inject directly into your LLM prompt.Whether usable context (compacted or recent) was found.
Whether the compacted portion is stale relative to newer messages.
Compression ratio of the compacted portion.
Quality validation score of the compacted portion.
How long ago the compaction completed.
True when the compacted portion was flagged for quality concerns.
Raw un-compacted messages since the last compaction. Use if you want to format them yourself.
Number of un-compacted messages included.
Number of messages covered by the compacted portion.
Total messages in the conversation.
Example
Raises
AuthenticationError— when the API key is missing or invalid.NetworkError— when the SDK cannot reach Synap.