Skip to main content

AI Knowledge Sub-Agent

AI Knowledge Sub-Agent lets the AI Chat Agent answer from pages in a Notion database, such as shipping, refund and support policies. Your team edits the pages in Notion, and the agent reads the latest version each time. There is nothing to sync.

The AI Chat Agent calls this workflow as a tool. A sub-agent inside it finds the right Notion page, reads it and writes the answer.

It is an AI Chat Add-on and needs the Lifetime, Ultra or Professional plan, or an Extended license.

tip

Knowledge Sub-Agent or AI Document Search? Use this add-on for a small set of pages your team keeps up to date in Notion. Use AI Document Search for many or long PDF, CSV or Markdown files, which it searches by meaning.

Requirements​

WhatUsed for
AI Chat AgentCalls this workflow
OpenAI API keyRuns the sub-agent
Notion workspace and an internal integrationHolds your pages

1. Prepare the Notion database​

  1. In Notion, create a database for your pages, one page per topic (for example "Shipping policy").
  2. Add a Select property named Status with the option Published.
  3. Set Status to Published on each page the agent may use.
  4. Create an internal integration at notion.so/profile/integrations and copy its secret.
  5. Open the database, click ... > Connections, and add your integration.

Pages without Published are ignored, so you can keep drafts in the same database.

2. Download and import the workflow​

  1. In FluxBuilder, go to Features > AI Chat Add-ons.

  2. Next to AI Knowledge Sub-Agent, click DOWNLOAD WORKFLOW.

  3. In n8n, open Workflows > Create > Import from File and pick the downloaded JSON.

3. Set the credentials​

NodeCredential
OpenAI Chat Model, Chat Model FallbackOpenAI
Get many database pages in Notion, Get many child blocks in NotionNotion API (the integration secret)

Pick a model your OpenAI account can use in both model nodes.

4. Select your database​

  1. Open the node Get many database pages in Notion.
  2. In Database, select your database from the list. The template points to a sample database you cannot reach.

If your database is not in the list, it is not connected to your integration yet. Repeat step 1.5.

5. Connect it to the AI Chat Agent​

  1. Save the workflow and click Publish.
  2. Open your AI Chat Agent workflow and the tool node Knowledge Sub-Agent.
  3. In Workflow, select the Knowledge Sub-Agent workflow you imported.
  4. This tool node is not connected by default. Connect it to the agent's Tool input, then publish the AI Chat Agent again.

Test it​

Open the Knowledge Sub-Agent workflow and click Open chat. Ask a question your pages answer, for example "How long does shipping take?".

Troubleshooting​

ProblemFix
Could not find databaseAdd your integration to the database (step 1.5), then select it again
The agent ignores a pageSet its Status to Published
A new page is not foundThe sub-agent reads a limited number of pages, newest edits first. Archive old pages or merge small ones
The AI Chat Agent never calls this workflowConnect Knowledge Sub-Agent to the agent's Tool input and select this workflow