143 lines
3.7 KiB
Markdown
143 lines
3.7 KiB
Markdown
# MVP Demo Runbook
|
|
|
|
This demo proves the MVP flow from user question to persisted diagnosis trace.
|
|
|
|
## Prerequisites
|
|
|
|
- MySQL, Redis, Milvus/Zilliz, and LLM/embedding configuration are available through the current project configuration.
|
|
- Security and secret cleanup are intentionally out of scope for this MVP slice.
|
|
- The `mvp-demo` profile enables mock Prometheus and CLS providers so log and metric tools can return repeatable evidence.
|
|
|
|
## Start
|
|
|
|
```powershell
|
|
mvn spring-boot:run "-Dspring-boot.run.profiles=mvp-demo"
|
|
```
|
|
|
|
The service listens on:
|
|
|
|
```text
|
|
http://localhost:9900
|
|
```
|
|
|
|
## 1. Run Chat Diagnosis
|
|
|
|
```powershell
|
|
$sessionId = "mvp-demo-payment-timeout-001"
|
|
$body = @{
|
|
Id = $sessionId
|
|
Question = "支付接口最近出现超时,请结合知识库、日志和指标判断可能原因,并给出修复建议。"
|
|
} | ConvertTo-Json
|
|
|
|
Invoke-RestMethod `
|
|
-Method Post `
|
|
-Uri "http://localhost:9900/api/chat" `
|
|
-ContentType "application/json" `
|
|
-Body $body
|
|
```
|
|
|
|
Expected result:
|
|
|
|
- `data.success` is `true`.
|
|
- `data.sessionId` equals `mvp-demo-payment-timeout-001`.
|
|
- `data.answer` contains a diagnosis answer.
|
|
|
|
## 2. Query Trace
|
|
|
|
```powershell
|
|
Invoke-RestMethod `
|
|
-Method Get `
|
|
-Uri "http://localhost:9900/api/diagnosis/$sessionId/trace"
|
|
```
|
|
|
|
Expected result:
|
|
|
|
- `code` is `200`.
|
|
- `data.session.sessionId` equals the chat session id.
|
|
- `data.steps` contains planner/executor/verifier records for complex questions.
|
|
- `data.toolInvocations` contains evidence tool calls such as `lookup_knowledge`, `query_logs`, or `query_metrics`.
|
|
- `data.session.selfEvaluation` contains verifier or rule evaluation when available.
|
|
|
|
## 3. Submit Feedback
|
|
|
|
```powershell
|
|
$feedback = @{
|
|
sessionId = $sessionId
|
|
feedback = "useful"
|
|
} | ConvertTo-Json
|
|
|
|
Invoke-RestMethod `
|
|
-Method Post `
|
|
-Uri "http://localhost:9900/api/feedback" `
|
|
-ContentType "application/json" `
|
|
-Body $feedback
|
|
```
|
|
|
|
Expected result:
|
|
|
|
- `success` is `true`.
|
|
- A later trace query shows `data.session.feedback` as `useful`.
|
|
|
|
## 4. Run AIOps Alert Diagnosis
|
|
|
|
```powershell
|
|
$aiopsSessionId = "mvp-demo-aiops-payment-cpu-001"
|
|
$aiopsBody = @{
|
|
sessionId = $aiopsSessionId
|
|
alertName = "HighCPUUsage"
|
|
service = "payment-service"
|
|
severity = "P1"
|
|
description = "服务 payment-service 的 CPU 使用率持续超过 80%,当前值为 92%。实例: pod-payment-service-7d8f9c6b5-x2k4m。"
|
|
timeRange = "last_15m"
|
|
userRequest = "请结合 Prometheus 活动告警、system-metrics 日志和知识库生成告警分析报告。"
|
|
} | ConvertTo-Json
|
|
|
|
Invoke-WebRequest `
|
|
-Method Post `
|
|
-Uri "http://localhost:9900/api/ai_ops" `
|
|
-ContentType "application/json" `
|
|
-Body $aiopsBody
|
|
```
|
|
|
|
Expected result:
|
|
|
|
- The SSE stream starts with a `session` message containing `mvp-demo-aiops-payment-cpu-001`.
|
|
- The stream later contains an AIOps alert analysis report focused on the supplied `HighCPUUsage/payment-service` payload.
|
|
- A trace query for the same session id returns `data.session.agentFlow` as `AI_OPS`.
|
|
- `data.session.answer` contains the final alert analysis report when a report is generated.
|
|
- `data.toolInvocations` contains evidence tools such as `lookup_knowledge`, `query_logs`, or `query_metrics` when the runtime uses them.
|
|
|
|
Query the AIOps trace:
|
|
|
|
```powershell
|
|
Invoke-RestMethod `
|
|
-Method Get `
|
|
-Uri "http://localhost:9900/api/diagnosis/$aiopsSessionId/trace"
|
|
```
|
|
|
|
## Demo Story
|
|
|
|
The important interview story is:
|
|
|
|
```text
|
|
one session id
|
|
-> user question
|
|
-> multi-agent execution
|
|
-> evidence tools
|
|
-> verifier/self-evaluation
|
|
-> final answer
|
|
-> feedback
|
|
-> trace API for replay and audit
|
|
```
|
|
|
|
The AIOps story uses the same audit spine:
|
|
|
|
```text
|
|
one session id
|
|
-> alert payload
|
|
-> AIOps planner/executor execution
|
|
-> evidence tools
|
|
-> alert analysis report
|
|
-> trace API for replay and audit
|
|
```
|