Using my own knowledge base with custom GPT and Notion

I want my GPT (GPT assistant / GPT builders) to not only read knowledge files, but also to communicate with my Notion knowledge… so after asking questions to GPT it can give me answers based on domain knowledge from Notion.

How to connect Notion API to my version of GPT?

Should I use “gpt actions” or do this differently?

I’ve tried to talk with GPT so it can help me do this with help of “gpt actions”… code connects with API, but after a second it disconnects and doesn’t work.

(page ID is changed)

openapi: 3.0.0
info:
title: Notion Page Retrieval API
description: API for retrieving a specific page from Notion.
version: 1.0.0
servers:

- url: https://api.notion.com/
  description: Notion API server
  paths:
  /pages/{pageIdEx1234567890987654321}:
  get:
  operationId: retrieveNotionPage
  summary: Retrieves a specific Notion page
  description: Fetches details of the specified Notion page.
  responses:
  '200':
  description: Notion page details
  content:
  application/json:
  schema:
  type: object
  properties:
  object:
  type: string
  id:
  type: string
  created_time:
  type: string
  last_edited_time:
  type: string
  title:
  type: string
  content:
  type: string

You have to generate embeddings of your Notion knowledgebase and store them in a vector db. Then you can build an api which can fetch the most relevant information and then add this api as a custom action in your GPT

This is how we support Notion integration to our users in EmbedAI. You should be able to replicate the same

1 Like

Understood. Any tutorials for a newbie?

Also, do you think Notion is going to create integration so it’s going to be easier in the future?

Weaviate is a good choice for this because it has a query api where you only need send the prompt and it will return the relevant context documents. No need to embed your prompts before sending the requests.

2 Likes