This directory contains code, and deployment and integration guides for the SuperKnowa Backend service.
The SuperKnowa Backend service is intended to be used in the context of Retrieval Augmented Generation (RAG) application. It leverages an external Information Retrieval service (Solr, Elasticsearch, or Watson Discovery) and a LLM hosted on watsonx.ai, in order to answer questions about a corpus of data.
The service exposes an API that is intended to be called by a front-end application (e.g. a web or mobile app). In addition, it is integrated with MongoDB in order to store questions from users together with answers, as well as user feedback.
- A user submits a question in natural language to a front-end application.
- The front-end application forwards the request to the SuperKnowa Backend.
- The SuperKnowa Backend requests documents from an Information Retrieval service.
- The SuperKnowa Backend sends the returned documents to a Reranker service.
- The Reranker sends back the most relevant documents to the SuperKnowa Backend.
- The SuperKnowa Backend creates a prompt for the LLM running on watsonx.ai, which consists of a context generated from the most relevant documents as well as the user's original question.
- The LLM returns a generated answer to the SuperKnowa Backend.
- The SuperKnowa Backend passes the message to the front-end application.
- The front-end application sends the message to the user.
The SuperKnowa Backend relies on the following external services which must be deployed in advance:
- Reranker service.
- LLM deployed with watsonx.ai.
- You have indexed a corpus of data with one of the following Information Retrievers:
- Solr
- Elasticsearch
- IBM Watson Discovery
- MongoDB. You can use the IBM Cloud MongoDB service for this purpose.
- (Optional) For OpenShift deployment, you will need an OpenShift cluster on which you can deploy applications.