- Notifications
You must be signed in to change notification settings - Fork368
License
hwchase17/notion-qa
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
🤖Ask questions to your Notion database in natural language🤖
💪 Built withLangChain
In order to set your environment up to run the code here, first install all requirements:
pip install -r requirements.txt
Then set your OpenAI API key (if you don't have one, get onehere)
export OPENAI_API_KEY=....- Example data from Blendle
- Python script to query Notion with a question
- Code to deploy on StreamLit
- Instructions for ingesting your own dataset
This repo uses theBlendle Employee Handbook as an example.It was downloaded October 18th so may have changed slightly since then!
In order to ask a question, run a command like:
python qa.py"is there food in the office?"You can switch outis there food in the office? for any question of your liking!
This exposes a chat interface for interacting with a Notion database.IMO, this is a more natural and convenient interface for getting information.
The code to run the StreamLit app is inmain.py.Note that when setting up your StreamLit app you should make sure to addOPENAI_API_KEY as a secret environment variable.
Export your dataset from Notion. You can do this by clicking on the three dots in the upper right hand corner and then clickingExport.
When exporting, make sure to select theMarkdown & CSV format option.
This will produce a.zip file in your Downloads folder. Move the.zip file into this repository.
Run the following command to unzip the zip file (replace theExport... with your own file name as needed).
unzip Export-d3adfe0f-3131-4bf3-8987-a52017fc1bae.zip -d Notion_DB
Run the following command to ingest the data.
python ingest.py
Boom! Now you're done, and you can ask it questions like:
python qa.py"is there food in the office?"About
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.

