> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bitfab.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Primitives Overview

> The four objects Bitfab is built from: traces, datasets, graders, and experiments

## Overview

Bitfab has four primitives. Everything in the product is one of them, or a view over them.

| Primitive                                 | What it is                                                                        | Created by                             |
| ----------------------------------------- | --------------------------------------------------------------------------------- | -------------------------------------- |
| **[Trace](/web-portal/overview)**         | A recording of one workflow run: inputs, outputs, and every step inside           | Your instrumented code, automatically  |
| **[Dataset](/primitives/datasets)**       | A named bucket of traces your team reviews and that experiments replay against    | Your coding agent                      |
| **[Grader](/primitives/graders)**         | An automated pass/fail check on a trace, attached to the datasets it should score | Your coding agent                      |
| **[Experiment](/primitives/experiments)** | A replay of a dataset against your changed code, scored against expectations      | Your coding agent, or the SDK directly |

## How They Fit Together

The primitives chain into one loop:

1. **[Instrument](/instrumentation)** your code with the SDK. Every run of the instrumented function produces a **trace**.
2. **Collect** the interesting traces into a **dataset**, usually the failures you want to fix and the successes you refuse to break.
3. **Define graders** for the properties that matter, and attach them to the dataset. The dataset now has a pass rate instead of an opinion.
4. **Run an experiment**: replay the dataset against your changed code, and the graders score the replays. Each replayed trace comes back as fixed, regressed, still passing, or still failing.
5. Repeat, with the dataset growing every time you find a failure mode it did not cover.

<Note>
  Each primitive belongs to one organization and one **trace function key**, the name you passed to `getFunction()` or `get_function()`. A grader can only be attached to a dataset with the same key, and a dataset can only hold traces from that key.
</Note>

## Creating Primitives

Datasets, graders, and experiments are created from your coding agent, in plain language, through the Bitfab plugin:

```
Build a dataset of failing checkout-agent traces from last week
Add a grader on checkout-agent that fails when the reply invents an order number
Run an experiment on checkout-agent to improve pass rate
```

The web portal deliberately has no create forms for these. Its **New** buttons explain the agent prompt to use instead. The portal is where you read, review, and manage what already exists.

Traces are the exception: they are recorded by your instrumented code, so you create them by instrumenting a workflow and running it.

<CardGroup cols={3}>
  <Card title="Datasets" icon="database" href="/primitives/datasets">
    Curate the traces you evaluate against
  </Card>

  <Card title="Graders" icon="scale-balanced" href="/primitives/graders">
    Score traces pass or fail automatically
  </Card>

  <Card title="Experiments" icon="flask" href="/primitives/experiments">
    Replay a dataset against changed code
  </Card>
</CardGroup>

## Where to Go Next

* Setting up tracing for the first time: [Introduction](/introduction) and your SDK reference.
* Driving the UI: [Web Portal Overview](/web-portal/overview).
* Reviewing traces by hand: [Labeling](/web-portal/labeling).
