$ git clone https://github.com/Onely7/Cosense-RAG_for_slack.git
$ cd Cosense-RAG_for_slackCreate a .env file under the project directory and fill in the following fields.
export SLACK_SIGNING_SECRET="<cf*****>"
export SLACK_BOT_TOKEN="<xo*****>"
export PORT="<8888>"
export NGROK_AUTHTOKEN="<2z*****>"
export SOURCE_JSONL_PATH="<./source_data/fetched_original_pages_content.jsonl>"
export DB_PATH="<./vector_db>"
export SAVE_PATH="<./results>"Next, create a download_source_data/.env file under download_source_data and specify the SID for Cosense (Scrapbox).
export COSENSE_PROJECT_NAME="<my-project>"
export COSENSE_SID="<s%*****>"
export METADATA_FILE_PATH="<./source_data/fetched_original_pages_metadata.jsonl>"
export SOURCE_JSONL_PATH="<./source_data/fetched_original_pages_content.jsonl>"Move to the project root directory and run the following.
$ cd Cosense-RAG_for_slack
$ uv python install 3.10.18
$ uv python pin 3.10.18
$ uv syncEdit the download_source_data/fetch_metadata_and_content.sh file as appropriate and run it.
This will extract all documents included in the Cosense (Scrapbox) project and save them in JSONL format to the file path specified by the SOURCE_JSONL_PATH environment variable.
$ cd Cosense-RAG_for_slack/download_source_data
$ /bin/bash download_source_data/fetch_metadata_and_content.shConfigure the app settings on the Slack side appropriately.
Also, by using ngrok, you can map a local port to a public URL so that this app running locally can be accessed externally.
As shown below, open two terminals and keep them running at the same time.
# Put the RAG app in a state waiting for queries
$ /bin/bash app.sh# Associate the local port with a public URL via ngrok
$ /bin/bash run_ngrok.shFirst, from the Slack user interface, complete the initial setup by following the instructions in ./description.pdf.
Next, send a query with a mention to @Cosense-RAG as shown below; the query will be fed to the RAG app, and documents related to the query will be returned in a consolidated format.
@Cosense-RAG
If there are documents that mention BERT’s masking rate, please output a bulleted list with each item’s title and a one-sentence summary of what was explained.
@software{
author = {Daiki Shiono},
month = {Aug},
title = {{Cosense-RAG}},
url = {https://github.com/Onely7/Cosense-RAG_for_slack},
version = {0.1.0},
year = {2025}
}