Project Introduction: A ChatBot for Your Notion Knowledge Base
The "A ChatBot for Your Notion Knowledge Base" project allows users to create a straightforward chatbot that can answer questions about the user's Notion knowledge base or documents. This system leverages advanced technologies such as OpenAI, Typescript, LangChain, and Pinecone to facilitate the process.
📊 Example Data
The project exemplifies its capabilities by utilizing a Notion template of support documents from Cron - a cutting-edge calendar designed for professionals and teams. This serves as a practical demonstration of how the chatbot can handle real-world data.
Development Process
To develop and set up this chatbot, users need to follow a sequence of steps to get everything running smoothly:
- Clone the Repository: Begin by cloning the project repository to your local machine.
- Install Necessary Packages: Use the command
pnpm install
to install all required software packages. - Configure Environment Settings:
- Duplicate the
.env.example
file as.env
. - Insert the necessary API keys into your
.env
file. This entails retrieving your secret API keys from OpenAI and Pinecone by visiting their respective websites.
- Duplicate the
- Set Up Pinecone Index: Navigate to the
pinecone-index.ts
file in theconfig
folder. ReplacePINECONE_INDEX_NAME
with your specific index name from the Pinecone dashboard to align the project with your data environment accurately.
🧑 Instructions for Ingesting Your Own Dataset
Users can ingest their own data sets by exporting content from Notion. Here’s how to proceed:
- Export Data: Click on the three dots in the corner of your Notion page, select
Export
, and choose theMarkdown & CSV
format. - Select Export Options: Opt to export
Everything
, include subpages, and create folders for them. - Unzip and Prepare Data: Move the resulting
.zip
file into your project’s root directory. Unzip this file to reveal theNotion_DB
folder with your markdown files and directories.
Data Ingestion Process
With your documents prepared, the next step involves ingesting this data, transforming your documents into numerical embeddings for efficient storage and analysis. This is done simply by running:
npm run ingest
Running the Application
To activate the local development environment, execute npm run dev
. Once running, users can utilize the searchable interface to pose questions regarding their documents, retrieving precise answers effortlessly.
Deployment Option
For those looking to make their chatbot accessible online, the project supports deployment via platforms like Vercel.
Vercel offers comprehensive documentation to streamline this process.
Credit
This innovative project takes inspiration from the "notion-qa" initiative, ensuring a user-friendly and highly functional experience for users seeking an intelligent chatbot solution for their Notion knowledge bases.