Skip to content

An HR AI Companion who lives in Slack

License

Notifications You must be signed in to change notification settings

thenewyork/hr-gpt

 
 

Repository files navigation

HR-GPT (Your friendly HR Slack AI Agent)

Why does this exist?

hr-gpt

As remote workers, we know the pain of starting a new job and having a million questions about the company. We're under pressure to get up to speed quickly, but we also don't like to bother the HR or recruiters too much. So we're stuck!

As HR, you're probably tired of answering the same questions over and over again. You want to help your new hires, but you also have a million other things to do. Worse, there might be hundreds of new hired in this batch and they're all asking the same questions! You're tired!

hr-gpt

HR-GPT can be the bridge between you and your new hired. She'll also stick around throughout the onboarding period into the 1-month, 3-month and 6-month marks to make sure your hires are cared for.

hr-gpt

Screenshot 2023-05-01 at 9 03 37 AM

Tech overview

  • Check out the live demo here
  • The Slackbot runs from main.py
  • LangChain agent, LLMChain and RetrievalQA are used to answer questions
  • The agent receives a question and pick the best tool for the job (introduce itself, query the knowledge base, or calculate stock vesting schedule)
  • User can quickly update current knowledge vectorstore by uploading files directly through Slack or pasting URLs in using a slash (/) command.
  • OpenAI's gpt-3.5-turbo is used for both LLM and embedding operations
  • Supabase for logs in Postgres

Getting Started

  • Prerequisites

  • Setup Slack App and get tokens

    • Sign up for Slack

    • Go to api.slack.com

    • Create a new Slack app

      create app
    • Get and save the app's token (later to put in .env file)

      app's token
    • Get and save the bot's token (later to put in .env file)

      bot's token
    • Give the bot enough OAuth & Permissions scopes

      • Bot token scopes

        bot token scopes

        The scopes needed are: app_mentions:read, channels:history, channels:join, channels:read, chat:write, chat:write.customize, chat:write.public, conversations.connect:read, conversations.connect:write, groups:history, groups:read, im:history, im:read, im:write, im:write.invites, im:write.topic, incoming-webhook, links:write, metadata.message:read, mpim:history, mpim:read, mpim:write, reactions:read, reactions:write, users:read, users:read.email, users:write

      • User token scopes

        user token scopes

        The scopes needed are: im:history, im:read, im:write, im:write.invites, im:write.topic, mpim:history, mpim:read, mpim:write, reactions:read, reactions:write

    • Subscribe to events

      subscribe to events

      The events are: app_mention, app_mentions:read, im_history_changed, im:history, message.channels, channels:history, message.im, im:history, reaction_added

    • Install the Slack app in a workspace

      • Install it to an existing workspace that you're already part of or create a new one and install the app in it.

        install app
  • Setup project

    • Create a new .env file

    • Put in these details (the first line is to automatically activate the virtual env when you open the terminal)

      source hr-gpt/bin/activate
      
      OPENAI_API_KEY=
      SLACK_APP_TOKEN=
      SLACK_BOT_TOKEN=
      SUPABASE_URL=
      SUPABASE_KEY=
      
    • Create a new Python virtual environment

      • python -m venv hr-gpt (Mac)
      • py -m venv hr-gpt (Windows 11)
    • Start virtual environment manually by running: source hr-gpt/bin/activate (Mac)

      • Or start it automatically by opening a new Terminal or Powershell and entering the project's directory.
    • Install Python requirements in the project repository: pip install -r requirements.txt

      • If new dependencies are added, add them manually to requirements.txt

Start development

  • Make sure you're in the Python virtual environment (which is indicated by the name of the env in your Terminal/Powershell)

    venv
  • Start the app by running: python main.py (Mac) or py main.py (Windows 11)

Checking logs on Heroku

  • If you're using Heroku, you can check the logs by running the following command in the terminal:

    • heroku logs -a hr-gpt > logs/logs.txt

About

An HR AI Companion who lives in Slack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.9%
  • Procfile 0.1%