Skip to content

feat: Add hitl docs#10885

Open
sjrl wants to merge 4 commits intomainfrom
add-hitl-docs
Open

feat: Add hitl docs#10885
sjrl wants to merge 4 commits intomainfrom
add-hitl-docs

Conversation

@sjrl
Copy link
Contributor

@sjrl sjrl commented Mar 20, 2026

Related Issues

Proposed Changes:

  • Once all changes are made will copy over to previous versions of docs (HITL added in 2.23)

Adds docs page for human in the loop

How did you test it?

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@vercel
Copy link

vercel bot commented Mar 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
haystack-docs Ready Ready Preview, Comment Mar 20, 2026 10:41am

Request Review

Comment on lines +214 to +224
## Example: HITL with Hayhooks and Open WebUI

The [hitl-hayhooks-redis-openwebui](https://github.com/deepset-ai/hitl-hayhooks-redis-openwebui) repository shows a full production-style HITL setup using a Haystack Agent served via [Hayhooks](https://github.com/deepset-ai/hayhooks) with approval dialogs rendered in [Open WebUI](https://openwebui.com/).

The key pattern it demonstrates is a custom `RedisConfirmationStrategy` that uses `confirmation_strategy_context` to pass per-request resources - a Redis client and an async event queue - into the strategy at runtime:

- When a tool call is about to execute, the strategy emits a `tool_call_start` SSE event and blocks on `Redis BLPOP` waiting for an approval decision.
- The Open WebUI Pipe function receives the SSE event, shows the user a confirmation dialog, then writes `approved` or `rejected` to Redis via `LPUSH`.
- Once Redis unblocks, the strategy returns a `ToolExecutionDecision` and the agent continues.

This is a good reference if you need non-blocking HITL in a web or server environment where `SimpleConsoleUI` and `RichConsoleUI` are not suitable.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mpangrazzi could I ask you double check this section? This is what I could understand from your Readme but I'd like to make sure this info is correct :)

@sjrl sjrl marked this pull request as ready for review March 20, 2026 10:39
@sjrl sjrl requested a review from a team as a code owner March 20, 2026 10:39
@sjrl sjrl requested review from anakin87, bilgeyucel and kacperlukawski and removed request for a team March 20, 2026 10:39
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add docs page for Human in the Loop abstractions

2 participants