Skip to main content
AI tutorials

Build a Stage 1 Drama Series Workflow with Hermes

This tutorial introduces the Hermes drama agent architecture and walks through Stage 1 intake, enrichment, cast-image generation, acceptance gates, schema inspection, and the transition to asynchronous episode production.

Build a Stage 1 Drama Series Workflow with Hermes

What Hermes Does

Hermes is a drama-series agent architecture that organizes story intake, enrichment, asset creation, episode building, runtime events, and production workflows. Its current implementation covers Stage 1 intake and enrichment, Stage 2 JSONL construction and validation, Stage 2 and Stage 3 runtime behavior, event handling, and a Comfy worker integration.

The project is designed around a Streamlit host application with Chat, Assets, and Job panels. A conversation maps to one series_id, while the project stores authoritative series data in projects/{slug}/.

Understand the Stage Model

The repository documents an S1–S7 architecture. Stage 1 handles intake and enrichment: a one-line concept becomes a script and cast images, with explicit acceptance steps. Stage 2 builds asynchronous JSONL work and launches asynchronous Comfy processing. Stage 3 uses an on_episode_complete hook to update runtime state, including support for generating a second episode.

Stages 4 through 7 are part of the same Agent v1 scope. Their detailed architecture is documented in the repository's architecture documentation, while locked implementation decisions are recorded in DECISIONS.md.

Prepare the Repository

Start from the repository root. The README names the project directory drama-series-agent, so enter that directory before running the Stage 1 commands.

cd drama-series-agent

The README does not prescribe a separate dependency-installation command. Use the repository's existing Python environment and project setup before invoking the scripts or importing the packages.

Run the Stage 1 Intake Script

To scaffold a new drama project from a title, run the intake script with the --title option. The following example uses a Chinese title, matching the README:

python scripts/hermes_drama_intake.py --title 我的短剧

This command starts the Stage 1 intake workflow. The project layout then provides dedicated locations for runtime truth, literary content, episode templates, cast data, and skills.

To inspect the JSON schemas used by the system, run:

python scripts/hermes_drama_intake.py --dump-schemas

Schema inspection is useful when integrating tools or validating payloads against the repository's contracts.

Complete the S1-B Enrichment Flow

The README exposes the S1-B workflow through handle_tool_call. Import the dispatcher from drama_series_agent.drama.dispatch:

from drama_series_agent.drama.dispatch import handle_tool_call

After scaffolding the project, execute the operations in this order:

  1. run_literary_generate to generate the literary package from the intake.
  2. accept_literary_package to explicitly accept the generated literary output.
  3. extract_cast_table to derive the cast table.
  4. run_cast_image_generate to generate cast images.
  5. accept_cast_images to accept the generated cast assets.
  6. mark_audio_deferred to record that audio work is deferred.
  7. get_s1_gate_status to check whether the series is ready_for_s2.

The acceptance steps are important: Stage 1 is not merely a chain of generation calls. The literary package and cast images must be accepted before the Stage 1 gate can report readiness for Stage 2.

Use the Project Layout as a Guide

Hermes separates different types of project data into predictable mounts:

  • hermes/architecture/ contains S1-B, S2–S3 sequence documentation, S4–S7 scope, and architectural decisions.
  • hermes/contracts/ contains JSON Schemas and examples.
  • projects/{slug}/ stores L1 truth, including series_runtime.json, intake data, handoff data, and decisions.
  • dramas/{slug}/ is the literary mount.
  • templates/{slug}/ is the HostApp episode mount.
  • data/cast/{slug}/ stores cast and voice data.
  • skills/drama-intake/ contains the Stage 1-A skill.
  • skills/drama-series-develop/ covers project development areas such as outlines, worldbuilding, characters, and visual style.
  • skills/0xsline-short-drama/ provides the literary skill used at runtime by the literary skill.
  • skills/drama-series-h3-r2v-prompts/ provides H3 Ref2VA wiring.

Know the Main Python Packages

The repository divides its Python functionality into focused packages:

  • drama_series_agent.intake handles detection, scaffolding, ingestion, and handoff.
  • drama_series_agent.drama contains JobEvent, SeriesRuntime, EventBus, S1-B enrichment, the S3 hook, and the Comfy worker.
  • drama_series_agent.adapters.r2v provides the MiniMax H3 R2V episode runner and validation.
  • drama_series_agent.utils.skills_paths resolves skill locations.

When extending the workflow, use these package boundaries rather than placing intake, runtime, and adapter logic in one module.

Move from Stage 1 to Production

Once get_s1_gate_status reports ready_for_s2, the series can move toward Stage 2. Stage 2 builds and validates JSONL work and runs asynchronously. The repository also wires the Comfy worker through comfy_worker.enqueue_comfy_episode.

Stage 2 and later processing should communicate progress through runtime events rather than treating the chat as a complete job log. The locked decisions specify that Chat shows milestones, while asynchronous work is handled by the job and event layers.

When an episode finishes, the Stage 3 on_episode_complete hook updates the series runtime. This runtime update supports the next-episode flow, including the intended “generate second episode” behavior.

Practical Integration Tips

  • Keep one conversation associated with one series_id so runtime state remains unambiguous.
  • Inspect the schemas with --dump-schemas before building external integrations.
  • Preserve the explicit acceptance sequence for literary output and cast images.
  • Use the project mounts as the source-of-truth boundaries for runtime, literary, episode, and cast data.
  • Read DECISIONS.md before changing the Streamlit host or workflow boundaries.
  • Use the documented contracts in hermes/contracts/ when producing Job Event or series_runtime payloads.
  • Treat Stage 2 processing as asynchronous and display milestones through the host application's job and chat surfaces.

Conclusion

Hermes provides a structured path from a one-line drama concept to an accepted Stage 1 package and then into asynchronous episode production. Start with the intake script, complete the S1-B generation and acceptance sequence, verify the ready_for_s2 gate, and use the documented contracts and runtime hooks to extend the workflow safely.