Search through your Slack conversations and Notion pages using a natural language interface.
This repository integrates with Notion's and Slack's APIs to pull Slack messages and Notion pages. The chatbot has access to these documents and answers questions using RAG (retrieval-augment-generation).
The chatbot can be accessed from two interfaces: the CLI or Slack.
- Install Python >= 3.8.
- Clone this repository.
- Install packages:
pip install -r requirements.txt - Rename
example.envto.envand add your keys to this file.
Alternatively, you can skip installing pipenv and install the packages from requirements.txt.
Run python -m src to launch the app.
- Create a new Notion integration: https://www.notion.so/my-integrations/
- Add the Notion API key to the
.envfile - Add the integration to the desired Notion pages (in Page Settings > Connect To). Child pages inherit this setting.
- Create OpenAI API Keys at https://platform.openai.com
- Add the API org and key to the
.envfile
To chat with the app from Slack (rather than from the CLI) you should also follow these steps:
- Create a new Slack App: https://api.slack.com/apps.
- Use the app manifest from the file
resources/slack_app_manifest.yaml. - Add the app token and signing secret to the
.envfile - Change
self.interfaceinsrc/config.pyto'slack'. - Install ngrok to expose a public url:
brew install ngrok/ngrok/ngrok - Start a local tunnel to expose the chatbot:
ngrok http 8000 - Run the app (see below).
- Replace 'your-domain-here' with the ngrok url. You do this in the app manifest of the "Event Subscriptions" tab.
Run the command python -m src from the project root.
To change the configuration of the chatbot, change the attributes of the Config class in src/config.py.
Unordered:
- Integrate more knowledge bases (e.g. Github, Hubspot).
- Add more LLM options.
- A UI to manage integrations.
- Containerize the app.
- Separate data scraping into a separate service.
- Include instructions to run on common cloud providers.
- Add logging.
- Add documentation (docstrings etc.).
- Save fetched documents in cloud storage. They are currently saved locally.
- Determine integrations to use from environment variables.
- Use environ package for config.
- Support more Notion block types.
- Improve conversion of Slack messages to documents. Currently, each message is a separate document (with replies).
- Store conversations in a database.
