Embedding datasets and training pairs
On this page you create the datasets of an embedding project and fill them with the training pairs it learns from.
A training pair has an anchor (a query), a positive (a passage that answers it) and an optional negative (a passage that does not). An embedding project can have up to 20 datasets, including archived ones; its default dataset is created automatically. Every route checks that you own the project and that the dataset belongs to it.
Create and manage datasets
GET .../datasets lists the project's datasets, including archived ones, with
each one's ready-pair count, source labels and the max_datasets limit. Create
a dataset, or rename one with PUT .../datasets/{dataset_id}, with:
{"name": "Research"}
Names are unique per project, ignoring case. Archive keeps a dataset's
pairs and its frozen versions readable; it does not delete them. An archived
dataset refuses edits, tags and new imports with 409 dataset_archived and
still counts toward the 20-dataset limit. Unarchive makes it editable
again. An unknown dataset ID, or one from another project, answers 404.
Add and edit training pairs
Add one pair with POST .../datasets/{dataset_id}/examples:
{
"anchor": "How do I resume a paused fine-tune?",
"positive": "Resume continues a run from its last checkpoint.",
"negative": "Cancel is available while a run is queued."
}
anchor and positive are required and cannot be blank; negative is
optional. Each text can be up to 20,480 characters. A stored negative is used
in training only by a profile that supports explicit negatives.
To edit a pair, send PUT .../examples/{example_id} with the new text and the
pair's current expected_revision. If the pair changed since you read it, the
edit answers 409 embedding_example_revision_conflict; read it again and
retry. DELETE .../examples/{example_id} removes a pair from the dataset.
The pair list (GET .../examples) uses a cursor, limit (1 to 100, default 25)
and an optional literal search q (up to 256 characters). It returns the
filtered total_count, next_cursor, and each pair's source and tag IDs. To
search, send q, cursor and limit in a JSON body to
POST .../examples/search, which answers the same page with the text out of
the URL (q in the GET URL is deprecated).
Tag training pairs
Tags select which pairs a training run uses. They belong to the project (up to
256) and are shared by its datasets. Create one with
POST .../datasets/{dataset_id}/tags and {"name": "billing"}.
GET .../datasets/{dataset_id}/tags lists every tag with its id, name and
example_count in that dataset.
To add or remove tags, send POST .../examples/tags with 1 to 100 rows. Each
row has the pair's example_id, its expected_revision and the complete new
list of tag_ids (up to 32 per pair):
{"rows": [{"example_id": 441, "expected_revision": 2, "tag_ids": [7, 12]}]}
The batch is all-or-nothing: one stale revision refuses every change. A changed tag set increments that pair's revision. A frozen dataset version records the tag IDs it selected, so retagging a pair later does not change what an earlier run trained on.
Import training pairs
To add many pairs at once from CSV or JSONL, use Dataset imports. It covers the mapping, the sample preview, the final counts and how to resume after a page reload.
Pairs from search feedback
Each pair has a source label that says where it came from. Search feedback appears only on a pair created from a search you reported and reviewed (see Search feedback), never from an embedding call.
Reviewed searches promoted into training pairs, and pairs you save from
Playground Search, receive the project tag retrieval_feedback
automatically, so you can train on them by selecting that tag. Existing tags
on a reused pair are kept; adding the tag increments that pair's revision.
Repeating the same promotion does not restore a tag you later removed. If the
project is at its tag limit, the promotion answers 409 tag_limit_reached and
leaves the review and the dataset unchanged. Reporting a search without
reviewing it creates no pair and no tag.
On the dataset screen, a promoted pair shows the Search feedback source once.
Its retrieval_feedback tag stays saved and selectable, but its duplicate
badge is hidden on that row. Other tags remain visible.
Reference
GET /api/v1/projects/{owner_slug}/{project_slug}/datasets
POST /api/v1/projects/{owner_slug}/{project_slug}/datasets
PUT /api/v1/projects/{owner_slug}/{project_slug}/datasets/{dataset_id}
POST /api/v1/projects/{owner_slug}/{project_slug}/datasets/{dataset_id}/archive
POST /api/v1/projects/{owner_slug}/{project_slug}/datasets/{dataset_id}/unarchive
GET /api/v1/projects/{owner_slug}/{project_slug}/datasets/{dataset_id}/examples
POST /api/v1/projects/{owner_slug}/{project_slug}/datasets/{dataset_id}/examples
PUT /api/v1/projects/{owner_slug}/{project_slug}/datasets/{dataset_id}/examples/{example_id}
DELETE /api/v1/projects/{owner_slug}/{project_slug}/datasets/{dataset_id}/examples/{example_id}
GET /api/v1/projects/{owner_slug}/{project_slug}/datasets/{dataset_id}/tags
POST /api/v1/projects/{owner_slug}/{project_slug}/datasets/{dataset_id}/tags
POST /api/v1/projects/{owner_slug}/{project_slug}/datasets/{dataset_id}/examples/tags