1.7 KiB
1.7 KiB
Skill: agent_tool_execution
Trigger Conditions
Any change involving Gemma-4-E2B agent tools, Exa search, Supabase RAG RPC, or MedGemma escalation.
Rules
1. Tool catalog is authoritative
- Only use:
exa_search,supabase_query,escalate_medgemma. - Never invent tool names in prompts or handlers.
- Bump
TOOL_CATALOG_VERSIONon breaking schema changes.
2. Secrets and egress
EXA_API_KEY,SUPABASE_SERVICE_ROLE_KEY, MedGemma keys: backend only.- Browser calls BFF routes; never
https://api.exa.aidirectly from the client. - PHI-scrub queries before any network egress (
secrets_and_phi_safety).
3. Exa defaults (Pattern 1 — raw retrieval)
{
"type": "auto",
"numResults": 10,
"contents": { "highlights": true }
}
- Canonical reference: https://docs.exa.ai/reference/search-api-guide-for-coding-agents
- Do not use deprecated params (
useAutoprompt, top-levelhighlights,livecrawl: "always"). outputSchemasynthesis is BFF-only enrichment; not the default agent-loop path.
4. Retrieval policy (NFR-18)
supabase_queryfirst for in-corpus MOH guideline grounding.exa_searchfor external/recency queries.- Final clinical answers must cite chunk IDs (Supabase) or URLs (Exa).
5. MedGemma escalation
- Requires consent + audit (NFR-16a) before
escalate_medgemma. - No direct Modal URLs from the browser.
6. MediaPipe agent output
- Parse tool calls from the answer channel when CoT is enabled.
- One block per turn:
<tool_call>OR<final>.