cloud-pipeline
cloud-pipeline copied to clipboard
Chatbot implementation
Background
Currently, we have a scope of the Platform documentation that can help users to perform some tasks. But sometimes it could be difficult to find exactly necessary instruction. It would be useful to implement an AI-powered chatbot in the Platform, enabling users to ask questions about the Platform usage or request assistance in launching certain jobs.
Approach
The main flow shall be the following:
- User initiates interaction - opens the chatbot interface (e.g., from the main sidebar).
- User inputs a question:
- user types a plain text question into the input text field
- optionally, user uploads an attachment(s) to add context to the query. Note: specifying of the existing file(s) from the storage shall be supported as well
- User submits the question.
- The chatbot analyzes the text input. If file(s) is attached, content of the attached file(s) shall not be analyzed - they shall be used only for the specific types of the response (see below).
- The chatbot generates a context-relevant response and displays it in the chat interface.
- Subsequent possible user actions:
- continue the conversation with follow-up questions (and/or additional files). Context shall be saved by the chatbot during the conversation
- navigate to the Platform pages/sections via links from the response
- navigate to the Platform documentation via links from the response
- launch a run prepared by the chatbot
Possible chatbot's response types:
- user's "how-to" instructions and Platform-reference information based on the Platform Documentation. This type of response may include:
- plain and formatted text
- links to the Platform pages/sections
- links to the Platform documentation
- response to the user request to perform some task (e.g., launch a tool or pipeline). This type of response may include:
- plain and formatted text
- links to the Platform pages/sections
- controls to manage the prepared run (e.g., confirm the launch)
- files attached via the request. Note: files shall not be processed or analyzed by the chatbot but shall be used in the subsequent run suggested in the response
Main flow's details
Chatbot shall be being opened from the main sidebar, e.g.:
Opened chatbot shall allocate the whole screen, e.g.:
Chatbot page shall contain:
- chat content form. Note: by default, it shall be empty and contain a simple stub with the user greeting
- request input field with:
- text field to specify a request
- button to add attachment(s)
- button to submit a request. Shall be disabled if the request is not specified. Note: request submit by press the Enter key shall be supported as well
To start a conversation, user specifies a question and clicks the Submit button (or presses the Enter key):
Once the request is submitted:
- greeting stub disappears (if it was displayed)
- user request appears in the chat content as sent message
- request input field becomes empty, the Submit button becomes disabled
- chatbot starts the analysis of the submitted request. Note: during the analysis process and response generation, some loading animation shall be shown in the preparing answer message of the chatbot
Once the response from the chatbot is generated, it shall appear in the chat content as the answer message, e.g.:
Response may include:
- section with the plain/formatted text - generated answer of the chatbot related to the user request
- hyperlinks to the Platform pages/sections (e.g. hyperlink "Tools" on the image above). By click such a link, a corresponding page/section of the current Cloud Pipeline deployment shall be opened in a new tab
- source references to the Platform documentation - if the response was prepared based on any page of the Platform documentation:
- near the corresponding part of the generated response, a number of the document reference shall be specified. At the image above, this is shown as numbers in circles inside text:
- under the generated response, links to the original documents shall be listed with their numbers. By click such a link, a corresponding documentation page shall be opened in a new tab:
- near the corresponding part of the generated response, a number of the document reference shall be specified. At the image above, this is shown as numbers in circles inside text:
- chatbot's accompanying message/comment over the generated response (at the image above, this is shown in the bottom of the chatbot message, under the horizontal line)
Attaching files
There shall be the ability to attach file(s) to the request:
By click the button, the pop-up shall appear which shall allow the user to:
- select any available file from the storage
- load a file from the local workstation
I suppose, the pop-up GUI and approach can be reused from the form of adding file to the input path parameter, i.e. this one:
Attached files shall appear in the request input field, e.g.:
For each attached file:
- only file name shall be shown
- remove button shall be
Note: there shall not be the ability to submit an empty request with only attached files (without request text). Submit button shall be enabled only when request text is specified:
Attached file names shall be shown in sent messages as well, e.g.:
Request for task execution
Response to the user request to perform some task shall be supported. In the first order, there we shall implement tasks "to launch a tool" and "to launch a pipeline". Chatbot shall correctly understand not only straight requests like "launch Centos tool", but and other request forms too - e.g. "perform alignment", "calculate variant calling", etc. Indirect evidence that user wants to execute a task shall be attached files - chatbot shall not process attachments, they shall be used only for running jobs as parameter values.
If the chatbot recognizes a request to perform a task, the response shall contain not only text message, but the prepared "card" that allows to execute a task, e.g.:
Such "card" for execution shall contain:
- object (tool/pipeline) name and version
- environment section with main execution settings (Docker image, Instance type, Disk size and Price type). Note: these settings cannot be changed from the card form, they shall be shown only for the information
- user parameters - there shall be shown only parameters that use files attached to the request. Note: these parameters cannot be changed from the card form, they shall be shown only for the information
- controls:
- Submit button - confirms task execution. By click it, corresponding run shall be launched and the Runs page is opened
- Edit button - allows to edit the task before execution. By click it, Launch page of the corresponding pipeline/tool shall be opened
Additionally, user shall have ability to continue conversation via the request field and confirm the launch or ask the chatbot, for example, to change something in settings/parameters of the suggested task execution.
Other options
TBD Shall we implement any chats history saving?