Sequential crew
Run a researcher, a writer and an editor in order, each task seeing the previous output.
Three agents run as a list of tasks. Each task receives the previous task output as its context, and every result is appended to crew-log.md so the whole run can be read afterwards. Only the editor output is printed.
What it maps to
Crew with a sequential process: a list of tasks and a for loop. Task context: the previous output is passed in the prompt. See the concept map.
Script: sequential-crew.lms
# Sequential crew: researcher, writer and editor run in order; each task sees the previous output.
import "agentic.lms";
topic = ARGV.get(0, "why short scripts are easier to review than agent frameworks");
tasks = [
{who: agent("researcher", "collect concrete, checkable points"), todo: f"List 4 short points about: {topic}. One per line."},
{who: agent("writer", "turn points into a clear paragraph"), todo: "Write one paragraph of at most 90 words from these points."},
{who: agent("editor", "tighten prose without dropping points"), todo: "Edit this paragraph. Output only the final paragraph."}
];
context = "";
for (t in tasks) {
context = ask(t.who, t.todo + "\n\n" + context);
append_file("crew-log.md", f"## {t.who.role}\n{context}\n\n");
}
println(context);
It imports the shared helpers from examples/agentic.lms, shown on the recipe index.
Run it
export OLLAMA_API_KEY=...
LLM_MODEL=ollama-cloud/deepseek-v4.1-flash lmscript examples/sequential-crew.lms
Output (offline mock)
The site check runs this recipe against examples/mock-model.lms, a deterministic stand-in for the model, and compares this output.
Short scripts are easy to review: every step is written in order, every model call shows its inputs, no state hides in a framework, and each change is a small diff.
Live run
Recorded on 2026-11-01 with ollama-cloud/deepseek-v4.1-flash. It made 3 model calls and used 1111 tokens. Live replies differ from run to run.
Less code means fewer lines and files to inspect, and explicit control flow eases tracing behavior. Fewer abstractions and dependencies reduce hidden interactions; simpler data flow eases checking edge cases and failures. Together, these qualities make a system easier to understand, review, and debug.
Previous: Triage router · Next: Hierarchical manager
Try it: download examples/sequential-crew.lms and examples/agentic.lms into an examples/ directory, export the key for your provider, then run the command above. Pass a topic as the first argument.