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

# memories.create

> Ingest a document into Synap's memory pipeline asynchronously.

```python theme={null}
await sdk.memories.create(document, ...)
```

Ingest a document into Synap's memory pipeline. The document is processed asynchronously through the extraction, categorization, entity resolution, and storage stages. The call returns immediately with an `ingestion_id` you can poll via `memories.status()`.

### Parameters

<ParamField path="document" type="string" required>
  The raw document content to ingest. This can be a conversation transcript, a knowledge base article, a support ticket, or any text content.
</ParamField>

<ParamField path="document_type" type="string" required>
  The type of document being ingested. This determines how the ingestion pipeline processes the content.

  | Value                     | Description                                               |
  | ------------------------- | --------------------------------------------------------- |
  | `ai-chat-conversation`    | A conversation between a user and an AI assistant         |
  | `document`                | A generic document or report                              |
  | `email`                   | An email message or thread                                |
  | `pdf`                     | PDF document content (text extracted)                     |
  | `image`                   | Image descriptions or OCR text                            |
  | `audio`                   | Audio transcriptions                                      |
  | `meeting-transcript`      | Meeting transcription content                             |
  | `human-chat-conversation` | A conversation between two or more humans *(coming soon)* |
  | `support-ticket`          | A customer support ticket or thread *(coming soon)*       |
  | `knowledge-article`       | A structured knowledge base article *(coming soon)*       |
  | `note`                    | A freeform note or annotation *(coming soon)*             |
</ParamField>

<ParamField path="document_id" type="string">
  An optional external identifier for deduplication. If a document with this ID has already been ingested, the request is rejected as a conflict.
</ParamField>

<ParamField path="document_created_at" type="datetime">
  Timestamp of when the document was originally created. Used for temporal ordering of memories. Defaults to the current time if not provided.

  <Tip>
    Always provide `document_created_at` when backfilling historical data. Accurate timestamps improve temporal reasoning during retrieval (e.g., "What did the user say last month?").
  </Tip>
</ParamField>

<ParamField path="user_id" type="string">
  The external user ID this memory is about. Omit for customer- or client-scope ingestion.
</ParamField>

<ParamField path="customer_id" type="string">
  The external customer ID this memory belongs to. Required on B2B; auto-resolved on B2C. See [B2C vs B2B](/concepts/memory-scopes#b2c-vs-b2b-which-scopes-apply-to-you). Omit for client-scope ingestion. The effective scope is derived by the server from the IDs you pass and the instance's user-context isolation (B2C/B2B).
</ParamField>

<ParamField path="mode" type="string" required>
  The ingestion processing mode: the ingestion axis (`fast` vs `long-range`) of [Retrieval Modes](/concepts/retrieval-modes).

  | Value        | Description                                                                                                                                                                         |
  | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `fast`       | Optimized for speed. Uses lighter extraction models. Best for high-volume, real-time ingestion.                                                                                     |
  | `long-range` | Optimized for quality. Runs the full extraction pipeline including deep entity resolution, relationship mapping, and graph storage. Best for conversations and important documents. |
</ParamField>

<ParamField path="metadata" type="object">
  Arbitrary key-value pairs to attach to the memory. Useful for filtering and organizing memories.
</ParamField>

### Returns

`CreateMemoryResponse` with the ingestion job identifiers and initial status.

<ResponseField name="ingestion_id" type="UUID">
  Unique identifier for tracking this ingestion job. Pass this to [`memories.status`](/sdk-reference/memories/status) or [`memories.wait_for_completion`](/sdk-reference/memories/wait-for-completion).
</ResponseField>

<ResponseField name="document_id" type="string">
  The document identifier (either the one you supplied or one generated by the server).
</ResponseField>

<ResponseField name="status" type="string">
  Initial status of the ingestion job. Always `queued` for new submissions.
</ResponseField>

<ResponseField name="queued_at" type="datetime">
  Server timestamp at which the job was accepted into the queue.
</ResponseField>

### Example

```python theme={null}
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 when used to identify a conversation
conversation_id = str(uuid.uuid4())

result = await sdk.memories.create(
    document=(
        "User: I just moved to San Francisco and I'm looking for a good coffee shop.\n"
        "Assistant: Welcome to SF! There are some great options. Do you prefer light or dark roasts?\n"
        "User: Definitely light roasts. I'm also a big fan of pour-over."
    ),
    document_type="ai-chat-conversation",
    user_id="user_789",
    customer_id="cust_456",
    mode="long-range",
    metadata={"conversation_id": conversation_id, "source": "web-chat"},
)
print(result.ingestion_id)
```

<Note>
  Ingestion is asynchronous. A successful return means the document has been accepted for processing, not that extraction is complete. Use [`memories.status`](/sdk-reference/memories/status), [`memories.wait_for_completion`](/sdk-reference/memories/wait-for-completion), or [webhooks](/dashboard/webhooks) to track progress.
</Note>

### Raises

* `SynapAuthError`: when the API key is missing or invalid.
* `SynapValidationError`: when required fields are missing or `document_type` / `mode` are not recognized.
* `SynapConflictError`: when a document with the same `document_id` has already been ingested.

### See also

* [memories.batch\_create](/sdk-reference/memories/batch-create)
* [memories.create\_from\_file](/sdk-reference/memories/create-from-file)
* [memories.status](/sdk-reference/memories/status)
* [memories.wait\_for\_completion](/sdk-reference/memories/wait-for-completion)
