> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-beta.getzep.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-beta.getzep.com/_mcp/server.

# Add Data in batch mode

POST https://api.getzep.com/api/v2/graph-batch
Content-Type: application/json

Add data to the graph in batch mode, processing episodes concurrently. Use only for data that is insensitive to processing order.

Reference: https://docs-beta.getzep.com/sdk-reference/graph/add-data-in-batch-mode

## Request

### Body (application/json)

This endpoint expects an apidata.AddDataBatchRequest.

- `episodes` (list of apidata.EpisodeData, required)
- `group_id` (string, optional)
- `user_id` (string, optional)

## Response

### 202

Added episodes

- `list of apidata.GraphEpisode`

## Errors

### 400 Bad Request Error

Bad Request

- `message` (string, optional)

### 500 Internal Server Error

Internal Server Error

- `message` (string, optional)

## Types

### apidata.EpisodeData

- `data` (string, required)
- `type` (enum, required)
  - Allowed values: `text`, `json`, `message`
- `created_at` (string, optional)
- `source_description` (string, optional)

### apidata.GraphEpisode

- `content` (string, required)
- `created_at` (string, required)
- `uuid` (string, required)
- `processed` (boolean, optional)
- `role` (string, optional) — Optional role, will only be present if the episode was created using memory.add API
- `role_type` (enum, optional) — Optional role_type, will only be present if the episode was created using memory.add API
  - Allowed values: `norole`, `system`, `assistant`, `user`, `function`, `tool`
- `session_id` (string, optional)
- `source` (enum, optional)
  - Allowed values: `text`, `json`, `message`
- `source_description` (string, optional)

## Examples

**Request**

```json
{
  "episodes": [
    {
      "data": "Discussed project milestones and deadlines for Q3 deliverables.",
      "type": "text"
    },
    {
      "data": "{\"task\":\"Update client on progress\",\"due_date\":\"2024-07-15\"}",
      "type": "json"
    },
    {
      "data": "User: Can you provide the latest sales figures?\nAssistant: The latest sales figures show a 12% increase over last quarter.",
      "type": "message"
    }
  ]
}
```

**Response**

```json
[
  {
    "content": "Discussed project milestones and deadlines for Q3 deliverables.",
    "created_at": "2024-06-20T10:15:30Z",
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "processed": true,
    "role": "project_manager",
    "role_type": "user",
    "session_id": "session-1234abcd",
    "source": "text",
    "source_description": "Meeting notes from 2024-06-20"
  },
  {
    "content": "{\"task\":\"Update client on progress\",\"due_date\":\"2024-07-15\"}",
    "created_at": "2024-06-20T10:16:00Z",
    "uuid": "b2c3d4e5-f678-90ab-cdef-1234567890ab",
    "processed": true,
    "role": "assistant_bot",
    "role_type": "assistant",
    "session_id": "session-1234abcd",
    "source": "json",
    "source_description": "Task update payload"
  },
  {
    "content": "User: Can you provide the latest sales figures?\nAssistant: The latest sales figures show a 12% increase over last quarter.",
    "created_at": "2024-06-20T10:17:00Z",
    "uuid": "c3d4e5f6-7890-abcd-ef12-34567890abcd",
    "processed": true,
    "role": "sales_analyst",
    "role_type": "user",
    "session_id": "session-1234abcd",
    "source": "message",
    "source_description": "Chat transcript excerpt"
  }
]
```