Coder Social home page Coder Social logo

webservice-digital / assistant Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prcore/assistant

0.0 0.0 1.0 58 KB

A chat bot powered by GPT to answer questions related to documentation

Home Page: https://prcore-assistant.chaos.run

License: GNU General Public License v3.0

Shell 14.37% Python 82.17% Dockerfile 3.46%

assistant's Introduction

Docs Assistant

This is a simple tool to help you to create an AI-powered chatbot for your documentation.

What it used:

  • LangChain: for embedding and similarity calculation
  • OpenAI GPT-3.5 turbo: for conversation summary and response generation
  • Streamlit: for web interface

Diagram

First, use all documents + LangChain + OpenAI Embedding to create a Vector Store.

When receiving a user's question, generate the vector of the question and obtain K most similar document paragraphs as part of prompt for background information.

At the same time, retrieve the latest K messages in the conversation history and summary as part of prompt for historical messages.

Then use the user's original message as the final prompt question and ask OpenAI's model for an answer.

Finally, record this question-answer pair as part of Memory storage.

Demo

You can try the demo at https://prcore-assistant.chaos.run.

This is a screenshot of the demo:

Deployment

Follow the steps below to deploy the service.

  1. Make sure you installed docker and docker-compose on your machine.
  2. Clone this repository.
  3. Run cd scripts && bash prepare.sh to prepare the environment.
  4. You will be asked to edit the .env file. Please fill in each field with the correct information. You will also need to edit other files accordingly, including the prompt template.
  5. Then place your documentation files (text files only) in data/docs folder.
  6. Run cd scripts && bash install.sh to install the service.

The service will be deployed on localhost:<WEB_PORT>.

Magic mode

If you defined MAGIC_WORD in .env file, when user input the magic word, the assistant will allow user to ask any question.

Note: In this mode, the assistant won't use the knowledge base.

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.