Skip to main content

Create a question answering over docs bot with one line of code.

Project description

QnA Bot

Create a question answering over docs bot with one line of code:

from qnabot import QnABot
import os

os.environ["OPENAI_API_KEY"] = "my key"

bot = QnABot(directory="./mydata")

Here's how it works

High level overview what is happening under the hood:

sequenceDiagram
    actor User
    participant API
    participant LLM
    participant Vectorstore
    participant IngestionEngine
    participant DataLake
    autonumber

    Note over API, DataLake: Ingestion phase
    loop Every X time
    IngestionEngine ->> DataLake: Load documents
    DataLake -->> IngestionEngine: Return data
    IngestionEngine -->> IngestionEngine: Split documents and Create embeddings
    IngestionEngine ->> Vectorstore: Store documents and embeddings
    end

    Note over API, DataLake: Generation phase

    User ->> API: Receive user question
    API ->> Vectorstore: Lookup documents in the index relevant to the question
    API ->> API: Construct a prompt from the question and any relevant documents
    API ->> LLM: Pass the prompt to the model
    LLM -->> API: Get response from model
    API -->> User: Return response

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qnabot-0.0.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

qnabot-0.0.1-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file qnabot-0.0.1.tar.gz.

File metadata

  • Download URL: qnabot-0.0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for qnabot-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e59b945fc91d2249d1d7cbfddb65d3eecc3b256939bf9a56343c1b02165301cc
MD5 c5c664e4d94bf27ff84d14d741fd2e48
BLAKE2b-256 6ffdadf56141f3cd93479ed26078300bbb3a83396973efade76ce287f8e8c40d

See more details on using hashes here.

File details

Details for the file qnabot-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: qnabot-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for qnabot-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7360b6820c8bc0f73bd9743af7fcdb774ed4d0c52f568ae133450bb1ee04f57c
MD5 831e3ad243f1c7e2fb23e9f89b37db3d
BLAKE2b-256 7b47803f54e901e66cfec431e61d2a61249ea27f8bcef245b0d336cf96c122bf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page