Skip to content

Added a streams demo that runs the agent loop on a provider. - #31

Open
moedash wants to merge 2 commits into
moe/AI-198-if-py-5-accessorsfrom
moe/AI-198-if-py-6-demo
Open

moedash wants to merge 2 commits into
moe/AI-198-if-py-5-accessorsfrom
moe/AI-198-if-py-6-demo

Conversation

@moedash

@moedash moedash commented Oct 3, 2026

Copy link
Copy Markdown
Owner

This PR adds streams_demo, a small agent loop that runs unchanged on any stream provider.

What changed?

  • streams_demo/agent_loop.py holds the workflow and activity. The workflow reads inputs, decides, publishes, and runs an activity that appends receipts to the workflow's stream.
  • streams_demo/run_demo.py drives three cases: the loop with the smallest cache the provider supports, a producer whose second attempt supersedes its first, and an outside reader following what the workflow published.
  • streams_demo/provider_setup.py is the one file that names a provider. Here it's MemoryStreams.
  • pyproject.toml adds the directory to pyright's include.

Part of AI-198 (epic AI-37).

Why?

It shows the interface's main promise in a form you can run: the same workflow, activity and client code on any store. Each provider PR only has to change provider_setup.py to show it works the same way. It's a sample, not library code, so it gets its own PR.

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

poe lint is clean, pyright included. I ran python streams_demo/run_demo.py against a local Temporal server. All three cases finished, and the activity's receipts showed up on the workflow's stream.

One agent loop, read, decide, publish and an activity, that runs unchanged on every provider, so a provider branch only swaps provider_setup.
run_demo.py writes its results next to the script, and one run's output was committed with the sample. Ignored so a later run can't add it again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Changelog entry rides another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant