Skip to main content
This example shows how to implement Human-in-the-Loop (HITL) flows in AgentOS. When an agent needs to execute a tool that requires confirmation, the run pauses and waits for user approval before proceeding.

Prerequisites

  • Python 3.10 or higher
  • PostgreSQL with pgvector (setup instructions below)
  • OpenAI API key

Code

hitl_confirmation.py

Testing the Example

Once the server is running, test the HITL flow:

Usage

1

Set up your virtual environment

2

Set Environment Variables

3

Install dependencies

4

Setup PostgreSQL Database

5

Run Example

Learn More

HITL Getting Started

Learn HITL basics with a simple example

HITL Concepts

Understand HITL patterns and best practices