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

# Traceability

> Trace any model prediction back to the training data, annotation, and QA review that produced it

Avala links every frame, label, review decision, and export version in a single platform. When a model fails on an edge case, you can trace the prediction back to the exact training label that influenced it -- and fix the root cause instead of guessing.

## What Traceability Means in Avala

Every annotation in Avala carries full lineage metadata:

| Entity           | What is tracked                                                               |
| ---------------- | ----------------------------------------------------------------------------- |
| **Dataset Item** | Source file URL, upload timestamp, sequence membership, sensor metadata       |
| **Task**         | Assigned annotator, creation time, completion time, state transitions         |
| **Result**       | Annotation data, tool used, annotator ID, submission timestamp                |
| **QA Review**    | Reviewer ID, review decision (accept/reject/fix), review comments             |
| **Export**       | Export format, included datasets/projects/slices, creation timestamp, version |

This means you can start from any exported label and walk backward through the full chain: which annotator created it, whether it passed QA, which dataset item it came from, and when each step happened.

## Walkthrough: Debugging a Model Failure

Here is a concrete example of how traceability helps you debug a production model issue.

### 1. Model fails on an edge case

Your perception model misclassifies a partially occluded pedestrian in a LiDAR scan. You identify the prediction and want to understand why the model learned this behavior.

### 2. Find the training data

Use the SDK to search your exports for the dataset items that contributed to the model's training set.

```python theme={null}
from avala import Client

client = Client()

# Get the export used for training
export = client.exports.get("export_abc123")
print(f"Export: {export.name}")
print(f"Format: {export.format}")
print(f"Created: {export.created_at}")
```

### 3. Inspect individual results

Each result in the export includes the source dataset item, annotator information, and QA status.

```python theme={null}
# List tasks from the project used in the export
tasks = client.tasks.list(project="project_uid")

for task in tasks:
    print(f"Task {task.uid}")
    print(f"  Status: {task.status}")
    print(f"  Dataset: {task.dataset_name}")
    print(f"  Item: {task.dataset_item_name}")
```

### 4. Trace back to the source

Once you identify the problematic label, you can look up the original dataset item to see its source file, sensor metadata, and full annotation history.

```python theme={null}
# Get the specific dataset item
item = client.datasets.get_item(
    dataset="dataset_uid",
    item="item_uid"
)

print(f"Source: {item.source_url}")
print(f"Uploaded: {item.created_at}")
print(f"Sequence: {item.sequence_name}")
```

### 5. Fix and retrain

With the root cause identified -- for example, an annotation error on the occluded pedestrian -- you fix the label in Avala, create a new export, and retrain your model with corrected data.

```python theme={null}
# Create a new export with the corrected labels
new_export = client.exports.create(
    name="Training v2 - fixed occlusion labels",
    format="avala-json-external",
    projects=["project_uid"]
)

print(f"New export: {new_export.uid}")
```

## Benefits

### Reproducibility

Every export is versioned. You can recreate the exact training set used for any model version by referencing the export UID. No guessing which labels were included or excluded.

### Faster debugging

Instead of manually searching through thousands of annotations to find an error, you trace directly from the model's failure to the specific label that caused it. What used to take days takes minutes.

### Compliance and audit trails

For regulated industries (automotive, medical, defense), traceability provides the documentation trail that auditors require. Every annotation decision is attributed, timestamped, and linked to its QA review.

### Continuous improvement

Track annotation quality over time by correlating model performance with specific annotators, review stages, and dataset versions. Identify systematic labeling issues before they propagate through your training pipeline.

## Traceability via the API

All traceability data is available through the REST API and SDKs. Key endpoints:

| Endpoint                                | What it returns                                                      |
| --------------------------------------- | -------------------------------------------------------------------- |
| `GET /api/v1/exports/{uid}/`            | Export metadata including datasets, projects, and creation timestamp |
| `GET /api/v1/tasks/`                    | Task list with status, annotator, and dataset item references        |
| `GET /api/v1/datasets/{uid}/items/`     | Dataset items with source URLs and sequence membership               |
| `GET /api/v1/datasets/{uid}/sequences/` | Sequences with frame count and item references                       |

See the [API Reference](/docs/api-reference/overview) for full endpoint documentation, or use the [Python SDK](/docs/sdks/python) and [TypeScript SDK](/docs/sdks/typescript) for typed access.

## Next Steps

<CardGroup cols={2}>
  <Card title="" icon="shield-check" href="/docs/annotation/guides/quality-control">
    <p style={{fontWeight: 600, fontSize: '18px', marginBottom: '4px', marginTop: '8px', color: 'inherit'}}>Quality Control</p>
    <p style={{fontSize: '14px', marginTop: '0px', opacity: 0.6}}>Learn how Avala's multi-stage QA workflows catch annotation errors before they reach your model.</p>
  </Card>

  <Card title="" icon="file-export" href="/docs/api-reference/exports">
    <p style={{fontWeight: 600, fontSize: '18px', marginBottom: '4px', marginTop: '8px', color: 'inherit'}}>Exports</p>
    <p style={{fontSize: '14px', marginTop: '0px', opacity: 0.6}}>Create versioned exports of your annotated data with full lineage metadata.</p>
  </Card>

  <Card title="" icon="chart-bar" href="/docs/quality-sla">
    <p style={{fontWeight: 600, fontSize: '18px', marginBottom: '4px', marginTop: '8px', color: 'inherit'}}>Quality SLAs</p>
    <p style={{fontSize: '14px', marginTop: '0px', opacity: 0.6}}>Understand Avala's quality guarantees, accuracy targets, and turnaround times.</p>
  </Card>

  <Card title="" icon="python" href="/docs/sdks/python">
    <p style={{fontWeight: 600, fontSize: '18px', marginBottom: '4px', marginTop: '8px', color: 'inherit'}}>Python SDK</p>
    <p style={{fontSize: '14px', marginTop: '0px', opacity: 0.6}}>Install the SDK and start querying your data programmatically.</p>
  </Card>
</CardGroup>
