6.1 Shared Documents Instead of Messages
[DEMO: Two “agents” alternately update a shared report. The UI shows their message exchange on one side and the evolving document on the other. When you kill one agent mid‑run, the messages stop but the document remains, showing accumulated structure and progress.] You can build a multi‑agent system entirely with messages. A researcher sends bullet points to a writer. The writer sends a draft back. The reviewer sends comments. Each message contains everything the recipient needs at that moment: context, instructions, and some representation of the “current” work. The work itself is not clearly located: it might appear to live in the last message, the union of all prior messages, or a database row that you overwrite on each step. This design choice raises further questions. When components already exchange messages, introducing a shared document raises design questions. If the document holds state, agents may reduce to pure functions over that state. With stateless agents and persistent artifacts, you need to be explicit about where you consider the “intelligence” to reside.Artifacts externalize progress. Messages are transient; artifacts accumulate. When agents modify a shared document, the document captures all progress—if an agent fails, the document remains. Agents become stateless functions that read current state and produce updates. Intelligence is distributed: agents provide reasoning; artifacts provide memory and structure.
report.
status === 'draft' versus status === 'reviewed'). That makes them easier to scale, restart, and reason about.
Third, the “intelligence” you perceive shifts. The model still does the thinking inside each step, but the pattern of steps—the fact that research precedes writing, that only empty sections get filled, that reviewed sections are left alone—is encoded in the artifact’s structure and the operations you define over it.
The illusion of a persistent, thoughtful assistant emerges from this combination. The artifact records past changes, and agents compute the next updates to that state.
6.2 Structure as Coordination: Avoiding Conflicting Writers
[DEMO: A shared task board with two simulated workers. When the board is a simple list, they step on each other—both pick the same task. When the board has columns, WIP limits, and explicit “claim” operations, they naturally distribute work without messaging.] Once you have a shared document, a new problem appears. If multiple agents can edit it, what stops them from colliding? What prevents the researcher from rewriting a section while the writer is mid‑edit? If the artifact is the source of truth, what happens to each agent’s local understanding when the artifact changes under it? At first glance, this suggests you might need locks, leases, or distributed consensus to coordinate updates. Or, more subtly, it suggests having each agent keep its own local view of the document and reconcile later, which puts you back in the world of messaging and conflict resolution. There is also a more philosophical question: if a task board coordinates many workers without explicit messages, is the board itself starting to look like an agent? It certainly constrains behavior and drives decisions. Where do you draw the line?Artifacts coordinate through structure. A task board with columns and WIP limits prevents conflicts by design—only one worker can claim a task. Agents don’t maintain local state; they read current artifact state each time. The artifact isn’t an agent (it doesn’t reason), but it encodes coordination logic: what’s allowed, what’s blocked, what transitions are valid.
- The artifact’s structure encodes that tasks have
statusandassignee. - The artifact’s operations encode the valid transitions: only ready, unassigned tasks can be claimed; only the assignee can complete a task.
- There is no local worker state about “what I own” that needs reconciling. A worker can always re-derive its responsibilities by scanning the board for tasks with
assignee === workerId.
6.3 Designing Artifacts That Capture Workflow
[DEMO: A document builder where you can change the artifact schema on the fly. When the document is a plain string, agents constantly break it. As you add sections, per‑section status, and lifecycle states, the same agents suddenly behave “intelligently” because their actions become constrained and meaningful.] Once you treat artifacts as coordination surfaces, you need criteria for what counts as good artifact design. It is easy to add fields and call it structure. It is harder to encode domain semantics in a way that actually helps your agents. If structure constrains what is representable, you need to understand how that helps rather than limits your system. If operations encode domain semantics, you need to decide what domain knowledge you are actually capturing. If lifecycle states gate which operations are valid, you need to specify who enforces those gates and where that enforcement lives. You can answer “the code enforces it,” but that is too vague. You want a systematic way to go from “how work happens in this domain” to “what the artifact looks like and what you can do with it.”Artifacts encode domain workflow. Structure defines what exists (sections, tasks, findings). Operations define what you can do (addSection, claimTask). Lifecycle defines valid states and transitions (draft → review → final). Good artifact design captures the actual workflow of the domain—agents operate through meaningful actions rather than raw data manipulation.
- Documents have a title and sections.
- Sections have headings, content, and their own status.
- The document itself also has a status, separate from its sections.
- Structure: Sections, section statuses, document status.
- Operations: Add, edit, review, approve, advance lifecycle.
- Lifecycle: Outline → drafting → review → final, with explicit rules at each step.
status === 'empty'), and the artifact’s operations to enforce invariants. If you later change the rules—say, editing a reviewed section requires resetting its status to draft—that logic lives in one place: the artifact.
Good artifact design is similar to modeling a small application. You are deciding:
- Which entities exist (sections, tasks, findings).
- Which actions are meaningful in that domain (approve, escalate, claim, merge).
- Which states the entities can occupy and how they move between them.
6.4 When to Use Artifacts (and When Not To)
[DEMO: A control that lets you switch between “single‑pass generation” and “artifact‑based incremental generation” for creating a multi‑section report. For simple one‑paragraph responses, the single pass wins. For a complex, multi‑section report with review steps, the artifact path produces more coherent, inspectable progress.] With all this structure on the table, you need to decide which parts of your system should be modeled as artifacts. If the artifact captures all progress, what work is left for explicit coordination mechanisms? If the document is the product, why not have a single agent write it in one shot? And if an artifact has structure, operations, and lifecycle, what makes one artifact design better than another? You should not model every piece of state as an artifact.Use artifacts when the output is complex, multi-part, and benefits from incremental progress. A report with sections, a codebase with files, a plan with steps—these naturally fit artifact-centric design. Single-pass generation works for simple outputs; artifacts work for outputs that accumulate through multiple contributions and revisions.
- The output is naturally divided into parts that can be worked on independently (sections, files, tasks).
- Multiple agents, or multiple runs of the same agent, will contribute over time.
- You care about partial results, intermediate states, and auditability.
- You expect the workflow to evolve, and you want the evolution expressed in code, not buried in prompts.
- If the question you are answering fits comfortably in one context window and one sentence like “return X,” use single‑pass generation.
- If you find yourself wishing you could “come back later and keep working on this thing,” you probably want an artifact.