# Knowledge sources

A knowledge source is content your AI agents and teammates can draw on: FAQs,
uploaded documents, web pages, pasted text, and pages synced from Notion or
Confluence. Masheev splits each source into passages, indexes them, and retrieves
the most relevant passages when it answers.

Notion sources, Confluence sources and Team only knowledge are in beta. See
[Availability](https://docs.masheev.com/capabilities.md).

## Audience

Every source has an audience. Choose it when you create the source. You can
change it later.

| Audience             | Customers                                                                                                                                                        | Teammates                                               |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
| **Public** (default) | Agents may use it to answer customers on every channel: chat widget, email, SMS, WhatsApp, Instagram, voice calls, and AI reply suggestions a teammate may send. | Can search it.                                          |
| **Team only**        | Never used in anything a customer receives.                                                                                                                      | Can search it with `knowledge.ask` from the API or MCP. |

Use Team only for internal runbooks, pricing notes, escalation guides and anything
else you would not paste into a customer reply.

Changing the audience takes effect on answers immediately. For a Notion or
Confluence source, its pages are taken out of use and synced again under the new
audience, so it can take a few minutes before they answer questions again. You
can't change the audience while the source is syncing. Existing sources were all
Public before audiences existed, so nothing changed for them.

Only workspace admins can create a source or change its audience. Each audience
change is recorded in the audit log, including whether it came from the
dashboard, the API or MCP.

## Choose sources per agent

By default an agent uses every Public source in the workspace. To limit an agent,
assign it specific sources in the agent's knowledge settings. The agent then uses
only those sources, and only the ones that are Public. Assigning a Team only
source to an agent does not make it visible to customers.

## Notion

### Connect Notion

1. An admin opens **Settings → Integrations** and connects Notion.
2. Notion asks which pages to share with Masheev. Share only the pages you want
   to use. Masheev can read nothing else.

Masheev requests read access only. It never edits your Notion workspace.

### Create a Notion source

Pick a root page or database the connection can see. Everything under it is
synced: child pages, pages nested in toggles and columns, child databases and
their rows. Then set:

- **Name** and **audience**.
- **Excluded pages.** Pages to leave out. Excluding a page also leaves out the
  pages under it.
- **Include new pages automatically.** On by default. New pages created under the
  root are added on the next sync, after the secret check below. Turn it off to
  sync only the pages that exist when you create the source.

### Sync

Masheev checks each Notion source every 30 minutes and re-reads only the pages
that changed. Choose **Sync now** to sync straight away.

Content copied in from other pages with synced blocks, and media or embeds, is
not indexed.

### Paused pages

Before a page is used, Masheev checks it for credentials such as private keys,
cloud and API keys, access tokens and bearer tokens. A page that looks like it
contains one is paused and listed on the source with the kind of credential found.
Masheev does not store or show the value. Remove the credential in Notion and the
page resumes on the next sync.

### Removed and unshared pages

When you delete a page, stop sharing it with Masheev, move it out of the root or
exclude it, Masheev stops using it and deletes its indexed passages on the next
sync.

### Links in answers

Customers only see a link to a Notion page when the page is published to the web.
Otherwise a Public answer names the page title without a link. Teammates using
`knowledge.ask` on a Team only source may get the Notion link, which requires a
Notion login.

### Page limit

A source syncs up to 500 pages. If the root has more, the source shows a message
and the extra pages are not synced. Choose a smaller root or split the content
into several sources.

## Confluence

### Connect Atlassian

1. An admin opens **Settings → Integrations** and connects Atlassian.
2. Approve read-only access to Confluence.
3. If your account has more than one Atlassian site, choose the site Masheev
   should use. A workspace connects one site at a time.

Masheev works with Confluence Cloud. It never edits Confluence content.

### Create a Confluence source

Pick a space, or a page and the pages under it. The same settings apply as for
Notion: name, audience, excluded pages and include new pages automatically.
Syncing, the secret check, the 500-page limit and removal work the same way.

### Restricted pages

A page with view restrictions in Confluence, or under a restricted parent page,
cannot be used in a Public source. It is skipped and listed on the source as
restricted. Put restricted content in a Team only source if teammates need it.

Customer answers from Confluence name the page title without a link.

## Search team knowledge

Teammates can ask the knowledge base a question, including Team only sources,
with `knowledge.ask`. From the hosted MCP server the tool is `knowledge__ask`. See
[Connect an agent](https://docs.masheev.com/agents.md).

```json
{
  "orgId": "YOUR_WORKSPACE_ID",
  "query": "How do we handle a refund after 30 days?",
  "limit": 5
}
```

The response lists passages with their source name and audience:

```json
{
  "results": [
    {
      "content": "Refunds after 30 days need approval from…",
      "title": "Refund policy › Late refunds",
      "sourceId": "source_…",
      "sourceName": "Support runbook",
      "audience": "team",
      "score": 0.82
    }
  ]
}
```

`knowledge.ask` is for teammates. Do not pass its results to customers.

## Procedure reference

Call these through the API or MCP. Hosted MCP tool names use `__` in place of the
dot.

| Procedure                   | Who    | What it does                                                                                              |
| --------------------------- | ------ | --------------------------------------------------------------------------------------------------------- |
| `knowledge.create`          | Admin  | Create a source. Set `audience` to `public` or `team`.                                                    |
| `knowledge.update`          | Admin  | Change a source's name, settings or audience.                                                             |
| `knowledge.sync`            | Admin  | Sync a Notion or Confluence source now.                                                                   |
| `knowledge.browseConnector` | Admin  | List pages, databases or spaces a connection can see, to choose a root. Pass `parentId` to list children. |
| `knowledge.listDocuments`   | Member | List a connector source's pages and their state.                                                          |
| `knowledge.ask`             | Member | Search all knowledge, including Team only.                                                                |

### Create a Notion source

Use `connectionId` from `integrationStatus.all` and a root from
`knowledge.browseConnector`.

```json
{
  "orgId": "YOUR_WORKSPACE_ID",
  "name": "Help center",
  "audience": "public",
  "config": {
    "type": "notion",
    "connectionId": "NOTION_CONNECTION_ID",
    "rootId": "NOTION_PAGE_ID",
    "rootKind": "page",
    "rootTitle": "Help center",
    "excludedIds": [],
    "includeNew": true
  }
}
```

Set `rootKind` to `database` when the root is a Notion database.

### Create a Confluence source

`cloudId` must match the site the Atlassian connection uses. Leave out
`rootPageId` to sync the whole space.

```json
{
  "orgId": "YOUR_WORKSPACE_ID",
  "name": "Support runbooks",
  "audience": "team",
  "config": {
    "type": "confluence",
    "connectionId": "ATLASSIAN_CONNECTION_ID",
    "cloudId": "ATLASSIAN_CLOUD_ID",
    "spaceKey": "SUP",
    "rootPageId": "123456",
    "rootTitle": "Runbooks",
    "excludedIds": [],
    "includeNew": true
  }
}
```

### Change the audience

```json
{
  "id": "SOURCE_ID",
  "audience": "team"
}
```

### Page states

`knowledge.listDocuments` returns each page with one of these states:

| State           | Meaning                                                                              |
| --------------- | ------------------------------------------------------------------------------------ |
| `active`        | Synced and in use.                                                                   |
| `paused_secret` | Paused because it looks like it contains a credential. `stateDetail` names the kind. |
| `excluded`      | You excluded it from the source.                                                     |
| `removed`       | Deleted, unshared, moved out of the root, or the connection was removed.             |
| `restricted`    | Confluence page with view restrictions in a Public source.                           |

Rate limits apply per workspace: `knowledge.create` 5 per 10 minutes,
`knowledge.sync` 10 per 10 minutes, `knowledge.ask` 60 per minute.

## Security and privacy

- **Separate storage.** Team only passages are indexed separately from Public
  ones. Searches for customers never read the Team only index.
- **Checked on every answer.** Before any passage is used, Masheev checks the
  source's current audience, status and the agent's assigned sources. If an
  agent's settings cannot be read, it gets no knowledge rather than all of it.
- **Read only.** Notion and Confluence access is read-only. Masheev reads only
  what you share or what the connected Atlassian account can see.
- **Tokens** are encrypted at rest and never shown in answers, prompts or logs.
- **Content is treated as data.** Text from your sources is reference material
  for the agent, not instructions it follows.
- **Not logged.** Page content is not written to Masheev logs or error reports.
- **Disconnecting** Notion or Atlassian removes every source synced through that
  connection, with its indexed passages.

How Masheev handles Notion and Atlassian data, including what is stored and how
it is deleted, is described in the
[Privacy Policy](https://masheev.com/legal/privacy) (section 6.5) and the
[DPA](https://masheev.com/legal/dpa).
