Skip to content

Latest commit

 

History

History

ElasticDocs_GPT

ElasticDocs GPT

Combine the search power of Elasticsearch with the Question Answering power of GPT.

This application supports the popular Elastic blog ChatGPT and Elasticsearch: OpenAI meets private data.

ℹ️ This application uses the ChatGPT API with your own UI. If you want to use the ChatGPT UI, see the ElasticGPT plugin.

Overview

The following diagram shows the high level architecture of the application:

diagram

  1. A Python interface accepts user questions
    • Generates a hybrid search request for Elasticsearch
    • BM25 match on the title field
    • kNN searches on the title-vector field
    • Boost kNN search results to align scores
    • Set size=1 to return only the top scored document
  2. Search request is sent to Elasticsearch
  3. Documentation body and original url are returned to Python
  4. API call is made to OpenAI ChatCompletion with the prompt:
    • "answer this question using only this document <body_content from top search result>"
  5. Generated response is returned to Python
  6. Python adds original documentation source url to generated response and prints it to the screen for the user

Examples

autoscale

apm

inference

pii