# Parallel Thinking

For parallel reasoning (e.g., multiple agents/LLM thinking simultaneously), each stream **must have a different id**

```json
// Agent 1 - Stream A
{
  "data_type": "thinking_start",
  "data_value": "",
  "id": "aaaaaaaa-1111-1111-1111-111111111111"
}
```

```json
// Agent 2 - Stream B (different ID)
{
  "data_type": "thinking_start",
  "data_value": "",
  "id": "bbbbbbbb-2222-2222-2222-222222222222"
}
```

```json
// Agent 1 - Stream A continues
{
  "data_type": "thinking",
  "data_value": "Agent 1: Researching smartphone specs...",
  "id": "aaaaaaaa-1111-1111-1111-111111111111"
}
```

```json
// Agent 2 - Stream B continues
{
  "data_type": "thinking",
  "data_value": "Agent 2: Analyzing camera quality...",
  "id": "bbbbbbbb-2222-2222-2222-222222222222"
}
```

```json
// Agent 1 - Stream A ends
{
  "data_type": "thinking_end",
  "data_value": "",
  "id": "aaaaaaaa-1111-1111-1111-111111111111"
}
```

```json
// Agent 2 - Stream B ends
{
  "data_type": "thinking_end",
  "data_value": "",
  "id": "bbbbbbbb-2222-2222-2222-222222222222"
}
```

#### Database Storage

All thinking events with the same id are **merged** into a single event

```json
// What saved in database
{
  "timestamp": "2025-10-10T20:23:42.699179",
  "data_type": "thinking",
  "id": "aaaaaaaa-1111-1111-1111-111111111111",
  "value": "Agent 1: Researching smartphone specs..."
},
{
  "timestamp": "2025-10-10T20:23:42.699179",
  "data_type": "thinking",
  "id": "bbbbbbbb-2222-2222-2222-222222222222",
  "value": "Agent 2: Analyzing camera quality..."
}
```

{% hint style="info" %}
⚠️ thinking\_start and thinking\_end events are **filtered out** and not saved to the database
{% endhint %}
