This repository contains the offical implementations of our paper Nissist: An Incident Mitigation Copilot based on Troubleshooting Guides.
We are honored to be accepted by ECAI 2024 Demo Track.
-
Create virtual environment
Conda option:
conda create -n tsgcopilot python=3.10 conda activate tsgcopilot git clone ** pip install -r requirements.txt
Docker option:
docker build -t tsgcopilot . docker run -p 2000:2000 tsgcopilot
-
Initialize the parameters for OpenAI and Kusto.
You need to configure AOAI information before running the code.
- copy
config_example.yaml
and rename toconfig.yaml
and fill in your AOAI information and kusto information. Note that we offer two kusto login, if setKUSTO_LOGIN
asAAD
, you don't need to specifyKUSTO_SECRET
,KUSTO_AAD_APP_ID
, andKUSTO_AUTHORITY_ID
. If you donn't need KUSTO, just ignore it. - Note that the AOAI model needs to be new enough to support JSON format output, required to be version after 2023-10, refer to this json mode
- copy
-
Prepare Troubleshooting Guides
We give an example of the TSG we use in
example_data/TSGs
. You need to convert your documents into the same structure, and please refer totsg_reformulation
folder for more details.
You can run Nissist on Terminal or Interactive UI.
python TSG_Copilot.py
The interactive UI is implemented on ChainLit package.
-
Run the Nissist
First, you should start your TSG_Copilot API service, that means firstly run
python main.py
. And the service will listen on this port locally (http://127.0.0.1:2000/api/tsg_copilot).- Example request:
{ "query": "I got a incident that ...?", "conversation_id": "10000" }
Note: use the same conversation_id if you would like to continue the conversation.
-
Run the Web UI
After that, run the following script in terminal
chainlit run app.py
, it will automatically open the webpage (http://localhost:8000/), and you can input your message to get the response of Nissist.-
The function
send_message
insideapp.py
will call the API you have started. -
As your want to start a new round of conversation, you can type 'exit' or just start 'New Chat'.
-
-
Start up Nissist as the backend service, refer to
Run On Interactive UI
. -
Clone and install the latest version of TaskWeaver.
-
Copy the
ext_role/tsg_copilot
directory to the TaskWeaver as thetaskweaver/ext_role/tsg_copilot
directory. -
Copy all files in the
project/plugins
directory to the TaskWeaverproject/plugins
directory.Here we provide an example of the Kusto plugins to automate the execution of Kusto Query. You are required to set the Kusto configurations in the
pull_kusto_data.yaml
file. -
Copy all files in the
project/planner_examples
directory to the TaskWeaverproject/planner_examples
directory. -
Follow the instructions in the TaskWeaver QuickStart to start the TaskWeaver console chat.
Note that we should add the below new lines in the configuration file taskweaver_config.json
, besides the default LLM configurations.
{
"session.roles": [
"planner",
"code_interpreter",
"tsg_copilot"
],
"execution_service.kernel_mode": "local"
}
A demo is also provided.
https://github.com/AL-377/Nissist-Demo/blob/master/.asset/Nisst-demo.mp4
If you find this paper or code useful, please cite us:
@article{an2024nissist,
title={Nissist: An incident mitigation copilot based on troubleshooting guides},
author={An, Kaikai and Yang, Fangkai and Li, Liqun and Ren, Zhixing and Huang, Hao and Wang, Lu and Zhao, Pu and Kang, Yu and Ding, Hua and Lin, Qingwei and others},
journal={arXiv preprint arXiv:2402.17531},
year={2024}
}