Ralph Component
Most users should use
<SmithersProvider> instead. SmithersProvider is the canonical orchestrator that handles Ralph internally along with database, state management, and lifecycle concerns. Use <Ralph> only for legacy compatibility or when you specifically need the <ralph> element in serialized output.<Ralph> component is the internal loop controller that powers Smithers workflows. It manages iteration count and task tracking for workflows that need to loop until completion. SmithersProvider wraps Ralph automatically—this page documents Ralph for advanced users who need direct access.
Minimum Viable Ralph
The simplest possible orchestration is just<Ralph> with a <Claude> inside:
<Claude> component handles the LLM call and tool execution internally.
Basic Usage
Accessing Iteration Count
You can access the current iteration count via context:Props
Deprecated on
<Ralph>. Configure maxIterations on <SmithersProvider> instead.Deprecated on
<Ralph>. Use <SmithersProvider onIteration> instead.Deprecated on
<Ralph>. Use <SmithersProvider onComplete> instead.Called when max iterations is reached without completion. Useful for handling timeout scenarios.