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: objectexecution_state_v1?: object(resume continuity state)execution_result_summary?: object(recovered execution summary)execution_artifacts?: object[](recovered execution side outputs)execution_evidence?: object[](recovered execution evidence)candidates: 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[]execution_kernelrules.applieddecision.decision_iddecision.decision_uridecision.run_idselection_summary
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. - When resuming from recovered handoff continuity, pass
execution_state_v1and optionallycontext.control_profile_v1so selection runs under the recovered execution posture. - If the recovered payload already carries
execution_artifactsorexecution_evidence, pass them through so policy selection can see the same continuity side outputs as context assembly.