---
title: Configuration
description: Configure site metadata, content directories, actions, robots policy, and generated outputs in ai-ready.config.mjs.
canonical_url: https://nextaiready.com/en/docs/api-reference/config
url: https://nextaiready.com/en/docs/api-reference/config
last_updated: 2026-09-26
updated: 2026-09-26
author: next-ai-ready team
summary: Configure site metadata, content directories, actions, robots policy, and generated outputs in ai-ready.config.mjs.
topics: [api, reference, content-directories, site-options]
---

# Configuration

The `ai-ready.config.mjs` file is the single entry point for configuring `next-ai-ready`. It lives in your project root.

You may use `ai-ready.config.ts` instead. The loader uses `jiti`, which is installed as a runtime dependency of `@next-ai-ready/next` through the meta package, so consumers must not install it separately.

## defineConfig

```js
import { defineConfig } from "next-ai-ready";

export default defineConfig({
  site: { ... },
  content: [ ... ],
  actions: "./actions/index.mjs",
  emit: { ... },
});
```

## site

Site-level metadata used in `llms.txt`, OpenAPI, and JSON-LD.

| Field         | Type     | Required | Description                              |
| ------------- | -------- | -------- | ---------------------------------------- |
| `name`        | `string` | Yes      | Your site or product name                |
| `baseUrl`     | `string` | Yes      | Production URL (used in canonical links) |
| `description` | `string` | Yes      | Short description for AI consumers       |

## content

An array of glob patterns pointing to your MDX content files:

```js
content: ["app/**/*.mdx", "content/**/*.mdx"]
```

These files are scanned during `next-ai-ready build` to produce the semantic graph, `llms.txt`, and per-page Markdown/JSON.

## actions

Path to your actions module, resolved relative to the config file:

```js
actions: "./actions/index.mjs"
```

The module should export an array of `defineAction(...)` calls wrapped in `defineActions(...)`:

```js
import { defineActions, defineAction } from "next-ai-ready";
export default defineActions([ ... ]);
```

## emit

Control which artifacts are generated:

| Field     | Type      | Default | Description                                                |
| --------- | --------- | ------- | ---------------------------------------------------------- |
| `openapi` | `boolean` | `true`  | Generate `/openapi.json`, `/tools.json`, `/ai-plugin.json` |

## robots

Choose whether the build emits `public/robots.txt` and how known AI agents are grouped. The original
all-or-nothing form remains supported:

```js
robots: {
  aiBots: "allow", // or "disallow"
  sitemap: true,
}
```

Use the purpose-based form when search visibility and model-training policy differ:

```js
robots: {
  aiBots: {
    search: "allow",
    user: "allow",
    training: "disallow",
    other: "allow",
  },
  sitemap: true,
}
```

| Field     | Type                                   | Default   | Description                                                                                                   |
| --------- | -------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------- |
| `aiBots`  | `"allow" \| "disallow" \| AiBotPolicy` | `"allow"` | One policy for all known bots, or independent `search`, `training`, `user`, `other`, and `default` decisions. |
| `sitemap` | `boolean \| string`                    | `false`   | Emit a sitemap declaration using the default or supplied URL.                                                 |
| `extra`   | `string[]`                             | `[]`      | Append raw directives to the static output. Not supported by the structured `aiRobots()` helper.              |

See [the robots.txt guide](../guides/robots-txt) for provider roles, a typed `app/robots.ts`
example, and the visibility consequences of each decision.
