HITL Architecture

Human-in-the-Loop — Escalation Infrastructure for Autonomous Agents

This document describes the architecture powering the Human-in-the-Loop (HITL) system — webhook-based approval workflows delivered via Telegram, designed for autonomous agent systems that need human oversight at critical decision points.

System Overview

The HITL system operates as a lightweight middleware layer between autonomous agents and human reviewers. When an agent encounters a decision that exceeds its confidence threshold or requires external authorisation, it sends an escalation request via webhook. The system routes this request to the appropriate human reviewer through Telegram, captures the response, and returns it to the calling agent.

Architecture Diagram

┌──────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Autonomous │────▶│ HITL Middleware │────▶│ Telegram Bot │
│ Agent │ │ (Webhook Router) │ │ (Review UI) │
└──────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ PostgreSQL │ │
│ │ (Audit Log) │ │
│ └──────────────────┘ │
▼ ▼
┌──────────────┐ ┌─────────────────┐
│ Webhook │ │ Human Reviewer │
│ Response │◀─────────────────────────────│ (via Telegram) │
└──────────────┘ └─────────────────┘

Key Components

1. Webhook Receiver

Accepts POST requests from autonomous agents containing escalation payloads. Each request includes: agent ID, confidence score, context data, proposed action, and required reviewer role. Requests are validated against a schema and queued for processing.

2. Routing Engine

Determines which human reviewer should handle each escalation based on:

3. Telegram Integration

Delivers escalation notifications to human reviewers via a dedicated Telegram bot. The bot presents structured approval cards with action buttons (Approve / Reject / Request Info). Reviewers can respond inline without leaving Telegram.

4. Audit Log

All escalations, decisions, and metadata are recorded in PostgreSQL for compliance, debugging, and performance analysis. Each record includes timestamps, reviewer identity, decision rationale, and response latency.

Configuration

The HITL system is configured via environment variables or a hitl.json configuration file:

{
  "telegram_token": "your_bot_token",
  "reviewers": {
    "operations": ["@user1", "@user2"],
    "compliance": ["@user3"]
  },
  "timeout_seconds": 300,
  "fallback_action": "reject",
  "pg_connection": "postgresql://..."
}

Deployment

The HITL middleware can be deployed as a standalone Node.js service or as a serverless function on Vercel. The Telegram bot component runs as a persistent process with webhook polling.

For more details, visit the main HITL product page.

FAQ

What is HITL Architecture?

Hitl Architecture is a practical AI tool from AI Suite built for UK small businesses. This page breaks down what it does, what it costs, and how to use it.

How much does HITL Architecture cost?

Prices start from £49 one-off or £99/month done-for-you, depending on the package. Every paid option carries the 30-day money-back guarantee.

Do I need technical skills to use HITL Architecture?

No. The tools are built to be simple, and the Blueprint Pack includes copy-paste prompts. If you want it handled, the done-for-you plan does everything.

Can HITL Architecture work with my existing setup?

Almost certainly. If you use email, a calendar, a phone, or a website, there's a connection. Unusual cases get custom builds.

What if HITL Architecture doesn't work for me?

You're covered by the 30-day money-back guarantee. Try it for a month. If it doesn't save you time, you get every penny back.

🚀 Want more automation? Browse the store → aisuitehq.org/store

Headline Options

Short, attention-grabbing titles for this topic: