Skip to main content
Pause deep research at key decision points so a human can review and guide the agent.
For the conceptual overview, checkpoint shapes, and lifecycle, see the HITL Guide. This page is the TypeScript SDK reference.
HITL is only available for individual deep research tasks, not for batch requests.

Add human-in-the-loop checkpoints to a Valyu DeepResearch task with the TypeScript SDK.

Open in Cursor

Quick start

Enable checkpoints with a hitl object, then let wait() drive them through an onInteraction callback. Return a response to auto-respond, or null to skip and keep polling:

Checkpoints

Checkpoints fire in order; only enabled ones fire.

Reference

If you’d rather drive the loop yourself, poll status() and respond when status.status is awaiting_input or paused:
respond() returns DeepResearchRespondResponse with success, status ("running" or "queued"), deepresearch_id, error.
Each checkpoint expects a specific response object:
After checkpoints complete, status.hitl_history records each interaction (type, auto_continued, created_at, responded_at, response):