> For the complete documentation index, see [llms.txt](https://docs.sdv.dev/sdv/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/reference/metadata-spec/sequential-metadata-json.md).

# Sequential Metadata JSON

This guide describes the sequential metadata JSON spec.&#x20;

<figure><img src="/files/tdvX2emldgh3F9LBcyfp" alt=""><figcaption><p>An example of sequential data. There are multiple sequences (one for each Patient ID). Within each sequence is an ordered set of rows.</p></figcaption></figure>

<details>

<summary>Click to see the metadata JSON</summary>

```json
{
    "METADATA_SPEC_VERSION": "SINGLE_TABLE_V1",
    "sequence_key": "Patient ID",
    "sequence_index": "Time",
    "columns": {
        "Patient ID": { "sdtype": "id", "regex_format": "ID_[0-9]{3}" },
        "Address": { "sdtype": "physical_address", "pii": true },
        "Smoker": { "sdtype": "boolean" },
        "Time": { "sdtype": "datetime", "datetime_format": "%m/%d/%Y" },
        "Heart Rate": { "sdtype": "categorical" },
        "Systolic BP": { "sdtype": "numerical" }
    }
}
```

</details>

{% hint style="success" %}
**Create your metadata programmatically.** Use the [Python API](/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/single-table-data/data-preparation/single-table-metadata-api.md) to automatically detect the metadata based on your data.
{% endhint %}

## Overview

{% hint style="success" %}
The JSON for a sequential table is the same as the single table JSON with some added elements.

**See** [**Single Table JSON**](/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/reference/metadata-spec/single-table-metadata-json.md) **for more details.**
{% endhint %}

## Sequence Specific Concepts

You can optionally include additional metadata related to your sequences.

**`"sequence_key"`**: A column name of the sequence key, if you have multi-sequence data

{% hint style="info" %}
The **sequence key** is a column that identify which row(s) belong to which sequences. This is usually an ID column but it may also be a PII sdtype (such as `"phone_number"`).&#x20;

This is important for tables that contain multiple sequences. In our example, the sequence key is `'Patient ID'` because this column is used to break up the sequences.

If you don't supply a sequence key, the SDV assumes that your table only contains a single sequence. *Note: The SDV sequential models do not fully support single sequence data.*
{% endhint %}

**`"sequence_index"`**: A column name of the sequence index, if you have sequential data

{% hint style="info" %}
The **sequence index** determines the spacing between the rows in a sequence. Use this if you have an explicit index such as a timestamp. If you don't supply a sequence index, the SDV assumes there is equal spacing of an unknown unit.
{% endhint %}


---

# 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.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/reference/metadata-spec/sequential-metadata-json.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.
