A simple slack app / bot starter that fetches answers to questions using Langchain, OpenAI and a Pincone vectorstore

Overview

Slack-GPT

Table of Contents

  1. Introduction
  2. Prerequisites
  3. Creating and installing the application
  4. Configuration
  5. Starting the app
  6. Next Steps
  7. Sample Implementations
  8. TODO's

Introduction

A simple starter for a Slack app / chatbot that uses the Bolt.js Slack app framework, Langchain, openAI and a Pinecone vectorstore to provide LLM generated answers to user questions based on a custom data set.

Prerequisites

You'll need an existing pinecone index with your data stored as embeddings. An example of how to do this will be added to this repository in soon.

Creating and installing the application

  1. Step 1: Log in to your slack account and visit: https://api.slack.com/apps
  2. Step 2: Click the "Create New App" button and choose to create the app "from manifest"
  3. Step 3: Choose the slack workspace to which you want to add the chat bot
  4. Step 4: Paste in the following manifest and edit the name of your app accordingly
  name: [YOUR_APP_NAME_HERE]
features:
  bot_user:
    display_name: [YOUR_APP_DISPLAY_NAME_HERE]
    always_online: true
oauth_config:
  scopes:
    bot:
      - chat:write
      - chat:write.customize
      - im:history
      - im:write
      - app_mentions:read
      - im:read
settings:
  event_subscriptions:
    bot_events:
      - app_mention
      - message.im
  interactivity:
    is_enabled: true
  org_deploy_enabled: false
  socket_mode_enabled: true
  token_rotation_enabled: false
  1. Step 5: Click next and then click the button confirming the creation of your app
  2. Step 6: Navigate to the "basic information" page and click the "generate token and scopes" button under the app level tokens section
  3. Step 7: Create a token called Websockets and add the "connections:write" scope, copy your token and keep it somewhere safe
  4. Step 8: Navigate to "app home" and check the box "Allow users to send Slash commands and messages from the messages tab"
  5. Step 9: Navigate to the "Oauth and permissions" page and click the "install to workspace" button, then click to allow the installation and nececarry permissions. You should now see your Application in your apps list when opening your slack workspace

