# dataset.addItem() **Added in:** `@mastra/core@1.4.0` Adds a single item to the dataset. Each item has an input, optional ground truth, and optional metadata. ## Usage example ```typescript import { Mastra } from "@mastra/core"; const mastra = new Mastra({ /* storage config */ }); const dataset = await mastra.datasets.get({ id: "dataset-id" }); const item = await dataset.addItem({ input: { question: "What is TypeScript?" }, groundTruth: { answer: "A typed superset of JavaScript" }, metadata: { source: "manual" }, }); console.log(item.id); ``` ## Parameters **input:** (`unknown`): Input data for the item. **groundTruth?:** (`unknown`): Expected output or ground truth for scoring. **metadata?:** (`Record`): Arbitrary metadata for the item. ## Returns **result:** (`Promise`): DatasetItemid:stringUnique identifier of the item.datasetId:stringID of the parent dataset.datasetVersion:numberDataset version when the item was created.input:unknownInput data.groundTruth?:unknownGround truth data.metadata?:Record\Item metadata.createdAt:DateWhen the item was created.updatedAt:DateWhen the item was last updated.