π€Ask questions to your Roam Research graph in natural languageπ€
πͺ Built with LangChain
π€― Inspired by hwchase17/notion-qa
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 one here)
export OPENAI_API_KEY=....
- Example data from Blendle
- Python script to query Roam Graph with a question
- Code to deploy on StreamLit
- Instructions for ingesting your own dataset
This repo uses the Roam Help Graph as an example. It was downloaded at [[February 7, 2023]] so may have changed slightly since then!
In order to ask a question, run a command like:
python qa.py "What's the content of Roam Research's white paper?"
You can switch out What's the content of Roam Research's white paper?
for any question of your liking!
Of course, OpenAI also supports other languages, such as Chinese:
This exposes a chat interface for interacting with a Roam Research graph. IMO, this is a more natural and convenient interface for getting information.
The code to run the StreamLit app is in main.py
.
Note that when setting up your StreamLit app you should make sure to add OPENAI_API_KEY
as a secret environment variable.
Export your dataset from Roam Research. You can do this by clicking on the three dots in the upper right hand corner and then clicking Export
.
When exporting, make sure to select the Flat Markdown
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 the Export...
with your own file name as needed).
unzip Roam-Export-1675782732639.zip -d Roam_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 "What's the content of Roam Research's white paper?"
openai.error.RateLimitError: Rate limit reached for default-global-with-image-limits in organization org-xxxxxxxxxxxxxxxxxxxx on requests per min. Limit: 60.000000 / min. Current: 70.000000 / min. Contact support@openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment method.
Maybe you can try to upgrade the account access.