Content Integration - Notion

Overview

Moveworks Answers skill enables the Moveworks bot to answer user’s questions directly in chat, by understanding the questions and responding instantly with answers containing the most relevant article snippets, links to articles in the knowledge base, or links to external articles taken from trusted knowledge sources. The Moveworks Notion integration is leveraged by the Moveworks Answers skill to import content into the Moveworks Enterprise Cache so it can be searched by the Moveworks bot in real-time.

Supported Content Types

Moveworks can ingest all the text, sub-pages present in workspace by fetching all the children blocks for a workspace.

Supported Notion Blocks:

  • Headings 1/2/3
  • To Do
  • Bulleted/Numbered lists
  • Toggle
  • Callout
  • Quote
  • Paragraph
  • Code

Create a new integration with Notion

A Notion integration connects information in Notion to other software like Moveworks. To create a new integration:

  1. Visit https://www.notion.com/my-integrations in browser.
  2. Click on + New integration.
  3. Name the integration.
  4. Select the capabilities that new integration will have.
  5. Click Submit to create the integration.

On the next page, the Notion integration token can be found, also known as an API key. You’ll need this token to make requests to the Notion API. To retrieve the token after leaving this page, return to https://www.notion.so/my-integrations and click View integration.

Expose pages to the new integration

We can add new workspace/pages to an existing or newly created integration. This can be done by the admin of the workspace.

To keep your information secure, integrations don't have access to any pages or databases in the workspace at first. 

You must share specific pages with an integration in order for the API to access those pages.

To share a database/page with your integration:

  1. Go to the database/page in your workspace.
  2. Click the •• at the top right corner of the page.
  3. At the bottom of the pop-up, click Add connections.
  4. Search for and select your integration in the Search for connections... menu.

Your integration now has permission to edit the database/page.

How do we fetch knowledge from Notion?

We use the Notion integration you created to fetch knowledge articles. We currently ingest knowledge from the workspace level and are able to fetch all child pages present under each workspace.

Each workspace is assigned a unique id which we configure in our start url’s.

Each main page under the workspace needs to be exposed to the Notion connector.

API we use to fetch knowledge articles, Here the {block_id} is replaced by the workspace id
📎 https://api.notion.com/v1/blocks/{block_id}/children

When a user asks a question to the bot, the knowledge engine has already processed the articles and analyzes the content to create snippets which would provide the best answer to the user query

The Bot finds a relevant answer to the user query

The Bot doesn’t find any relevant answer to an user query

In Notion currently we only support ingestion of these blocks which are listed below

  • Headings 1/2/3
  • To Do
  • Bulleted/Numbered lists
  • Toggle
  • Callout
  • Quote
  • Paragraph
  • Code

How Ingestion works

Each workspace is assigned a unique id and to import this workspace into Moveworks you will need to configure the following URL:

e.g: https://api.notion.com/v1/blocks/{block_id}/children

Experience

End user experience

End user experience

The bot answers the query by providing a list of relevant articles with a short description and hyperlink that articles.

Notion article

Notion article

Architecture

  1. Moveworks identifies candidate files to ingest
    1. We use the block API to fetch all the knowledge content present in Notion. We pass the block id based on the workspace id or the id we get in response.
  2. Moveworks extracts the file as HTML and produces snippets
    1. The block API returns the block present on the knowledge article. We convert the response into an HTML format and ingestion into our knowledge engine to produce relevant snippets.
  3. Moveworks serves an answer to the user