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

> Ingest multiple documents in a single call for bootstrap or bulk ingestion.

```python theme={null}
await sdk.memories.batch_create(documents, fail_fast=False)
```

Ingest multiple documents in a single call. This is the primary method for **bootstrap ingestion**: loading historical conversations, backfilling knowledge bases, and migrating data from other systems. Each document is processed independently through the ingestion pipeline.

### Parameters

<ParamField path="documents" type="List[CreateMemoryRequest]" required>
  List of `CreateMemoryRequest` objects. Each entry has the same fields as [`memories.create`](/sdk-reference/memories/create) (document, document\_type, user\_id, customer\_id, mode, metadata, etc.). `customer_id` is required on B2B and auto-resolved on B2C ([B2C vs B2B](/concepts/memory-scopes#b2c-vs-b2b-which-scopes-apply-to-you)); `mode` is the ingestion axis (`fast` vs `long-range`) of [Retrieval Modes](/concepts/retrieval-modes).
</ParamField>

<ParamField path="fail_fast" type="boolean">
  If `True`, the entire batch is rejected as soon as any single document fails validation. If `False` (default), valid documents are accepted and invalid ones are returned with `error_message` populated in the per-item result.
</ParamField>

### Returns

`BatchCreateResponse` with aggregate counts and per-document results.

<ResponseField name="batch_id" type="UUID">
  Unique identifier for the batch submission.
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of documents submitted.
</ResponseField>

<ResponseField name="succeeded" type="integer">
  Number of documents successfully queued.
</ResponseField>

<ResponseField name="failed" type="integer">
  Number of documents that failed validation.
</ResponseField>

<ResponseField name="results" type="List[CreateMemoryResponse]">
  Per-document results. Each contains `ingestion_id`, `document_id`, `status`, `queued_at`, and an optional `error_message` if that document was rejected.
</ResponseField>

### Example

```python theme={null}
from maximem_synap import MaximemSynapSDK
from maximem_synap.memories.models import CreateMemoryRequest

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

batch = await sdk.memories.batch_create(
    documents=[
        CreateMemoryRequest(
            document="User: My favorite color is blue.\nAssistant: Noted!",
            document_type="ai-chat-conversation",
            user_id="user_789",
            customer_id="cust_456",
            mode="fast",
        ),
        CreateMemoryRequest(
            document="User: I work at Acme Corp as a senior engineer.",
            document_type="ai-chat-conversation",
            user_id="user_789",
            customer_id="cust_456",
            mode="fast",
        ),
    ],
    fail_fast=False,
)
print(f"{batch.succeeded}/{batch.total} queued")
```

<Tip>
  Batch ingestion is more efficient than individual calls when you have multiple documents to process. The maximum batch size is 100 documents per call. For large-scale bootstrap operations, see the [Bootstrap Ingestion](/concepts/how-ingestion-works#bootstrap-ingestion) guide.
</Tip>

### Raises

* `SynapAuthError`: when the API key is missing or invalid.
* `SynapValidationError`: when the batch payload is malformed or exceeds the maximum size.

### See also

* [memories.create](/sdk-reference/memories/create)
* [memories.create\_from\_file](/sdk-reference/memories/create-from-file)
* [memories.status](/sdk-reference/memories/status)
