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

# client.context.fetch

> Retrieve organizational (client-scoped) context: product knowledge, documentation, and announcements visible to every user across every customer.

```python theme={null}
await sdk.client.context.fetch(
    conversation_id=None,
    search_query=None,
    max_results=10,
    types=None,
    mode="fast",
)
```

Retrieve organizational context scoped to your application (client). Client-scoped memories are visible to all users across all customers. This is typically used for product knowledge, documentation, and announcements that were ingested via [bootstrap ingestion](/concepts/how-ingestion-works#bootstrap-ingestion).

### Parameters

<ParamField path="conversation_id" type="string">
  Optional conversation identifier. When provided, results are biased toward memories relevant to the active conversation. When supplied, it must be a valid UUID [registered via `record_message`](/concepts/context-end-to-end#short-term-context).
</ParamField>

<ParamField path="search_query" type="string | string[]">
  One or more search queries to find relevant organizational memories. If omitted, returns the most recent and highest-confidence client-scoped memories.
</ParamField>

<ParamField path="max_results" type="integer">
  Maximum number of memory items to return. Defaults to `10`. Maximum `50`.
</ParamField>

<ParamField path="types" type="string[]">
  Filter results to specific memory types. If omitted, all types are included.

  | Value            | Description                                            |
  | ---------------- | ------------------------------------------------------ |
  | `fact`           | Factual information about your organization or product |
  | `preference`     | Organizational preferences and standards               |
  | `episode`        | Significant organizational events                      |
  | `temporal_event` | Time-bound organizational events (launches, deadlines) |
</ParamField>

<ParamField path="mode" type="string">
  Retrieval mode that controls the speed-quality tradeoff: the retrieval axis (`fast` vs `accurate`) of [Retrieval Modes](/concepts/retrieval-modes).

  | Value      | Description                                                       |
  | ---------- | ----------------------------------------------------------------- |
  | `fast`     | Vector search only. Lower latency. **Default.**                   |
  | `accurate` | Full vector + graph + re-ranking. Higher quality, higher latency. |

  For real per-mode latency on your instance, see **Dashboard → Usage**.
</ParamField>

### Returns

A `ContextResponse` with the following fields:

<ResponseField name="facts" type="array">
  Array of fact memories relevant to the query. Each includes `content`, `confidence`, `entities`, `source`, and `relevance_score`.
</ResponseField>

<ResponseField name="preferences" type="array">
  Array of preference memories.
</ResponseField>

<ResponseField name="episodes" type="array">
  Array of episode memories.
</ResponseField>

<ResponseField name="metadata" type="object">
  Response metadata including `total_results`, `query_time_ms`, `tokens_used`, `scope`, and `mode`.
</ResponseField>

### Example

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

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

context = await sdk.client.context.fetch(
    search_query=["product features", "API rate limits"],
    max_results=5,
    types=["fact"],
    mode="accurate",
)

for fact in context.facts:
    print(f"[{fact.confidence:.2f}] {fact.content}")
```

```json Response theme={null}
{
  "facts": [
    {
      "id": "mem_org_a1b2c3d4",
      "content": "The API rate limit is 1000 requests per minute for Enterprise tier",
      "confidence": 0.97,
      "entities": [],
      "source": {
        "ingestion_id": "ing_bootstrap_001",
        "document_type": "knowledge-article",
        "document_created_at": "2025-01-10T00:00:00Z"
      },
      "relevance_score": 0.94
    },
    {
      "id": "mem_org_e5f67890",
      "content": "Platform supports SSO with SAML and OIDC protocols",
      "confidence": 0.95,
      "entities": [],
      "source": {
        "ingestion_id": "ing_bootstrap_002",
        "document_type": "document",
        "document_created_at": "2025-01-10T00:00:00Z"
      },
      "relevance_score": 0.87
    }
  ],
  "preferences": [],
  "episodes": [],
  "metadata": {
    "total_results": 2,
    "query_time_ms": 124,
    "tokens_used": 289,
    "scope": {
      "client_id": "cli_a1b2c3d4e5f67890"
    },
    "mode": "accurate"
  }
}
```

<Info>
  Client context is cached with a **30-minute TTL**. Repeated queries within the TTL window are served from cache without re-querying the storage engines. New bootstrap ingestions automatically invalidate the cache.
</Info>

### Raises

* `InvalidInputError`: when `mode` is not `"fast"` or `"accurate"`.
* `SDKNotInitializedError`: when called before `await sdk.initialize()`.
* `AuthenticationError`: when the API key is invalid or revoked.

### See also

* [`sdk.user.context.fetch`](/sdk-reference/context/user-fetch): user-scoped context
* [`sdk.customer.context.fetch`](/sdk-reference/context/customer-fetch): customer-scoped context
* [`sdk.context.fetch`](/sdk-reference/context/fetch): unified scope-chain fetch
