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

# Metadata

> Track system configurations with trace metadata

Attach metadata to traces to track custom system configurations. This metadata is essential for comparing performance across different setups and analyzing patterns in your AI agent behavior.

## Usage

<CodeGroup>
  ```python icon="python" lines highlight theme={null}
  from atla_insights import configure

  # We can define some system settings, prompt versions, etc. we'd like to keep track of.
  metadata = {  # [!code ++:4]
      "model": "gpt-4o-2024-08-06",
      "prompt-version": "v1.4",
  }

  # All subsequent traces will inherit this metadata
  configure(
      token="<MY_ATLA_INSIGHTS_TOKEN>",
      metadata=metadata,  # [!code ++]
  )
  ```

  ```typescript icon="square-js" lines theme={null}
  import { configure } from "@atla-ai/insights-sdk-js";

  // We can define some system settings, prompt versions, etc. we'd like to keep track of.
  const metadata = {  // [!code ++:4]
    "prompt-version": "v1.4",
    model: "gpt-4o-2024-08-06",
  };

  // All subsequent traces will inherit this metadata
  configure({
    token: "<MY_ATLA_INSIGHTS_TOKEN>",
    metadata,  // [!code ++]
  });
  ```
</CodeGroup>

### Dynamic Metadata

Metadata set with the `configure` function will be attached to all traces. You can also set metadata dynamically during runtime. This is useful, for example, to "tag" specific traces with information that is only available during runtime such as a User ID.

<CodeGroup>
  ```python icon="python" lines theme={null}
  from atla_insights import instrument, set_metadata

  @instrument("My Agent")
  def my_agent():
      # Add metadata specific to this execution
      set_metadata({"user_id": user_id, "feature_id": feature_id})  # [!code ++]
  ```

  ```typescript icon="square-js" lines theme={null}
  import { instrument, setMetadata } from "@atla-ai/insights-sdk-js";

  const myAgent = instrument("My Agent")(
    function(): void {
      // Add metadata specific to this execution
      setMetadata({ user_id: user_id, feature_id: feature_id });  // [!code ++]
    }
  );
  ```
</CodeGroup>

## Key Metadata Tags

Focus on these three essential metadata tags for effective experiment tracking:

| Tag          | Purpose                              | Examples                               |
| ------------ | ------------------------------------ | -------------------------------------- |
| `experiment` | Track different experiments          | `"v1.2-rc3"`, `"feature/fancy-update"` |
| `model`      | Track different models and versions  | `"gpt-5"`, `"claude-4-sonnet"`         |
| `prompt`     | Version control for prompt templates | `"baseline"`, `"optimized-v2"`         |
