Building a FastA2A Orchestrator with Streaming, Multi-Turn Context, and Framework Integration
- Apr 3
- 8 min read

Purpose
In Assignment 1, you built the core protocol and task-handling pieces. In this assignment, you will extend that foundation into a more realistic system that supports streaming responses, multi-turn conversation continuity, framework integration, observability, and production-minded orchestration. This assignment draws heavily on Chapters 6–7 and asks you to show how FastA2A behaves when it is used as the coordination layer for real application workflows.
Connection to Course Learning Outcomes (CLOs)
CLO | Description | How This Assignment Addresses It |
CLO-4 | Handle streaming and live updates | Tasks 1–2: implement SSE-style event flow and streaming messages |
CLO-5 | Manage context across multiple turns | Tasks 2–3: preserve and extend context over a conversation |
CLO-6 | Integrate FastA2A with other agent frameworks | Task 4: add adapter-style framework integration |
CLO-7 | Observe, trace, and explain system behavior | Tasks 5–6: logging, tracing, and evaluation |
CLO-8 | Design for production constraints | Task 7: recovery, deployment, and architectural discussion |
Learning Objectives
By completing this assignment, you will be able to:
Implement streaming request/response behavior using a structured event flow.
Demonstrate multi-turn conversations that preserve context across messages.
Integrate FastA2A concepts with another agent framework through a clean adapter layer.
Instrument your system with logs, trace events, and useful debug output.
Evaluate workflow behavior across several scenarios, including success and failure paths.
Justify production choices such as storage, deployment, and observability.
Task Description
Duration: 7–10 days from assignment release
Type: Individual Assignment
Difficulty Level: Advanced
You are tasked with building a production-inspired FastA2A orchestration system. The system should support real-time progress updates, multi-turn context, framework adaptation, and a traceable execution model. You may reuse and extend code from Assignment 1.
Task 1: Streaming Response Pipeline (15 Marks)
Implement a streaming workflow that mirrors the course material on Server-Sent Events.
Requirements
Build a streaming event flow that emits updates during execution
Demonstrate the difference between a normal response and a streaming response
Include at least one example of task progress events and one final completion event
Show how events are consumed by a client or notebook cell in order
Explain how streaming improves user experience for long-running tasks
Deliverables
Code, sample streamed output, and a short explanation of the event flow.
Task 2: Multi-Turn Context Continuity (15 Marks)
Show how a conversation can continue across multiple task steps.
Requirements
Preserve a contextId or similar conversation identifier across at least 3 turns
Merge new context data into the existing context using a clear update pattern
Demonstrate context-sensitive behavior in at least 2 agents or handlers
Distinguish between message context and internal agent state
Show what happens when context is missing or invalid
Analysis
Why does a streaming system still need context?
What kinds of data should not be stored in context?
Task 3: Orchestration and Routing (15 Marks)
Create a controller that routes messages through a FastA2A workflow.
Requirements
Implement a router or orchestrator that can dispatch messages to the right handler
Include at least 3 workflow branches: direct dispatch, sequential chaining, and review-based handling
Demonstrate a safety limit such as max_hops or a timeout guard
Show at least one case where the orchestrator chooses a different path based on context or intent
Log each routing decision in a structured trace format
Analysis
What makes an orchestrator different from a simple router?
Why is explicit workflow selection useful in production?
Task 4: Framework Adapter Layer (15 Marks)
Show how FastA2A can sit underneath another agent framework or application style.
Requirements
Build a simple adapter or wrapper that connects FastA2A message flow to another framework style or mocked framework interface
Demonstrate how a framework-backed agent can still obey FastA2A protocol rules
Compare the adapter approach with direct FastA2A-only handling
Keep the adapter layer separate from the core protocol layer
Analysis
Why is an adapter pattern useful here?
What remains stable if the underlying framework changes?
Task 5: Trace, Logging, and Observability (15 Marks)
Add visibility into the system.
Requirements
Export a structured trace log with timestamps, event types, and message metadata
Include at least one error event and one recovery event
Show how logs can be used to reconstruct the workflow
If possible, include a simple diagram, table, or formatted printout of the trace
Explain how logging helps when debugging streaming or multi-turn workflows
Analysis
What information is most valuable in a trace log?
How does observability help separate protocol errors from worker errors?
Task 6: Evaluation of Two or More Scenarios (15 Marks)
Compare your system on multiple input types.
Requirements
Run at least 2 different scenarios such as a simple query and a longer multi-turn workflow
Record differences in output, event count, context growth, and failure handling
Provide a comparison table for the scenarios
Include a short evaluation of what worked best and what was harder to manage
Analysis
Which scenario best demonstrates the strength of FastA2A?
What changed when the workflow became more complex?
Task 7: Production-Oriented Discussion (20 Marks)
Write a final section that connects the assignment to real deployments.
Requirements
Discuss how you would adapt the system for production use
Include considerations such as storage, async execution, service discovery, retries, and deployment
Explain what would be needed to support a larger agent ecosystem
Mention at least one trade-off between notebook-based experimentation and production architecture
Summarise your main learning outcomes from Chapters 6–7
Deliverables
Final notebook section or short report section with clear system-level reasoning.
Bonus (Optional — up to +10 Marks)
+3 Marks: Add a small workflow visualiser for the trace log
+3 Marks: Implement a retry or fallback mechanism for one of the workflow branches
+4 Marks: Add a replay mode that rebuilds a workflow from stored message JSON
Difficulty & Scope
Level | Description |
Basic (50–64%) | Streaming and context examples work, but the system remains simple and lightly analysed. |
Proficient (65–79%) | Orchestration, adapter logic, and trace logging are all present. Scenarios are compared clearly. |
Advanced (80–100%) | The system is modular, well-instrumented, and explained like a production design document. Trade-offs are analysed thoughtfully. |
Marking Rubric
Criteria | Marks | Description |
Streaming Pipeline | 15 | Progress events, ordered updates, final completion |
Multi-Turn Context | 15 | Context continuity, validation, state handling |
Orchestration & Routing | 15 | Workflow selection, branching, safety guard |
Framework Adapter | 15 | Clean integration layer and separation of concerns |
Trace & Observability | 15 | Structured logs, event clarity, reconstruction |
Scenario Comparison | 15 | 2+ workflows, comparison table, evaluation |
Production Discussion | 10 | Deployment and architecture reasoning |
Total | 100 |
Formatting & Structural Requirements
Element | Requirement |
Code | Jupyter Notebook (.ipynb) or a small Python package with notebook demo |
Report | 1500–2000 words, PDF or DOCX |
Font | Times New Roman or Calibri, 12pt body text, 14pt headings |
Spacing | 1.5 line spacing |
Margins | 2.54 cm (1 inch) on all sides |
Heading Structure | H1 for task titles, H2 for sub-sections, H3 for analysis questions |
Page Limit | Report: 4–6 pages (excluding code) |
Citation Style | IEEE format |
Required Sections in Report | (1) System Design & Architecture, (2) Streaming and Context Handling, (3) Orchestration Strategy, (4) Trace & Evaluation Results, (5) Production Considerations, (6) Conclusion & Key Learnings |
Code Quality | Modular, well-commented, PEP 8 compliant, docstrings on classes and key methods |
Permitted Resources & Academic Integrity Policy
Permitted
Course notebooks (Chapters 1–7) and all provided course materials
Python standard library documentation
Official documentation for the libraries used in class
Stack Overflow for syntax-level clarifications only
FastA2A course examples and starter code where provided
Not Permitted
Copying code verbatim from external tutorials, GitHub, or AI-generated solutions without understanding
Sharing code or reports with other students
Replacing FastA2A concepts with a pre-built multi-agent framework unless explicitly approved
AI Use Policy
AI tools may be used for concept clarification and debugging assistance only
All code logic must be your own implementation
Any AI-assisted content must be explicitly declared in the AI-Use Declaration
Declaration Statement
Must be signed and included at the top of your report:
I, [Full Name], Student ID [ID], hereby declare that this submission is entirely my own work unless otherwise referenced and acknowledged. I have not engaged in plagiarism, collusion, or contract cheating. I have declared all AI tool usage below.
AI Tools Used: [List tools, e.g., "ChatGPT for debugging a TypeError" / "None"]
Signature: _________________ Date: _________________
Step-by-Step Submission Instructions on Moodle
Log in to Moodle using your student credentials.
Navigate to "FastA2A — Protocol-Driven Multi-Agent Systems in Python" in your course list.
Click on "Assignment 2: FastA2A Orchestrator" under the Assignments section.
Prepare your submission as a single ZIP file with the following structure:
<YourName>_FastA2A_Assignment2.zip
├── notebook.ipynb OR <package_folder>/
├── report.pdf
├── outputs/
│ ├── trace_logs/
│ └── evaluation_results/
└── README.md (if using package structure)
File Naming Convention: Lastname_Firstname_FastA2A_Assignment2.zip
Click "Add submission" → "Upload a file".
Accepted formats: .zip only (maximum 25 MB).
Click "Save changes" then "Submit assignment" to finalise.
Save the confirmation email as proof of submission.
Deadline: As specified by the instructor (typically 7–10 days from release).
Late Submission Policy
Late By | Penalty |
Up to 24 hours | 10% deduction |
24–48 hours | 20% deduction |
Beyond 48 hours | Not accepted |
Support & Communication Guidelines
Channel | Details |
Office Hours | Tuesdays & Thursdays, 2:00 PM – 4:00 PM |
Forum | Post to the "Assignment 2 Discussion Forum" on Moodle |
Use [FastA2A-A2] in the subject line for Assignment 2 queries | |
Peer Collaboration | Discuss approaches freely. Do NOT share code or reports. |
Technical Issues | If Moodle is unavailable, email your ZIP file before the deadline with subject "[FastA2A-A2] Emergency Submission" |
Frequently Asked Questions
Q1: Can I reuse my code from Assignment 1?
Yes. In fact, you are encouraged to refactor and extend it.
Q2: Do I need to implement real SSE networking?
Not necessarily. A notebook simulation of the event stream is acceptable if it clearly demonstrates the streaming logic.
Q3: What is the most important thing in this assignment?
Showing that you understand how FastA2A supports streaming, context continuity, orchestration, and traceability.
Q4: How detailed should the trace log be?
Detailed enough to reconstruct the workflow and identify where each major event occurred.
Q5: Can I use an existing agent framework for the adapter task?
Only as a wrapper or integration target. The FastA2A protocol layer must still be visible in your own code.
Q6: What if my streaming output arrives out of order?
That should be treated as a bug or a design issue. Your explanation should address how ordering is preserved.
Q7: Do I need to include a diagram?
It is not mandatory, but a simple architecture or trace diagram will strengthen the report.
Q8: What if my evaluation shows different results between scenarios?
That is expected. The point of the experiment is to compare behavior, not to force identical outcomes.
Instructor Note
This assignment is intended to show that FastA2A is not just about messages in isolation. It is about how those messages behave in a larger system. We are looking for:
Clear separation of protocol and execution
Thoughtful handling of streaming and context
Evidence-based comparison of workflow behavior
Production-minded reasoning about observability and deployment
There is no single correct architecture. Justify your choices.
Call to Action
Ready to transform your business with AI-powered intelligence that accelerates insights, enhances decision-making, and unlocks the full value of your data?
Codersarts is here to help you turn complex data workflows into efficient, scalable, and evidence-driven AI systems that empower teams to make smarter, faster, and more confident decisions.
Whether you’re a startup looking to build AI-driven products, an enterprise aiming to optimize operations through data science, or a research organization advancing innovation with intelligent data solutions, we bring the expertise and experience needed to design, develop, and deploy impactful AI systems that drive measurable business outcomes.
Get Started Today
Schedule an AI & Data Science Consultation:
Book a 30-minute discovery call with our AI strategists and data science experts to discuss your challenges, identify high-impact opportunities, and explore how intelligent AI solutions can transform your workflows and performance.
Request a Custom AI Demo:
Experience AI in action with a personalized demonstration built around your business use cases, datasets, operational environment, and decision workflows — showcasing practical value and real-world impact.
Email: contact@codersarts.com
Transform your organization from data accumulation to intelligent decision enablement — accelerating insight generation, improving operational efficiency, and strengthening competitive advantage.
Partner with Codersarts to build scalable AI solutions including RAG systems, predictive analytics platforms, intelligent automation tools, recommendation engines, and custom machine learning models that empower your teams to deliver exceptional results.
Contact us today and take the first step toward next-generation AI and data science capabilities that grow with your business ambitions.



![30+ LangChain & LangGraph Project Ideas to Build in 2026 [Beginner to Advanced]](https://static.wixstatic.com/media/90b6f2_16f0f8bc03de436cb1f668f0a87424dc~mv2.png/v1/fill/w_980,h_552,al_c,q_90,usm_0.66_1.00_0.01,enc_avif,quality_auto/90b6f2_16f0f8bc03de436cb1f668f0a87424dc~mv2.png)
Comments