Skip to main content
Lesson 8 of 14 · Multi-Agent Research

Verbose streaming and encrypted content

Lesson 8 of 14 Updated July 29, 2026 Developer
On this page
  1. Following agent work in real time
  2. What standard streaming shows
  3. Opening the box with verbose_streaming
  4. Encrypted content is not a window; it’s memory
  5. Key takeaways

Following agent work in real time

A multi-agent request takes time, and the more agents you launch, the longer it takes: with 16 agents running on a broad topic, the wait runs into tens of seconds. Meanwhile, your application knows nothing about what is happening, and your user is staring at a frozen screen. Two mechanisms address this problem, but they do not do the same job at all: verbose streaming opens a window into agent activity during inference, while encrypted content preserves their state from one conversation turn to the next. Confusing the two leads you to enable the wrong parameter and waste tokens.

What standard streaming shows

With standard streaming, you receive the leader’s final text as it is generated, and nothing else.

chat = client.chat.create(
    model="grok-4.20-multi-agent-0309",
    agent_count=4,
)
chat.append(user("My question"))

for response, chunk in chat.stream():
    if chunk.content:
        print(chunk.content, end="", flush=True)

That is perfectly sufficient for most integrations: you display the answer word by word, the user sees something appear, and you’re done. The blind spot is upstream. As long as the sub-agents are searching and the leader has not started its synthesis, the stream stays empty, and you have no way to tell a search in progress from a stalled request.

Opening the box with verbose_streaming

Just add verbose_streaming to the include parameter, and tool calls also come through the stream as they happen.

from xai_sdk.tools import web_search, x_search

chat = client.chat.create(
    model="grok-4.20-multi-agent-0309",
    agent_count=16,
    tools=[web_search(), x_search()],
    include=["verbose_streaming"],
)

chat.append(user("Analyze reactions to Apple's latest announcements"))

for response, chunk in chat.stream():
    if chunk.content:
        print(chunk.content, end="", flush=True)
    # Tool calls are also visible in real time

You then see web searches go out, results come back, and the leader begin writing. Three uses follow directly from this. For debugging, you check that the agents are searching in the expected direction: if your question is about public reactions and every query targets spec sheets, your prompt is the problem, not the model. For the user experience, these events feed an honest progress indicator—“searching for sources,” “analyzing results”—instead of a generic spinner. Finally, for monitoring, you can understand after the fact why a request took a minute, because you know how many searches were launched.

Encrypted content is not a window; it’s memory

use_encrypted_content answers a different question. It does not expose any reasoning in plain text: it lets the model keep the agents’ internal state between turns in the same conversation.

chat = client.chat.create(
    model="grok-4.20-multi-agent-0309",
    agent_count=4,
    use_encrypted_content=True,
)

When this parameter is active, the response includes an encrypted block containing the sub-agents’ state: the results of their searches and the context they have accumulated. On the next message, this block is passed back automatically, and the model starts from what has already been found instead of recalculating everything. You cannot read it—it is meant for the model, not for your application log.

The decision to enable it comes down to a simple criterion: will you ask several related questions? A session where you first ask for an overview and then a deeper dive on the third point gets a clear benefit, as does a long investigation where the context from previous turns is the whole point. Conversely, for an isolated question that calls for one answer and nothing more, the encrypted block is just overhead: it adds tokens on every turn, billed like all the rest.

Nothing stops you from combining the two mechanisms—in fact, that is the natural setup for an interactive research assistant: you follow activity live, and context survives from one turn to the next.

chat = client.chat.create(
    model="grok-4.20-multi-agent-0309",
    agent_count=16,
    tools=[web_search(), x_search()],
    include=["verbose_streaming"],
    use_encrypted_content=True,
)

Key takeaways

  • verbose_streaming reveals tool calls in real time (debugging, UX, monitoring)
  • use_encrypted_content preserves sub-agent state between conversation turns
  • Encrypted content is not readable—it serves the model, not you
  • Combine both for interactive research sessions
  • Enable encrypted content only if you expect multi-turn conversations