Files
SuperBizAgent-java/interview/aiops-query-augmentation.md
T

63 lines
2.1 KiB
Markdown

# AIOps Query Augmentation
## What Changed
Payload-targeted AIOps prompts now include a deterministic recommended knowledge query.
The query is built from the non-blank payload fields:
```text
alertName service severity description timeRange userRequest
```
Example:
```text
HighCPUUsage payment-service P1 CPU usage is above 80% last_15m
```
## Why This Matters
AIOps payload fields contain high-value retrieval terms:
- alert name
- service name
- severity
- symptom description
- time range
- operator request
Before this change, the Agent still had to invent its own `lookup_knowledge` query from the full prompt. That can work, but it may omit important terms such as the service name or alert name.
The new prompt makes the retrieval seed explicit:
```text
Recommended lookup_knowledge query: ...
```
## Design Choice
This is prompt-level query augmentation, not hidden retrieval.
I intentionally did not call `lookup_knowledge` automatically before the Agent runs. The project values traceability: tool calls should appear as Agent actions, with their inputs and outputs recorded in `tool_invocation`.
So the design is:
```text
AIOps payload
-> deterministic recommended retrieval query
-> Agent prompt
-> Agent may call lookup_knowledge explicitly
-> tool_invocation records the real retrieval action
```
## Interview Answer
If asked how AIOps payload improves RAG retrieval:
> I do not replace the user query with a broad domain. I extract the high-signal alert terms from the payload, such as alertName, service, severity, symptom, and time range, and put them into a compact recommended lookup query. The Agent still calls `lookup_knowledge` explicitly, so the trace remains auditable, but the retrieval query is less dependent on model improvisation.
If asked why not auto-call retrieval:
> Auto-calling retrieval would create hidden evidence before the Agent actually decides to use a tool. For this project, explicit tool invocation is more important because the interview story is about observable Agent execution. Prompt-level augmentation gives the Agent a better query seed without changing the trace contract.