> For the complete documentation index, see [llms.txt](https://docs.amigo.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amigo.ai/developer-guide/classic-api/data-access/organization-tables/simulation.md).

# Simulation

Schema reference for simulation personas, scenarios, unit tests, test sets, and their run results.

### Simulation Personas Table

**Table Name:** `simulation_personas` **Description:** Simulated user personas for testing

{% tabs %}
{% tab title="Schema" %}

| Column                      | Type      | Description               |
| --------------------------- | --------- | ------------------------- |
| `_id`                       | string    | Persona identifier        |
| `created_at`                | timestamp | Creation timestamp        |
| `creator_user_id`           | string    | Creator user ID           |
| `is_deleted`                | boolean   | Deletion status           |
| `latest_version_background` | string    | Latest persona background |
| `name`                      | string    | Persona name              |
| `org_id`                    | string    | Organization identifier   |
| `region_name`               | string    | Deployment region         |
| `role`                      | string    | Persona role              |
| `tags`                      | json      | Associated tags           |
| `updated_at`                | timestamp | Last update timestamp     |
| `updated_by_user_id`        | string    | Last updater user ID      |
| {% endtab %}                |           |                           |

{% tab title="Query Example" %}

```sql
SELECT
  name,
  role,
  latest_version_background,
  tags
FROM simulation_personas
WHERE is_deleted = false;
```

{% endtab %}
{% endtabs %}

### Simulation Persona Versions Table

**Table Name:** `simulation_persona_versions`\
**Description:** Version history for simulation personas

{% tabs %}
{% tab title="Schema" %}

| Column                  | Type           | Description             |
| ----------------------- | -------------- | ----------------------- |
| `_id`                   | string         | Version identifier      |
| `background`            | string         | Persona background      |
| `created_at`            | timestamp      | Creation timestamp      |
| `org_id`                | string         | Organization identifier |
| `preferred_language`    | string         | Preferred language      |
| `region_name`           | string         | Deployment region       |
| `simulation_persona_id` | string         | Parent persona ID       |
| `timezone`              | string         | Persona timezone        |
| `updated_at`            | timestamp      | Last update timestamp   |
| `user_models`           | array\<string> | Personalization models  |
| `version`               | integer        | Version number          |
| {% endtab %}            |                |                         |

{% tab title="Query Example" %}

```sql
SELECT
  simulation_persona_id,
  version,
  background,
  preferred_language
FROM simulation_persona_versions
ORDER BY version DESC;
```

{% endtab %}
{% endtabs %}

### Simulation Scenarios Table

**Table Name:** `simulation_scenarios`\
**Description:** Test scenario configurations

{% tabs %}
{% tab title="Schema" %}

| Column                        | Type      | Description                   |
| ----------------------------- | --------- | ----------------------------- |
| `_id`                         | string    | Scenario identifier           |
| `created_at`                  | timestamp | Creation timestamp            |
| `creator_user_id`             | string    | Creator user ID               |
| `deleted_at`                  | timestamp | Deletion timestamp            |
| `deleted_by_user_id`          | string    | User who deleted the scenario |
| `is_deleted`                  | boolean   | Deletion status               |
| `latest_version_instructions` | string    | Latest instructions           |
| `latest_version_objective`    | string    | Latest objective              |
| `name`                        | string    | Scenario name                 |
| `org_id`                      | string    | Organization identifier       |
| `region_name`                 | string    | Deployment region             |
| `tags`                        | json      | Associated tags               |
| `updated_at`                  | timestamp | Last update timestamp         |
| `updated_by_user_id`          | string    | Last updater user ID          |
| {% endtab %}                  |           |                               |

{% tab title="Query Example" %}

```sql
SELECT
  name,
  latest_version_objective,
  latest_version_instructions,
  tags
FROM simulation_scenarios
WHERE is_deleted = false;
```

{% endtab %}
{% endtabs %}

### Simulation Scenario Versions Table

**Table Name:** `simulation_scenario_versions`\
**Description:** Version history for simulation scenarios

{% tabs %}
{% tab title="Schema" %}

| Column                   | Type      | Description                                                              |
| ------------------------ | --------- | ------------------------------------------------------------------------ |
| `_id`                    | string    | Version identifier                                                       |
| `conversation_starts_at` | timestamp | Conversation start time (UTC); `NULL` means the server time at run start |
| `created_at`             | timestamp | Creation timestamp                                                       |
| `initial_message_type`   | string    | Initial message type (one of: `user-message`, `external-event`, `skip`)  |
| `instructions`           | string    | Scenario instructions                                                    |
| `objective`              | string    | Scenario objective                                                       |
| `org_id`                 | string    | Organization identifier                                                  |
| `region_name`            | string    | Deployment region                                                        |
| `simulation_scenario_id` | string    | Parent scenario ID                                                       |
| `updated_at`             | timestamp | Last update timestamp                                                    |
| `version`                | integer   | Version number                                                           |
| {% endtab %}             |           |                                                                          |

{% tab title="Query Example" %}

```sql
SELECT
  simulation_scenario_id,
  version,
  objective,
  instructions
FROM simulation_scenario_versions
ORDER BY version DESC;
```

{% endtab %}
{% endtabs %}

### Simulation Unit Tests Table

**Table Name:** `simulation_unit_tests`\
**Description:** Unit test configurations for conversation simulations

{% tabs %}
{% tab title="Schema" %}

| Column                     | Type      | Description             |
| -------------------------- | --------- | ----------------------- |
| `_id`                      | string    | Unit test identifier    |
| `created_at`               | timestamp | Creation timestamp      |
| `creator_user_id`          | string    | Creator user ID         |
| `description`              | string    | Test description        |
| `is_deleted`               | boolean   | Deletion status         |
| `max_interactions`         | integer   | Maximum interactions    |
| `name`                     | string    | Test name               |
| `org_id`                   | string    | Organization identifier |
| `persona_id`               | string    | Associated persona ID   |
| `region_name`              | string    | Deployment region       |
| `scenario_id`              | string    | Associated scenario ID  |
| `service_id`               | string    | Associated service ID   |
| `service_version_set_name` | string    | Version set name        |
| `success_criterions`       | json      | Success criteria        |
| `tags`                     | json      | Associated tags         |
| `updated_at`               | timestamp | Last update timestamp   |
| `updated_by_user_id`       | string    | Last updater user ID    |
| {% endtab %}               |           |                         |

{% tab title="Query Example" %}

```sql
SELECT
  name,
  description,
  service_id,
  persona_id,
  scenario_id,
  success_criterions
FROM simulation_unit_tests
WHERE is_deleted = false;
```

{% endtab %}
{% endtabs %}

### Simulation Unit Test Sets Table

**Table Name:** `simulation_unit_test_sets`\
**Description:** Collections of related unit tests

{% tabs %}
{% tab title="Schema" %}

| Column                  | Type      | Description             |
| ----------------------- | --------- | ----------------------- |
| `_id`                   | string    | Test set identifier     |
| `created_at`            | timestamp | Creation timestamp      |
| `creator_user_id`       | string    | Creator user ID         |
| `description`           | string    | Test set description    |
| `is_deleted`            | boolean   | Deletion status         |
| `last_triggered_run_id` | string    | Last run ID             |
| `name`                  | string    | Test set name           |
| `org_id`                | string    | Organization identifier |
| `region_name`           | string    | Deployment region       |
| `tags`                  | json      | Associated tags         |
| `unit_test_runs`        | json      | Test run history        |
| `updated_at`            | timestamp | Last update timestamp   |
| `updated_by_user_id`    | string    | Last updater user ID    |
| {% endtab %}            |           |                         |

{% tab title="Query Example" %}

```sql
SELECT
  name,
  description,
  last_triggered_run_id,
  unit_test_runs
FROM simulation_unit_test_sets
WHERE is_deleted = false;
```

{% endtab %}
{% endtabs %}

### Simulation Unit Test Set Runs Table

**Table Name:** `simulation_unit_test_set_runs`\
**Description:** Execution results for unit test sets

{% tabs %}
{% tab title="Schema" %}

| Column                        | Type      | Description                      |
| ----------------------------- | --------- | -------------------------------- |
| `_id`                         | string    | Run identifier                   |
| `artifacts_generated`         | boolean   | Whether artifacts were generated |
| `created_at`                  | timestamp | Creation timestamp               |
| `creator_user_id`             | string    | Creator user ID                  |
| `errored`                     | boolean   | Error status                     |
| `failed_metrics`              | boolean   | Whether any metric failed        |
| `org_id`                      | string    | Organization identifier          |
| `region_name`                 | string    | Deployment region                |
| `simulation_unit_test_set_id` | string    | Parent test set ID               |
| `unit_test_run_results`       | json      | Test execution results           |
| `unit_test_run_specs`         | json      | Test specifications              |
| `updated_at`                  | timestamp | Last update timestamp            |
| {% endtab %}                  |           |                                  |

{% tab title="Query Example" %}

```sql
SELECT
  simulation_unit_test_set_id,
  errored,
  unit_test_run_results,
  created_at
FROM simulation_unit_test_set_runs
WHERE failed_metrics = true
ORDER BY created_at DESC;
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.amigo.ai/developer-guide/classic-api/data-access/organization-tables/simulation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
