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

# IAB Tech Lab buyer agent

> Connect IAB Tech Lab's reference buyer agent to Mixpeek for IAB Content Taxonomy 3.1 classification, brand-safety checks and contextual search.

IAB Tech Lab's [buyer agent](https://github.com/IABTechLab/buyer-agent) includes a Mixpeek client. With it configured, the agent gets three MCP tools:

| Tool | What it does |
| - | - |
| `classify_content` | Classifies text into IAB Content Taxonomy categories, returning name, tier, path and score |
| `check_brand_safety` | Classifies the text and flags matches against a list of sensitive categories |
| `contextual_search` | Runs any retriever in your namespace over indexed inventory |

## Configure the agent

Set these in the buyer agent's `.env`:

```bash theme={null}
MIXPEEK_API_KEY=your_api_key
MIXPEEK_BASE_URL=https://api.mixpeek.com
MIXPEEK_NAMESPACE=your_namespace_id
```

`classify_content` and `check_brand_safety` need a retriever over IAB categories. If you do not pass `retriever_id`, the agent uses a retriever in the namespace whose name contains both `iab` and `text`.

## Build the IAB namespace

The classifier is semantic search over the taxonomy: each IAB Content Taxonomy 3.1 category becomes a document whose text is its name and path, embedded with the text extractor. Each document must keep `iab_category_name`, `iab_tier` and `iab_path`, which are the fields the buyer agent reads from the results.

1. [Create a namespace](/docs/api-reference/namespaces/create-namespace.md) with the `text_extractor`.
2. Set a [spend budget](/docs/platform/budgets.md) on it. A new namespace starts at \$0.00 per day, and the embedding batch fails on that budget.
3. [Create a bucket](/docs/api-reference/buckets/create-bucket.md) and upload one object per category, with the text in a `category_text` blob and `iab_category_id`, `iab_category_name`, `iab_tier` and `iab_path` as fields. Leave `unique_key` off the bucket if you load it with the batch endpoint, which refuses buckets that declare one.
4. [Create a collection](/docs/api-reference/collections/create-collection.md) with `text_extractor`, `input_mappings: {"text": "category_text"}` and `field_passthrough` for the four `iab_` fields, then trigger it.
5. [Create a retriever](/docs/api-reference/retrievers/create-retriever.md) named `iab_text_search` with one `feature_search` stage on `mixpeek://text_extractor@v1/multilingual_e5_large_instruct_v1`, querying `{{INPUT.query}}`.

A complete, tested script is in the guide [Using Mixpeek in the IAB Tech Lab buyer agent](https://mixpeek.com/guides/iab-buyer-agent-contextual-classification).

## Behavior to know

* The number of results comes from the retriever's `final_top_k`. The tools' `limit` argument does not reduce it.
* `check_brand_safety` matches categories by exact name. At buyer-agent commit `47ac319`, seven of its fourteen names are not Content Taxonomy 3.1 names, so content in those areas is classified but not flagged. Compare the returned `categories` against your own list of 3.1 names if you rely on the flag.
* `risk_level` is `high` only when a flagged score is 0.85 or above.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.