Skip to content

LLM Agents (core/)

The core/ package is a multi-agent "writers' room" that generates scene ideas. It is the project's pre-production brain — separate from the rendering DSL.

Reviewed, not executed

This half depends on sceneprogllm, which isn't installed in either Python here, so it couldn't be run. The description below is from code review.

The pieces

File Role
core/msg.py Message + Transcript — history; a summarizer LLM keeps a one-line "discussion state"
core/rag.py RAG — embeds per-role examples (rag/<role>.json), cosine-similarity retrieval, caches *_embeddings.npz
core/agent.py Agent base + role agents; each = a sceneprogllm.LLM (JSON mode) + a RAG
core/roles.py the system prompts for each role

The roundtable

Five role agents share one Transcript:

ScriptWriter · StoryBoarder · SetManager · Editor · Director

Each agent's __call__("roundtable") builds a prompt from retrieved examples + the discussion state, calls its LLM, and appends the response. Two are special:

  • StoryBoarder splits its response into beats + an image prompt, then calls OpenAI image generation (gpt-image-2) and writes tmp/storyboard.png.
  • SetManager injects a summary of the available sets into its prompt.
from core.agent import ScriptWriter, StoryBoarder, SetManager, Editor, Director
from core.msg import Message, Transcript

transcript = Transcript()
transcript.add_message(Message(Agent="User", Text="Create a story about …"))

for Role in (ScriptWriter, StoryBoarder, SetManager, Editor, Director):
    Role(transcript)("roundtable")

It produces text + a storyboard, not DSL code

The roundtable outputs discussion and a storyboard image — wiring its output into runnable dsl/ scene scripts is not yet automated.

To run it later

  1. Install sceneprogllm (+ openai, numpy) into your Python.
  2. Set OPENAI_API_KEY.
  3. Remove the leftover breakpoint() calls in test3.py and StoryBoarder (Issue #5).
  4. The SetManager hardcoded path is already fixed (Issue #3).