An AI agent loop is a controlled cycle in which an agent plans a task, takes actions through tools, observes the results, evaluates those results against the goal and decides what to do next. For creative production, the loop must also preserve project context, protect accepted work, checkpoint progress and know when a human should approve the result.
A sequence of tool calls is not automatically an agent loop. A reliable loop needs a goal, observable state, evaluation criteria, bounded correction and a clear stopping condition.
The short definition
An AI agent loop is a repeatable plan–act–observe–evaluate cycle that allows an agent to make progress toward a goal, respond to new evidence and continue from a known state until the task is accepted, blocked or safely stopped.
For creative work, the loop should optimize for an accepted deliverable—not the number of generated images or tool calls.
The creative production loop
A practical loop can be described in eight steps.
- Understand the request. Resolve the project, intended deliverable, constraints and approval requirements.
- Plan the work. Break the task into steps and identify required tools, references and dependencies.
- Execute one bounded step. Generate, edit, analyze or export a specific asset.
- Observe the result. Retrieve the actual output and relevant execution state.
- Evaluate against criteria. Check identity, composition, story continuity, text legibility and output specifications.
- Revise selectively. Correct the failed dimension without discarding accepted work.
- Checkpoint and resume. Save completed steps, pending work, source references and retry state.
- Stop or deliver. Finish when the user-defined acceptance criteria are met, or ask for help when the task is ambiguous or blocked.
The loop should not continue indefinitely. It needs a budget, retry limit, timeout behavior and explicit conditions for human review.
What makes a loop reliable
State, not just conversation
The agent needs a structured task state: project ID, current step, accepted artifacts, unresolved issues, dependencies, retry count and next action. A chat transcript can explain what happened, but it should not be the only source of execution truth.
Checkpoints and recovery
Long-running work can be interrupted by network errors, provider timeouts, user edits or process restarts. Checkpoints allow the agent to resume from the last valid state instead of restarting the whole project.
A checkpoint should record which artifacts were accepted, which steps are complete, what failed and whether a retry is safe.
Idempotency and bounded retries
Repeating an action should not accidentally create duplicate charges, duplicate exports or conflicting project versions. Operations that may be retried need idempotency keys or equivalent safeguards.
Retries should be bounded and classified. A transient provider timeout may be retryable; a missing permission or invalid user input usually needs a different response.
Human approval and permissions
Some actions can be automated safely; others need explicit approval. Publishing, spending credits, overwriting an accepted asset or sharing private project data should follow the user's permission and product rules.
Quality gates and stopping conditions
A loop should stop when the output meets the acceptance criteria, when the remaining issue needs human judgment, or when the budget/time limit is reached. Generating another candidate is not always the right next action.
Feedback learning is not the same as changing model weights
An agent can improve its next decision without retraining the underlying model.
Reflexion, for example, explores verbal feedback stored in an episodic memory buffer to help a language agent make better decisions in later trials. This is a useful distinction: feedback can change the context supplied to an agent even when model weights remain unchanged.
For a creative system, feedback may include:
- Explicit user instructions about what was wrong.
- Accepted or rejected generated panels.
- The specific regions the user edited.
- A final exported or published artifact.
- Whether a task was completed, abandoned or handed back to the user.
These signals are not equally strong. “I dislike this face” is an explicit correction. A user regenerating an image may indicate dissatisfaction, but the reason is unknown. A final export is stronger evidence of acceptance, but it does not prove that every element was ideal.
A feedback hierarchy for creative systems
| Signal | What it can support | What it should not imply automatically |
|---|---|---|
| Explicit correction | A task-specific rule or revised fact | A universal preference across every project |
| Accept/reject action | Whether a candidate passed a review step | Why the user accepted or rejected it |
| Edit history | Which attributes or regions changed | That every edit reflects a stable preference |
| Final export | The artifact was selected for delivery | That the system caused a measurable quality gain |
| Repeated behavior across projects | A possible recurring preference | A permanent profile without confirmation |
Feedback should retain its task and project context. If a creator prefers a blue palette for one fantasy series, that should not automatically become a global preference for every project.
From Agent Loop to Creative Intelligence
The larger LlamaGen architecture connects four ideas:
- CyaniModel: controllable visual generation and reference-led creative workflows.
- DeepStory: persistent, source-backed story and project context.
- Agent Loop: continuous task execution, checkpointing and recovery.
- Feedback Learning / RSI: using explicit corrections and accepted outcomes to improve future decisions.
Together, these form LlamaGen's working definition of Creative Intelligence: a system that understands a creative project's context, controls its generation process, carries work through multiple stages and uses feedback to make later work more relevant.
RSI is used here as an internal umbrella label for recursive feedback and improvement. It should not be read as a claim that the system autonomously retrains foundation-model weights or has achieved unrestricted recursive self-improvement.
Measure the result, not the activity
The most useful metric is often time to accepted result: the elapsed time from a task starting to the creator accepting the deliverable.
Other useful measures include:
| Metric | What it reveals |
|---|---|
| Time to accepted result | How quickly the user gets a usable deliverable |
| Revisions per accepted panel | How much correction is required |
| Context reuse rate | Whether relevant project knowledge is reused |
| Workflow reuse rate | Whether proven steps are applied again |
| Task completion rate | Whether projects reach the intended deliverable |
| Recovery success rate | Whether interrupted tasks resume correctly |
| Cost per accepted result | Total generation, inspection and correction cost for accepted work |
A system can reduce generation latency while increasing correction time. It can also lower cost per image while increasing the number of rejected images. Measure the full path to acceptance, not one isolated step.
Example: continue a comic project
Imagine a creator asks an agent to finish the next three pages of an existing comic.
A reliable agent should:
- Retrieve the current story facts and approved character references from Creative Context.
- Read the latest accepted storyboard and identify the next unfinished panels.
- Generate one bounded candidate at a time using the appropriate controllable-generation workflow.
- Inspect each candidate for identity, appearance state, action and layout.
- Ask for approval when the story is ambiguous or the output changes an important canon fact.
- Save accepted panels and checkpoint the project.
- Resume after an interruption without duplicating completed work.
- Prepare the final pages for the intended comic or animation workflow.
The user should be able to see what the agent plans to do, what it has completed, what it needs approval for and why it stopped.
What this means for LlamaGen today
LlamaGen already has a collection of creation and production workflows that can form the task surface for this direction, including AI comic creation, comic-to-video and animation creation.
The full cross-session execution loop, persistent shared memory and feedback-learning system described here should be treated as an architecture direction unless a specific capability is verified in the released product. A roadmap concept is not a shipped feature, and an experiment is not a measured production improvement.
Research references
- Reflexion: Language Agents with Verbal Reinforcement Learning, NeurIPS 2023
- Generative Agents: Interactive Simulacra of Human Behavior, UIST 2023
