Skip to main content

Buster, the QA documentation chatbot!

GitHub PyPI Code style: black Hugging Face Spaces

Buster is a question-answering chatbot that can be tuned to any source of documentations.

Demo

In order to view the full abilities of Buster, you can play with our live demo here. We scraped the documentation of huggingface 🤗 Transformers and instructed Buster to answer questions related to its usage.

Quickstart

This section is meant to help you install and run local version of Buster. First step, install buster:

Note: Buster requires python>=3.10

pip install buster-doctalk

Then, go to the examples folder and launch the app. We've included small sample data off stackoverflow-ai questions that you can test your setup with to try app:

cd buster/buster/examples
gradio gradio_app.py

This will launch the gradio app locally.

NOTE: The demo uses chatGPT to generate text and compute embeddings, make sure to set a valid openai API key:

export OPENAI_API_KEY=sk-...

Generating your own embeddings

Once your local version of Buster is up and running, the next step is for you to be able to import your own data. We will be using the stackoverflow.csv file in the buster/examples/ folder for this. This is the same data that was used to generate the demo app's embeddings.

You will first ingest the documents to be ready for buster. In this example, we use Deeplake's vector store, but you can always write your own custom DocumentManager:

import pandas as pd
from buster.documents_manager import DeepLakeDocumentsManager

# Read the csv
df = pd.read_csv("stackoverflow.csv")

# Generate the embeddings for our documents and store them in a deeplake format
dm = DeepLakeDocumentsManager(vector_store_path="deeplake_store", overwrite=True)
dm.add(df)

You can also just simply run the script:

python generate_embeddings.py --csv stackoverflow.csv

This will generate the embeddings and save them locally in the deeplake_store.

NOTE: You will need to set a valid openai key for computing embeddings:

export OPENAI_API_KEY=sk-...

You only need to run this operation one time.

In the .csv, we expect columns ["title", "url", "content", "source"] for each row of the csv:

  • title: this will be the title of the url to display
  • url: the link that clicking the title will redirect to
  • source: where the content was originally sourced from (e.g. wikipedia, stackoverflow, etc.)
  • content: plaintext of the documents to be embedded. It is your responsibility to chunk your documents appropriately. For better results, we recommend chunks of 400-600 words.

Additional Configurations

Properly prompting models as well as playing around with various model parameters can lead to different results. We use a BusterConfig object to keep track of the various Buster configurations. In the buster/examples/ folder, the config is stored inside cfg.py. Modify this config to update parameters, prompts, etc.

How does Buster work?

First, we parsed the documentation into snippets. For each snippet, we obtain an embedding by using the OpenAI API.

Then, when a user asks a question, we compute its embedding, and find the snippets from the doc with the highest cosine similarity to the question.

Finally, we craft the prompt:

  • The most relevant snippets from the doc.
  • The engineering prompt.
  • The user's question.

We send the prompt to the OpenAI API, and display the answer to the user!

Currently available models

  • For embeddings: "text-embedding-ada-002"
  • For completion: We support both "gpt-3.5-turbo" and "gpt-4"

Livestream

For more information, you can watch the livestream where explain how buster works in detail!

Metadata

Release files for buster-doctalk 1.0.28

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for buster-doctalk 1.0.28
File Size Uploaded Provenance
buster_doctalk-1.0.28.tar.gz 301.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for buster-doctalk 1.0.28
File Interpreter ABI Platform
buster_doctalk-1.0.28-py3-none-any.whl Python 3 none any Details

Total release size: 608.3 kB

Release files / buster_doctalk-1.0.28.tar.gz

Download URL buster_doctalk-1.0.28.tar.gz
Size 301.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f1a6d5c0ee117618d8ec3564c1dee6a420b971e00e3998d0eae88cf1fdf50046
BLAKE2b-256 checksum
How to use checksums
c07f9fad09ba752032439277aa452fa98a8a3afe6b7d568a1d86c0f025336abe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.13 Linux/6.2.0-1019-azure

Release files / buster_doctalk-1.0.28-py3-none-any.whl

Download URL buster_doctalk-1.0.28-py3-none-any.whl
Size 306.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be051af8b8546f387c6925ce2a840eb5e482d26cf5d4cc15b5b040e190ed8064
BLAKE2b-256 checksum
How to use checksums
dccbee7045cb408a67c5dea38a6af87d6de1ad97002185b8cfd2c761b7aa129d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.13 Linux/6.2.0-1019-azure

Security for buster-doctalk 1.0.28

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page