> ## 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.

> ## Agent Instructions
> Maximem Synap is a managed memory layer for AI agents: it ingests conversations and documents, extracts structured memory, and returns scoped context to the agent at retrieval time.
> The Python and JavaScript/TypeScript SDKs are the supported way to use Synap. Write integration code with SDK calls, not raw HTTP requests.
> Start with the Quickstart: https://docs.maximem.ai/getting-started/quickstart.md. Every SDK method is documented in the SDK reference: https://docs.maximem.ai/sdk-reference/overview.md.
> For requests about adding Vity memory to OpenClaw, Hermes, an MCP client, or a browser, start with the Vity Quickstart: https://docs.maximem.ai/vity/quickstart.md.

# conversation.context.get_compaction_status

> Check whether a conversation has compacted context, whether it's stale, and whether a compaction run is in progress.

```python theme={null}
await sdk.conversation.context.get_compaction_status(conversation_id)
```

Returns the current compaction state for a conversation. Use this after [`compact`](https://docs.maximem.ai/sdk-reference/conversation-context/compact) to poll for completion before calling [`get_compacted`](https://docs.maximem.ai/sdk-reference/conversation-context/get-compacted).

The SDK checks its in-process anticipation cache first. If a `compaction_update` bundle has been pushed for this conversation, the call returns `status="completed"` immediately without a network round-trip.

### Parameters

**conversation\_id** `str` *required*

The conversation to inspect. Must be a valid UUID [registered via `record_message`](https://docs.maximem.ai/concepts/context-end-to-end#short-term-context).

### Returns

A `CompactionStatusResponse` describing the current state.

**conversation\_id** `str`

Echo of the supplied conversation id.

**status** `str`

One of `"not_started"`, `"in_progress"`, `"completed"`, or `"failed"`.

**compaction\_id** `str | None`

Identifier of the latest compaction run, when one exists.

**completed\_at** `datetime | None`

When the latest compaction completed.

**compression\_ratio** `float | None`

Ratio of compacted-to-raw token count for the latest run. Lower values indicate more aggressive compression.

**validation\_score** `float | None`

Quality score for the latest compaction (0.0-1.0). Reflects how well the compacted summary preserves the original conversation's information.

**estimated\_completion\_seconds** `int | None`

For `status="in_progress"`, an estimated number of seconds until completion.

**error\_message** `str | None`

Failure reason when `status="failed"`.

**latest\_version** `int | None`

Version number of the latest compaction. Increments each time a new run completes.

**latest\_created\_at** `datetime | None`

When the latest compaction run was started.

### Example

```python theme={null}
import asyncio
import uuid
from maximem_synap import MaximemSynapSDK

sdk = MaximemSynapSDK(api_key="synap_your_key_here")
await sdk.initialize()

# conversation_id must be a valid UUID; reuse the conversation's id
conversation_id = str(uuid.uuid4())

job = await sdk.conversation.context.compact(
    conversation_id=conversation_id,
)

# Poll until the run completes
while True:
    status = await sdk.conversation.context.get_compaction_status(
        conversation_id=conversation_id,
    )
    if status.status in ("completed", "failed"):
        break
    await asyncio.sleep(2)

print(f"Final status: {status.status}")
```

### Raises

* `AuthenticationError`: when the API key is missing or invalid.
* `NetworkError`: when the SDK cannot reach Synap.

### See also

* [conversation.context.compact](https://docs.maximem.ai/sdk-reference/conversation-context/compact.md)
* [conversation.context.get\_compacted](https://docs.maximem.ai/sdk-reference/conversation-context/get-compacted.md)
* [conversation.context.get\_context\_for\_prompt](https://docs.maximem.ai/sdk-reference/conversation-context/get-context-for-prompt.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.