Configuration

  1. Step 1: Create a .env file in the root of your project and copy the .env.sample contents in to the new file
  2. Step 2: Add your websockets app level token we created earlier to the SLACK_APP_TOKEN variable
  3. Step 3: Head back to "Oath and permissions" and copy the "Bot User OAuth Token", and add it to the SLACK_BOT_TOKEN variable
  4. Step 4: Head to "Basic information" and copy your "Signing Secret" and save it to the SLACK_SIGNING_SECRET variable
  5. Step 5: Fill out your openai and pinecone related environment variables (Again, you'll need to have set up a pinecone index with your data embeddings)

Starting the app

  1. Step 1: Navigate to your application roon and run npm start You should now see that the bolt app is running and that your application has made a successful connection to slack
  2. Step 2: Navigate to your slack workspace and try sending your new bot a DM!

Next steps

  • Try editing the prompts for your use case which can be found in /config/prompts.js
  • Set up a production employment and start your bot on a server somewhere other than your local machine - https://render.com/ is a good, simple option for this.

Sample implementations

  1. HR assistant: A helpful slack bot that ingests data from a companies confluence space to provide HR assistance, includes full ingestsion pipeline.

TODO

  • Document deployment process
  • Investigate implementing response streaming
  • Better loading state
You might also like...

Obsidian text generator Plugin Text generator using GPT-3 (OpenAI)

Obsidian text generator Plugin Text generator using GPT-3 (OpenAI)

is a handy plugin for Obsidian that helps you generate text content using the powerful language model GP

Dec 29, 2022

Labels issues using OpenAI's Classification API powered by GPT-3 models!

Labels issues using OpenAI's Classification API powered by GPT-3 models!

OpenAI Issue Labeler πŸ€– This GitHub action labels issues using OpenAI's Classification API powered by GPT-3 models! We are using curie as our completi

Dec 21, 2022

This is a website for solving IT issues and providing IT solutions as answers to submitted tickets from clients. It is a project from Software Interns Team in Safecotech Internship Program 2022.

This is a website for solving IT issues and providing IT solutions as answers to submitted tickets from clients. It is a project from Software Interns Team in Safecotech Internship Program 2022.

CONNECT IT-Solutions Table of Contents Built With Getting Started Description Documentation Commit History Screenshots Contributors Built With : Node

Sep 24, 2022

Simple modern JavaScript ES6 library that fetches JSON data into an HTML table which displays nicely within a Bootstrap 4 Card.

Simple modern JavaScript ES6 library that fetches JSON data into an HTML table which displays nicely within a Bootstrap 4 Card. Uses simplenotsimpler/modern-table library.

Feb 17, 2022

Simply Netflix clone using ReactJS. It fetches the data from TMDB API

Simply Netflix clone using ReactJS. It fetches the data from TMDB API

NETFLIX CLONE This project is a simply front end clone of Netflix. It was created with React. It uses The MovieDB Api to search for movies and display

Dec 9, 2022

Generate #techtwitter tweets with OpenAI via Telegram.

Generate #techtwitter tweets with OpenAI via Telegram.

Responsible AI Hot Takes Generate and tweet awesome #techtwitter content with OpenAI via Telegram. After following FireShipIO's tutorial and hearing o

Mar 19, 2022

Next.js template for 🍌 Banana deployments of OpenAI Whisper.

Next.js Template for OpenAI Whisper 🀫 This is a Next.js template for 🍌 Banana deployments of Whisper on serverless GPUs. This is a great way to demo

Jan 1, 2023

This tool fetches my BrewFather inventory and publishes it at the link below.

🍺 BrewFather Inventory πŸš€ How to get your own BrewFather public inventory list Fork this repo Setup GitHub Pages Navigate to Settings Pages Select

Feb 24, 2022

πŸ€–β€An action that fetches the list of malicious domains on Discord in different providers and creates/updates a JSON file with them from time to time.

Discord Guardian Action πŸ€–  This action fetches the list of malicious domains on Discord in different providers and creates/updates a JSON file with t

Nov 30, 2022
Owner
Martin Hunt
Hi! I'm Martin, I'm an engineer and technology leader with over 10 years experience building production applications and high performing remote technical teams.
Martin Hunt
An example implementation of the slack-gpt starter which ingests confluence pages to create a helpful slack bot

Slack-GPT (HR bot example implementation) Table of Contents Introduction Prerequisites Creating and installing the application Configuration Starting

Martin Hunt 17 Jul 31, 2023
Weirdest JavaScript Interview Questions & Answers

Part 3 - JavaScript Pro Tips - Learn with Sumit Table of Contents How to run Contact How to run Different lessons taught in the Youtube Tutorial are o

Learn with Sumit 34 Dec 28, 2022
Start building admin tools on Slack without going into complex slack syntax and flows.

Slackmin Slackmin helps in easy integration with slack to use slash commands, interactive components, format and send messages, design and use modals.

PLG Works 49 Jan 2, 2023
slack-friends Make it easy to send to Slack from your application

slack-friends Make it easy to send to Slack from your application Installation ?? npm install slack-friends How to get bot token https://api.slack.com

Taein Kang 9 Aug 23, 2022
πŸ¦œοΈπŸ”— This is a very simple re-implementation of LangChain, in ~100 lines of code

??️ ?? LangChain-mini This is a very simple re-implementation of LangChain, in ~100 lines of code. In essence, it is an LLM (GPT-3.5) powered chat app

Colin Eberhardt 204 Aug 14, 2023
Capable Langchain/AutoGPT alternative in ~350 lines of core code

??️ ?? BingChain This is an evolution of langchain-mini, a very simple re-implementation of LangChain, in ~350 lines of core code. In essence, it is a

Postman Open Technologies 19 Jul 30, 2023
Simple web app that fetches posts and comments from jsonplaceholder

Simple web app that fetches posts and comments from jsonplaceholder

Paulo Luan 2 Mar 24, 2022
It is a simple Math Sprint Game in which the user must agree or disagree with the answers to math problems in the quickest time possible.

MATH-SPRINT-GAME The user must agree or disagree with the results of math equations in this Math Sprint Game. The amount of time the player spends mak

AMEY THAKUR 8 Aug 1, 2022
A simple CLI experiment that writes recommendation of GitHub repository/project in form of tweet. Powered by OpenAI GPT-3.

GitHub Repo Recommendation Writer A simple CLI experiment that writes recommendation of GitHub repository/project in form of tweet. Powered by OpenAI

Viktor Bezdek 5 Jul 18, 2022