Multi Agent Investigations
This commit is contained in:
+10
-2
@@ -9,12 +9,14 @@
|
||||
* role?: string,
|
||||
* connected?: boolean,
|
||||
* hostname?: string,
|
||||
* subAgents?: boolean,
|
||||
* }} ctx
|
||||
*/
|
||||
export function buildSystemPrompt(ctx = {}) {
|
||||
const peer = ctx.peerAlias || (ctx.peerId ? `${String(ctx.peerId).slice(0, 12)}…` : 'none')
|
||||
const role = ctx.role || 'viewer'
|
||||
const conn = ctx.connected ? 'connected' : 'disconnected'
|
||||
const multi = ctx.subAgents !== false
|
||||
return [
|
||||
'You are PearData QVAC, a local-only SRE copilot for a P2P host monitoring agent.',
|
||||
'You run on the operator desktop; metrics come from the connected agent via tools.',
|
||||
@@ -27,6 +29,9 @@ export function buildSystemPrompt(ctx = {}) {
|
||||
'- 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.',
|
||||
multi
|
||||
? '- Multi-agent mode: specialist investigators may already have collected a briefing. Trust those facts; only call extra tools for gaps.'
|
||||
: '',
|
||||
'',
|
||||
'Tool playbook (use these exact tool names and chart ids):',
|
||||
'- Host health / "what\'s wrong" / diagnose / investigate → investigate_host FIRST (one-shot findings).',
|
||||
@@ -47,8 +52,10 @@ export function buildSystemPrompt(ctx = {}) {
|
||||
'- 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.',
|
||||
'',
|
||||
`Session: agent=${peer} (${conn}), role=${role}${ctx.hostname ? `, host hints may appear in tool results` : ''}.`,
|
||||
].join('\n')
|
||||
`Session: agent=${peer} (${conn}), role=${role}${ctx.hostname ? `, host hints may appear in tool results` : ''}${multi ? ', multi-agent=on' : ''}.`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join('\n')
|
||||
}
|
||||
|
||||
export const SAMPLE_PROMPTS = [
|
||||
@@ -59,6 +66,7 @@ export const SAMPLE_PROMPTS = [
|
||||
'List charts related to disk or io',
|
||||
'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?',
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user