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

# Notion

> Sync Notion pages into your agent context

Add Notion as a context provider to give your agent access to documentation, wikis, and knowledge bases stored in Notion.

## Why Add Notion?

Syncing Notion pages allows your agent to:

* Answer questions using your team's documentation
* Reference business definitions and glossaries
* Use onboarding docs, runbooks, and process guides as context

## Adding Notion

**During initialization**

When you run `nao init`, you can add Notion interactively:

```bash theme={null}
nao init
```

The wizard will prompt for your Notion API key and the page IDs you want to sync.

**Manual configuration**

Add Notion to your `nao_config.yaml`:

```yaml theme={null}
notion:
  api_key: {{ env('NOTION_API_KEY') }}
  pages:
    - 0123456789abcdef0123456789abcdef
    - fedcba9876543210fedcba9876543210
```

* **`api_key`** — Your Notion integration API key. Use `{{ env('NOTION_API_KEY') }}` to reference an environment variable.
* **`pages`** — List of Notion page IDs to sync. You can find a page ID in the page URL: `https://notion.so/workspace/Page-ID-here`.

<Warning>
  Never commit your Notion API key to Git. Use environment variables for secrets.
</Warning>

## What Happens at nao sync

When you run `nao sync`, nao:

1. Connects to Notion using your API key
2. Fetches each configured page and its content
3. Exports pages as markdown files
4. Writes them under `docs/notion/` in your nao project

```
your-project/
└── docs/
    └── notion/
        ├── page-1.md
        ├── page-2.md
        └── ...
```

The exported markdown becomes part of your agent's context. Users can ask questions like "What does our onboarding doc say about X?" and the agent will read from the synced Notion content.

**Next Steps**

<CardGroup cols={2}>
  <Card title="Context Configuration" icon="gear" href="/nao-agent/context-builder/configuration">
    Initialize and configure your nao project
  </Card>

  <Card title="Synchronization" icon="sync" href="/nao-agent/context-builder/synchronization">
    Learn how to sync and update your agent's context
  </Card>
</CardGroup>
