Skip to content

Feature: Engine-Agnostic Human-in-the-Loop (HITL) via Chat Interface #19

@nehmetohmedb

Description

@nehmetohmedb

Summary

Implement Human-in-the-Loop (HITL) functionality through Kasal's existing chat interface, integrating with CrewAI's backend HIL support and providing an engine-agnostic framework for future AI engines.

Current State

  • CrewAI backend has human_input support in Task model
  • Kasal has assistant chat panel for user interaction
  • No integration between CrewAI HIL and chat interface
  • HITL functionality limited to CrewAI engine only

Proposed Solution

Core Features

  • Chat-based Interventions: Human input/approval through chat messages
  • Real-time Prompts: Chat notifications when human input needed
  • Inline Feedback: Approve/reject/modify responses directly in chat
  • Engine-Agnostic Framework: Adapter pattern for future engines
  • Execution Control: Pause/resume workflows via chat commands

Chat Integration

  • Display intervention requests as special chat messages
  • Collect human responses through chat input
  • Show execution status updates in chat timeline
  • Support rich input formats (buttons, forms, file uploads)

Technical Implementation

  • Extend existing chat WebSocket connection for HITL events
  • Create EngineHITLAdapter abstraction for different engines
  • Enhance CrewAI integration to emit chat intervention events
  • Add chat message types for HITL interactions
  • Implement execution pause/resume through chat interface

Key Components

  • HITLChatService: Chat-based intervention handler
  • CrewAIHITLAdapter: Integration with existing CrewAI HIL
  • Chat message extensions for intervention UI
  • WebSocket event handlers for real-time HITL
  • Execution state management for pause/resume

Benefits

  • Leverage existing chat interface familiarity
  • Seamless integration with current user workflow
  • Support for future AI engine integrations
  • Real-time human oversight and control
  • No additional UI complexity

Priority: High

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions