Appearance
POST /v1/memory/tools/select
POST /v1/memory/tools/select
Applies policy to candidate tools and persists a provenance decision.
Request schema
Required:
contextcandidates[](min 1)
Common fields:
tenant_id?: stringscope?: stringrun_id?: stringcontext: objectcandidates: string[]include_shadow?: boolean(defaultfalse)rules_limit?: number(default 50, max 200)strict?: boolean(defaulttrue)
Example request
bash
curl -sS "$BASE_URL/v1/memory/tools/select" \
-H 'content-type: application/json' \
-d '{
"tenant_id":"default",
"scope":"support",
"run_id":"run_20260305_001",
"context":{"intent":"billing_support"},
"candidates":["ticket_router","email_sender"],
"strict":true
}' | jqResponse schema
Key response fields:
selection.selectedselection.allowed[]rules.applieddecision.decision_iddecision.decision_uridecision.run_id
Idempotency
- Not idempotent by default.
- Each successful call persists a decision record.
- Avoid blind retries; if you retry, keep
run_idstable and dedupe on your side.
Rate limit
- Uses recall-class limiter and recall tenant quota.
- Back off on
429and5xxonly.
Error codes
Common errors:
invalid_request(400)unauthorized/forbidden(401/403)rate_limited_*(429)
Replay IDs to persist
request_idrun_iddecision.decision_iddecision.decision_urirules.applied.sources[]rule IDs
Operational notes
- Use one
run_idper execution attempt and keep it across decision and feedback. - Persist
decision_idbefore action execution to ensure replay continuity.