Git Product home page Git Product logo

roam-qa's Introduction

Roam Research Question-Answering

πŸ€–Ask questions to your Roam Research graph in natural languageπŸ€–

πŸ’ͺ Built with LangChain

🀯 Inspired by hwchase17/notion-qa

🌲 Environment Setup

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=....

πŸ“„ What is in here?

  • Example data from Blendle
  • Python script to query Roam Graph with a question
  • Code to deploy on StreamLit
  • Instructions for ingesting your own dataset

πŸ“Š Example Data

This repo uses the Roam Help Graph as an example. It was downloaded at [[February 7, 2023]] so may have changed slightly since then!

πŸ’¬ Ask a question

In order to ask a question, run a command like:

python qa.py "What's the content of Roam Research's white paper?"

export

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:

export

This exposes a chat interface for interacting with a Roam Research graph. IMO, this is a more natural and convenient interface for getting information.

πŸš€ Code to deploy on StreamLit

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.

πŸ§‘ Instructions for ingesting your own dataset

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.

export

When exporting, make sure to select the Flat Markdown format option.

export-format

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?"

Trouble Shooting

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 [email protected] 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.

roam-qa's People

Contributors

jimmylv avatar hwchase17 avatar

Stargazers

James Blanda avatar Lennart Klein avatar  avatar Bo FENG avatar Jacob avatar  avatar  avatar Sulaiman Sanaullah avatar  avatar  avatar Xavier Armitage avatar  avatar Alain Crawford avatar  avatar Jack Armitage avatar Rui Mariano avatar  avatar  avatar Brunno dos Santos avatar Danyal Aytekin avatar Russ Simmons avatar Chaoyue He avatar  avatar Katz Kawai avatar KamalkaNipun avatar  avatar phi avatar  avatar  avatar HaiGe avatar SXG avatar  avatar  avatar Fabrice Gallet avatar Tong avatar  avatar  avatar  avatar Qinsi avatar Matt Vogel avatar Joshua Brown avatar

Watchers

Rui Mariano avatar  avatar Phrankie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.