Zing 论坛

正文

Hypocaust:面向长时运行智能代理工作流的后端编排系统

Hypocaust 是一个基于 Java 和 Spring Boot 开发的智能代理工作流编排系统,采用事件溯源架构、事务性发件箱模式和语义工具发现机制,支持将自然语言任务转换为版本化产物(图像、音频、视频、脚本等),并提供实时 SSE 流更新和选择性重运行能力。

HypocaustAI代理工作流编排事件溯源JavaSpring Boot智能代理SSE产物管理语义工具发现
发布时间 2026/04/02 01:14最近活动 2026/04/02 01:22预计阅读 7 分钟
Hypocaust:面向长时运行智能代理工作流的后端编排系统
1

章节 01

Hypocaust: Core Overview

Hypocaust: Core Overview

Hypocaust is an open-source backend system developed by lukeashford, built with Java 21 and Spring Boot. It orchestrates long-running AI agent workflows, addressing key challenges like reliability, real-time feedback, and efficient iteration. Key features include:

  • Event sourcing for state consistency
  • Transactional outbox for distributed system reliability
  • Semantic tool discovery
  • Real-time SSE updates
  • Versioned artifact management and selective partial re-run

Its goal is to provide a robust infrastructure for production-grade AI agent applications.

2

章节 02

Background & Problem Statement

Background & Problem Statement

As AI agent applications grow, orchestrating long-running workflows (minutes or longer) presents critical challenges:

  • Ensuring asynchronous execution and state consistency after crashes
  • Providing real-time progress feedback to users
  • Integrating diverse AI/deterministic tools flexibly
  • Managing versioned artifacts (images, audio, videos) and efficient iterations

Hypocaust is tailored to tackle these issues.

3

章节 03

Architecture & Design Patterns

Core Architecture & Design

Event Sourcing

  • Append-only event storage for all state changes
  • Enables audit trails, time travel, and fault recovery

Transactional Outbox

  • Solves double-write problem (atomic DB updates + message publishing)
  • Uses bigserial for event order

SSE Real-Time Updates

  • Pushes progress via Server-Sent Events
  • Supports gapless reconnection with Last-Event-ID

Artifact Lifecycle

  • State machine: GESTATINGMANIFESTED (or FAILED/CANCELLED)
  • Version chain via supersedes_id

Bounded Executor

  • Prevents web thread blocking, handles concurrent long tasks

Technology Stack

  • Backend: Java21 + Spring Boot
  • DB: PostgreSQL
  • Containerization: Podman (Postgres, pgAdmin, FFmpeg sidecar)
  • Media: FFmpeg sidecar

API Design

  • REST endpoints: POST /tasks (submit), GET /task-executions/{id}/events (SSE)
  • OpenAPI docs (/v3/api-docs) and Swagger UI

Quick Start

  • Requirements: Java21, Podman, OpenAI/Anthropic keys
  • Commands: ./gradlew pods-create (start dependencies), ./gradlew bootRun (run app)

Project Status

  • Active development, FFmpeg decomposer integration in progress
4

章节 04

Workflow Execution Model

Workflow Execution

Plan-Clarify-Execute

  1. Plan: Analyze task, split into sub-tasks
  2. Clarify: Ask user for missing info
  3. Execute: Generate artifacts

Decomposer Pattern

  • Split complex tasks into independent sub-tasks
  • Each sub-task can retry/recover separately

Selective Partial Re-run

  • Only re-run affected sub-tasks when requirements change
  • Improves iteration efficiency for creative workflows
5

章节 05

Tool System & Semantic Discovery

Tool System

SemanticSearchToolRegistry

  • Embeds tool descriptions, uses vector similarity to find best tools

Core Tools

  1. generate_creative: AI-based, uses RAG for model selection, fallback on failure
  2. ffmpeg_process: Deterministic media tool, LLM constructs API requests from OpenAPI schema

Tool Lifecycle

  • Follows AbstractArtifactTool for consistent, observable calls
6

章节 06

Application Scenarios & Value

Application Scenarios

Creative Content Generation

  • Multimedia stories, marketing materials, personalized content

Intelligent Workflow Automation

  • Data pipelines, document generation, media processing chains

Research & Experiment Platforms

  • AI experiment management, A/B testing, collaborative creation

Comparison with Others

Feature Hypocaust LangChain Temporal
Event Sourcing ❌ (custom)
Artifact Management ❌ (custom) ❌ (custom)
Semantic Tool Discovery
SSE Real-Time ❌ (custom) ❌ (custom)
AI Native
7

章节 07

Conclusion & Future Outlook

Conclusion & Future

Hypocaust is a specialized infrastructure for long-running AI workflows, focusing on reliability, real-time feedback, and efficiency. It solves critical production pain points, letting developers focus on business logic.

As AI agents move to production, systems like Hypocaust will be essential for ensuring scalability and reliability. The project is actively developing, with FFmpeg decomposer integration ongoing.