Agent Charts
CI / test (push) Successful in 2m37s
Release rolling / release (push) Successful in 11m32s

This commit is contained in:
Raven Scott
2026-07-30 16:28:06 -04:00
parent bcfec67368
commit 6119ba6e46
8 changed files with 734 additions and 20 deletions
+16 -9
View File
@@ -28,7 +28,7 @@ export function buildSystemPrompt(ctx = {}) {
'- Cite chart ids (e.g. system.cpu) when discussing metrics.',
'- You are read-only unless the user explicitly asks for an operator action and their role allows it.',
'- Do not claim cloud access; all inference is local via QVAC.',
'- Prefer open_chart / open_view when the user asks to see something in the UI.',
'- Prefer show_charts / open_chart / open_view when the user asks to see graphs or the UI.',
multi
? '- Multi-agent mode: specialist investigators may already have collected a briefing. Trust those facts; only call extra tools for gaps.'
: '',
@@ -36,12 +36,18 @@ export function buildSystemPrompt(ctx = {}) {
'Tool playbook (use these exact tool names and chart ids):',
'- Host health / "what\'s wrong" / diagnose / investigate → investigate_host FIRST (one-shot findings).',
' Lighter alternative: host_snapshot. Do NOT use md.health for general health.',
'- Spikes / unusual activity → hot_metrics, then summarize_chart or compare_chart_windows on top hits.',
'- CPU high / load → investigate_host or host_snapshot + summarize_chart chart=system.cpu + list_processes.',
'- Memory → summarize_chart chart=system.ram (and search_charts q=mem if needed).',
'- Disk / IO / docker / redis / nginx / postgres → search_charts, then summarize_chart on a concrete id.',
'- "Show me a graph/chart/plot" → search_charts if needed, then show_charts with concrete chart ids.',
' show_charts pins to the board, sets window (preset=5m|1h|…), optional mode=line|area|bar|pie, focus.',
' Example: show_charts charts=system.cpu,system.ram preset=15m mode=area boardOnly=true.',
'- Single chart focus → open_chart chart=system.cpu (optional pin, mode, preset, ts).',
'- Pin/unpin board → pin_charts; change type → set_chart_type; window → set_time_window; search wall → filter_charts.',
'- Related wall panel → show_related_ui; Metric Correlations UI → run_correlations.',
'- Spikes / unusual activity → hot_metrics, then show_charts on top hits + summarize_chart.',
'- CPU high / load → investigate_host + show_charts charts=system.cpu,system.load + list_processes.',
'- Memory → show_charts charts=system.ram + summarize_chart chart=system.ram.',
'- Disk / IO / docker / redis / nginx / postgres → search_charts, then show_charts on concrete ids.',
'- Follow-up on one chart → related_charts, get_weights, compare_chart_windows, summarize_charts (batch).',
'- Alerts / anomalies → list_anomalies and/or list_alerts; get_alert for one id.',
'- Alerts / anomalies → list_anomalies and/or list_alerts; get_alert for one id; open_chart with ts on the chart.',
'- Fleet → fleet_health + list_child_peers.',
'- Storage / retention / prune questions → storage_info (+ local_knowledge for product how-to).',
'- Logs → query_logs source=anomaly (or journal/audit when role allows).',
@@ -51,6 +57,7 @@ export function buildSystemPrompt(ctx = {}) {
'- NEVER use chart id "md.health" for general host health — that is MD RAID only and is often empty.',
'- Prefer chart ids that appear in tool results. If summarize_chart returns points=0, try investigate_host or another chart.',
'- After tools return, give a clear human summary with numbers; do not only restate empty charts.',
'- When you show charts, name the chart ids you opened so the operator can find them.',
'',
`Session: agent=${peer} (${conn}), role=${role}${ctx.hostname ? `, host hints may appear in tool results` : ''}${multi ? ', multi-agent=on' : ''}.`,
]
@@ -61,12 +68,12 @@ export function buildSystemPrompt(ctx = {}) {
export const SAMPLE_PROMPTS = [
'Summarize host health right now',
"What's wrong — investigate this host",
'Show me live graphs for CPU and RAM (15m)',
'Plot disk / io charts as an area board',
'Why might CPU be high?',
'Show hot / spiking metrics',
'List charts related to disk or io',
'Show hot / spiking metrics and open them',
'Any open alerts or anomalies?',
'Top processes by CPU if available',
'Run a multi-agent investigation of this host',
'How do Charts time presets work?',
'What is retention / warm history?',
]