Skip to content

Streaming Tool Execution Progress (to user) for Long-Running Tool Jobs (Factual/Storm Agents) #45

@vishnudev-k

Description

@vishnudev-k

Feature Type

New functionality

Problem Statement

We need a way to show the progress of long-running jobs to the user.
When we are running tasks over FastAPI/MCP. We need to implement a polling mechanism to update the graph with current status messages without a heavy overhead to the main thread.

Proposed Solution

Langgraph can stream the tool status with the help of stream_writer
But this flow is suitable for tools that run within the current agent.

from langgraph.config import get_stream_writer
writer = get_stream_writer()
writer(f"Progress : {prog_percent}%")

MCP servers offer a way to provide a status update using context.

await ctx.info(f"Progress : {prog_percent}%")

But this implementation doesn't support langgraph tools using MultiServerMCPClient (Still checking)

Alternative Solutions

We can also think about using message queues, which can also handle the server overload.

User Benefits

No response

Implementation Ideas

No response

Contribution

  • I'm willing to submit a PR for this feature
  • I'm willing to test this feature
  • I'm willing to help document this feature

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions