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

# Knowledge connectors

> Mirror pages from Notion, a Google Drive folder, Confluence spaces or a public website into a project's brain, so every agent on the project can search them. The source stays the source of truth.

A [project](https://docs.hookie.ai/projects.md) can mirror pages from Notion, a Google Drive folder, Confluence Cloud spaces or a public website into its [brain](https://docs.hookie.ai/project-context.md). Every agent on the project can then search them alongside its memories, decisions and documents. Every plan can connect sources, within the project's [document allowance](https://docs.hookie.ai/project-context.md#documents).

**The source stays the source of truth.** When a page changes, the next sync reads it again and keeps its earlier text in the document's [history](https://docs.hookie.ai/project-context.md#version-history). When a page is deleted, trashed or no longer shared with Hookie, it leaves the brain. Hookie never writes anything back to the source.

A project has one connector per source: one Notion, one Google Drive, one Confluence and one website.

## Your own credential

Every source is read with a credential **you** create and control: a Notion integration of your own, a Google service account in your own Google Cloud project, or your own Atlassian API token. There is no Hookie app to install in Notion, Google or Atlassian. A website needs no credential.

Hookie checks the credential with the source when you connect, stores it encrypted and never shows it again. To stop Hookie reading, disconnect the source in Hookie, or revoke the credential at the source.

## Connect a source

1. Open the project and choose **Sources**, then **Knowledge**.
2. Choose **Connect** beside the source.
3. Fill in the fields for that source, as described below.
4. Choose **Connect and sync**.

Hookie checks the settings, then runs the first sync straight away. Workspace owners and admins and the project's project admins connect sources; connected agents cannot.

### Notion

Hookie mirrors every page your integration can see.

1. Go to [notion.so/profile/integrations](https://www.notion.so/profile/integrations) and create a new **internal** integration in your workspace. It only needs to read content.
2. Open the integration and copy its secret from the **Configuration** tab.
3. In Notion, open each page or database you want mirrored, choose **•••**, then **Connections**, and add your integration. Pages under a shared page are included.
4. In Hookie, paste the secret into **Notion integration token**.

Notion has no other settings. To change what is mirrored, share pages with the integration or remove it from them in Notion. A page you stop sharing leaves the brain on the next sync.

### Google Drive

Hookie mirrors the files in one folder and its subfolders.

1. In your own [Google Cloud](https://console.cloud.google.com) project, enable the **Google Drive API**.
2. Under **IAM & Admin**, then **Service accounts**, create a service account. It needs no roles in the project.
3. Open the service account, choose **Keys**, then **Add key** and **Create new key**, and download the key as **JSON**.
4. In Google Drive, share the folder with the service account's email address (it ends in `iam.gserviceaccount.com`) as a **Viewer**.
5. In Hookie, paste the folder's link (or its id) into **Folder**, then paste the key file's contents into **Service-account key (JSON)**, or choose **Choose key file**.

Hookie asks Google only for read-only Drive access, and reads as the service account, never as a person. Folders on a shared drive work too.

### Confluence

Hookie mirrors the current pages of the spaces you name, on an Atlassian Cloud site (`your-site.atlassian.net`).

1. Go to [id.atlassian.com/manage-profile/security/api-tokens](https://id.atlassian.com/manage-profile/security/api-tokens) and create an API token. Classic and scoped tokens both work.
2. In Hookie, enter:
   * **Site**: `acme` or `acme.atlassian.net`.
   * **Atlassian account email**: the account the token belongs to.
   * **Space keys**: up to 20, separated by commas, such as `ENG, OPS`. A personal space's key starts with `~`.
   * **Atlassian API token**: the token.

Hookie reads only what that account can see. If it cannot see one of the spaces, Hookie says which one and does not connect.

> [!NOTE]
>
> Atlassian API tokens expire. You choose an expiry when you create one, at most a year ahead. When the token runs out, the connector shows **Needs attention**: create a new token, choose **Edit** and paste it.

### Website

Hookie crawls one public site from a start page you name, as **HookieBot**. It needs no credential.

1. Choose the **Start page**, such as `https://docs.example.com/`. It must be a public `https` address on the default port.
2. Choose **Connect and sync**. Hookie reads the start page first and refuses to connect if it cannot.

The crawl stays within the start page's origin and folder: `https://example.com/docs/intro` reads pages under `https://example.com/docs/` and nothing else. Query strings and `#` fragments are ignored, so each page is read once.

Hookie finds pages through the site's sitemaps (those named in `robots.txt`, or `/sitemap.xml`) and through the links on each page it reads. It is a polite crawler:

* It follows `robots.txt`: the rules for `HookieBot` if there are any, otherwise the rules for `*`.
* A page marked `noindex` (in a `robots` meta tag or an `X-Robots-Tag` header) is not indexed, and one already mirrored leaves the brain. Links on a `nofollow` page are not followed.
* Redirects are followed only within the crawl's scope, at most five times.
* If `robots.txt` cannot be read because the site is failing, Hookie reads nothing and tries again later.

Its requests carry the user agent `HookieBot/1.0 (+https://docs.hookie.ai/knowledge-connectors)`. To keep HookieBot out of part of your site, add a `User-agent: HookieBot` group to your `robots.txt`.

## What is mirrored

| Source | What Hookie reads |
| - | - |
| Notion | Every page shared with the integration, as Markdown. Database entries are pages too. |
| Google Drive | Google Docs (as Markdown), Google Sheets (as CSV) and Google Slides (as text); text, Markdown and CSV files; PDF, Word (.docx) and HTML files. Other file types are not listed. |
| Confluence | Current pages in the named spaces, with macros resolved. Drafts and archived or trashed pages are left out. |
| Website | HTML, Markdown, plain-text and PDF pages within scope. |

Hookie turns PDF, Word and HTML into Markdown and keeps that text, not the original file. Mirrored pages are documents with source `connector`, shown in the **Documents** table on the project's **Brain** page.

A page is **Skipped**, with the reason, when:

* it holds anything that looks like a key, token or password. Its content is never stored.
* it is too large: text and Markdown over 1 MB, PDF, Word and HTML over 5 MB, or a Google file over Google's 10 MB export limit.
* it has no text to index.
* its Google Drive owner does not allow it to be downloaded.
* a website page answers with an error such as `401` or `403`, redirects too often, or is a type Hookie does not index.

Choose **Pages** beside a source to see every page it found: **Mirrored**, **Skipped** with **Why skipped**, or **Waiting** to be read.

### Limits

| Limit | Value |
| - | - |
| Pages per connector | 500. Pages found past that are not tracked. |
| Pages read per sync | 20. The rest are read every few minutes, 20 at a time. |
| Confluence spaces | 1 to 20 |
| Google Drive subfolders | 200 |

Mirrored pages count towards the project's [document allowance](https://docs.hookie.ai/project-context.md#documents). When the allowance is full, the sync stops and the connector says why.

## Syncing

* **When you connect**, and when you save a change with **Edit**. A change of settings reads every page again.
* **Sync now**, in the console or with the `sync_project_connector` tool. Anyone who can write to the project's context may sync, agents included.
* **Once a day**, for every connector.

A sync reads only what changed: Hookie compares each page's version, checksum or last edit time with the one it read before. A website page with no `lastmod` in its sitemap is read again once a day.

## For agents

| Tool | What it does |
| - | - |
| `list_project_connectors` | The project's sources: settings, pages mirrored, skipped and waiting, when each last synced, and its last error. |
| `get_project_connector` | One source, by `provider` (`notion`, `gdrive`, `confluence` or `web`). With `pages: true`, every page it found and why any were skipped. |
| `sync_project_connector` | Sync one source now. `remaining` says how many pages the scheduled sync will finish, and `rate_limited` that the source asked Hookie to slow down. |

Agents search mirrored pages with `search_project_knowledge`, like any other document. The project's [context bundle](https://docs.hookie.ai/project-context.md) lists its connectors too. No tool takes or shows a credential: a person connects a source in the console. The CLI has the same tools as `hookie connectors list|get|sync`.

Everything mirrored was written by people, so agents receive it as **data, not instructions**.

## Over the API

All routes are under `/admin/api/projects/{project_id}/connectors`:

* `GET connectors`: the project's connectors, the providers on offer, and the limits.
* `GET`, `PUT`, `PATCH` and `DELETE connectors/{provider}`: read, connect, change or disconnect one. `PUT` and `PATCH` take `{"config": {…}, "credential": "…"}`. A `PATCH` without `credential` keeps the stored one.
* `POST connectors/{provider}/sync`: sync now.
* `GET connectors/{provider}/pages?offset=&limit=`: the pages it found, and why any were skipped.

The `config` for each provider:

| Provider | `config` | `credential` |
| - | - | - |
| `notion` | `{}` | The integration's secret. |
| `gdrive` | `{"folder_id": "…"}`, an id or a folder link | The service-account key file, as JSON text. |
| `confluence` | `{"site": "…", "email": "…", "space_keys": ["…"]}` | The Atlassian API token. |
| `web` | `{"url": "https://…"}` | None. |

Connecting, changing and disconnecting need a workspace owner or admin, or a project admin. A connected agent is refused with `agent_not_permitted`, whatever its access. See the [API reference](https://docs.hookie.ai/api-reference.md) for every field.

## Troubleshooting

| What you see | What to do |
| - | - |
| **… did not accept this …** or **… refused access …** | The credential is wrong, revoked or expired. Choose **Edit** and paste a new one. For Google Drive, check that the key is current and the Drive API is enabled in its project. |
| **Google Drive cannot see folder …** | Share the folder with the service account's email, shown in the message. |
| **Confluence account … cannot see space(s) …** | Check the space key, and that the account can read the space. |
| **… is rate-limiting requests** | Nothing to do. The source asked Hookie to slow down, and the sync carries on later. |
| **… robots.txt could not be read** | The site answered with a server error. Hookie tries again later. |
| **Hookie cannot read the start page: robots.txt does not let HookieBot read …** | Allow `HookieBot` in your `robots.txt`, or choose a start page it may read. |
| A page you expected is missing | Choose **Pages**. It may be **Skipped**, still **Waiting**, past the 500-page limit, or not shared with the integration or service account. |

A source in **Needs attention** is retried every hour. Its last error is shown under the table.

## Disconnect

Choose the source's menu, then **Disconnect**. Hookie forgets the credential and deletes every document the connector mirrored, so agents no longer find them. Nothing changes in the source. To stop access at the source too, delete the Notion integration, the service account's key or the Atlassian token.


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