Designing and Implementing a FastA2A Agent Server with Tasks, Messages, and Discovery
- 5 hours ago
- 9 min read

Purpose
This assignment requires you to build a working multi-agent service using the FastA2A design principles covered in Chapters 1–5. You will implement agent identity, capability metadata, structured messages, tasks, context handling, routing, and a basic request/response workflow that mirrors the FastA2A protocol model. Your solution should demonstrate how a real agent system moves from discovery to execution and then back to the client with a stable, inspectable task lifecycle.
Connection to Course Learning Outcomes (CLOs)
CLO | Description | How This Assignment Addresses It |
CLO-1 | Explain the core ideas behind agent communication | Tasks 1–2: define agents, messages, and protocol vocabulary |
CLO-2 | Build structured request/response workflows | Tasks 2–3: design message objects and task handling |
CLO-3 | Implement discovery and capability matching | Task 3: agent cards, skills, and routing logic |
CLO-4 | Manage task state and conversation context | Tasks 4–5: track tasks, artifacts, and context changes |
CLO-5 | Apply protocol discipline in agent systems | Task 6: standardise the message envelope and validation |
CLO-6 | Debug and reason about server behavior | Task 7: end-to-end workflow, errors, and trace output |
CLO-7 | Connect theory to a working FastA2A implementation | All tasks: notebook cells linked to course chapters |
Learning Objectives
By completing this assignment, you will be able to:
Design a small FastA2A-style agent server using Python classes and clear protocol boundaries.
Construct agent cards, skills, and message objects that make discovery and routing explicit.
Implement basic task lifecycle handling with submitted, working, completed, and failed states.
Demonstrate message context flow across multiple turns using structured dictionaries.
Validate incoming requests and produce meaningful errors for invalid or unroutable messages.
Explain how protocol design improves maintainability, observability, and interoperability.
Task Description
Duration: 7–10 days from assignment release
Type: Individual Assignment
Difficulty Level: Medium → Advanced
You are tasked with building a domain-specific FastA2A application of your choosing. Suitable domains include customer support triage, document analysis, travel planning, study assistant, e-commerce workflow, or research summarisation. Your implementation must use the FastA2A concepts introduced in the notebooks and show a coherent request flow from client message to task result.
Task 1: Agent Identity and Behavior (10 Marks)
Implement a base Agent class and at least 4 specialised agent subclasses.
Requirements
The base Agent must include name, role, and a handle() or receive() method
Each subclass must override the handling method to produce role-specific behavior
Demonstrate polymorphism by iterating through mixed agent types and calling the same method
Include at least one stateful agent that stores a history of handled requests or tasks
Show a small example of the mutable default / shared state pitfall and explain the fix
Deliverables
Notebook code cells, sample output, and a short explanation of your agent hierarchy.
Task 2: Structured FastA2A Messages (10 Marks)
Implement a message model that separates intent, sender, content, and context.
Requirements
Create a Message or A2AMessage class with at least sender, intent, content, and context
Implement repr or to_dict() for clear inspection
Create at least 5 messages with different intents
Demonstrate intent-based dispatch in at least one agent
Implement a validation layer that rejects unknown intents or malformed payloads
Explain why intent, content, and context must remain separate fields
Deliverables
Code, outputs, and a short written analysis.
Task 3: Agent Cards, Skills, and Discovery (15 Marks)
Implement discovery metadata inspired by the FastA2A course.
Requirements
Create an AgentCard structure with name, description, capabilities, and optional provider metadata
Define a Skill representation that maps the agent to one or more capabilities
Build a registry or catalog that can list and search available agents
Demonstrate capability matching for at least 3 distinct intents
Handle overlapping capabilities and explain how the registry resolves them
Analysis
What information belongs in an agent card?
Why does discovery matter before message dispatch?
Task 4: Task Lifecycle and Context Flow (15 Marks)
Add task tracking and context propagation to your system.
Requirements
Implement a Task or task-like record with states: submitted, working, completed, failed, and canceled
Show how a single contextId or equivalent identifier can link multiple interactions
Demonstrate a 3-step context flow where new keys are merged into the existing context
Distinguish task-level state from agent-level state with a concrete example
Include at least one case where the task state changes after validation or execution
Analysis
What should be stored in context, and what should remain outside it?
Why is context continuity important for multi-turn systems?
Task 5: FastA2A Protocol Envelope (15 Marks)
Formalise your request structure into a standardised envelope.
Requirements
Define a message envelope containing sender, receiver, intent, content, and context
Implement receiver verification so messages can be rejected when misrouted
Provide to_json() and from_json() methods or equivalent serialisation helpers
Demonstrate a lossless round-trip by serialising and reconstructing at least one message
Show how the envelope supports clearer debugging than a free-form payload
Analysis
Why is a receiver field useful even when a router exists?
How does a standard envelope help with logging and replay?
Task 6: Server/Worker Interaction (15 Marks)
Demonstrate the separation between request handling and task execution.
Requirements
Model a simple server-facing layer and a worker-facing layer
Show how requests are accepted, stored, and handed to the correct worker or handler
Include at least one example of a worker returning a final artifact or response payload
Demonstrate a safe failure path for invalid or unsupported requests
Include trace output or print logs that show the flow through the system
Analysis
Why is it useful to separate protocol handling from execution logic?
What bugs become easier to diagnose when the layers are distinct?
Task 7: End-to-End Mini Workflow (20 Marks)
Wire all earlier tasks into a complete notebook demonstration.
Requirements
Build a system with at least 4 specialist agents and a simple router or dispatcher
Accept one or more initial messages and carry them through the workflow
Demonstrate task creation, message handling, context growth, and final output
Export a short trace log as JSON or a list of structured dictionaries
Run the pipeline with at least 2 different input scenarios and compare results
Deliverables
Final notebook output, trace log, and a concise explanation of the system design.
Bonus (Optional — up to +10 Marks)
+3 Marks: Add a small visual trace diagram showing how a request moves through the FastA2A pipeline
+3 Marks: Implement an additional agent-card search or capability ranking strategy
+4 Marks: Add a simple replay feature that re-runs serialized messages from a stored JSON file
Difficulty & Scope
Level | Description |
Basic (50–64%) | Agent classes, message structures, and a simple workflow are implemented correctly. Minimal analysis is provided. |
Proficient (65–79%) | All tasks are completed with clear code structure. Discovery, context flow, and serialisation work correctly. Analysis explains trade-offs. |
Advanced (80–100%) | Code is modular and easy to extend. Edge cases are handled cleanly. The notebook reads like a technical walkthrough of a real FastA2A service. |
Marking Rubric
Criteria | Marks | Description |
Agent Identity & Behavior | 10 | Base class, 4+ subclasses, polymorphism, stateful agent |
Structured Messages | 10 | Message model, validation, dispatch, context separation |
Discovery & Skills | 15 | Agent cards, skills, registry, capability matching |
Task Lifecycle & Context | 15 | Task states, context flow, state distinction |
Protocol Envelope | 15 | Envelope fields, serialisation, receiver verification |
Server/Worker Interaction | 15 | Layer separation, safe execution, error handling |
End-to-End Workflow | 20 | Router, trace log, multiple scenarios, coherent output |
Total | 100 |
Formatting & Structural Requirements
Element | Requirement |
Code | Jupyter Notebook (.ipynb) with clear markdown sections for each task |
Report | 4–6 pages, 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 prompts |
Page Limit | Report: 4–6 pages (excluding code). Notebook: no page limit |
Citation Style | IEEE format |
Required Sections in Report | (1) Introduction, (2) System Architecture Overview, (3) Per-Task Approach & Observations, (4) Design Decisions & Trade-offs, (5) Conclusion & Key Learnings |
Code Quality | Well-commented, PEP 8 compliant, docstrings on classes and key methods |
Permitted Resources & Academic Integrity Policy
Permitted
Course notebooks (Chapters 1–5) and all provided course materials
Python standard library documentation
Official Python OOP documentation
Stack Overflow for syntax-level clarifications only
FastA2A framework code and course examples provided in class
Not Permitted
Copying code verbatim from external tutorials, GitHub, or AI-generated solutions without understanding
Sharing code or reports with other students
Using external multi-agent frameworks as a substitute for FastA2A concepts unless explicitly approved
AI Use Policy
AI tools (ChatGPT, GitHub Copilot, etc.) 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 1: FastA2A Agent Server" under the Assignments section.
Prepare your submission as a single ZIP file with the following structure:
<YourName>_FastA2A_Assignment1.zip
├── notebook.ipynb (Jupyter Notebook with all code and outputs)
├── report.pdf (or report.docx)
└── outputs/ (optional folder)
├── sample_outputs.txt
└── trace_log.json
File Naming Convention: Lastname_Firstname_FastA2A_Assignment1.zip
Click "Add submission" → "Upload a file" → drag and drop your ZIP file.
Accepted file formats: .zip only (maximum 25 MB).
Click "Save changes" — verify your file appears in the submission area.
IMPORTANT: Click "Submit assignment" to finalise. A draft is NOT a submission.
Save the confirmation email as proof of submission.
Deadline: Submit within 10 days from assignment release date.
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 (Preferred) | Post general questions to the "Assignment 1 Discussion Forum" on Moodle |
Use your institutional email and include [FastA2A-A1] in the subject line | |
Response Times | Forum: 24 hours on weekdays. Email: 48 hours. No responses on weekends/holidays. |
Peer Collaboration | Discuss concepts and approaches with classmates, but do NOT share code or report text |
Technical Issues | If Moodle is unavailable, email your ZIP file before the deadline with subject "[FastA2A-A1] Emergency Submission" |
Frequently Asked Questions
Q1: Can I choose my own domain scenario?
Yes. Choose a scenario that makes the FastA2A concepts easy to demonstrate. Good options are support triage, research summarisation, itinerary planning, or document processing.
Q2: Do I need to build a full networked server?
Not necessarily. A notebook-based simulation is acceptable if it clearly demonstrates the protocol flow, task handling, and agent behavior.
Q3: What is the most important part of Task 3?
Discovery and capability matching. The point is to show how an agent can be found because of what it can do, not because its name was hardcoded.
Q4: How much context is enough for Task 4?
Enough to show meaningful state flow across at least three steps. Add only the data you need to explain the workflow clearly.
Q5: Does my code need to use the exact FastA2A notebook structure?
No, but your notebook should follow the course logic and clearly separate concepts into task-based sections.
Q6: What if my workflow fails on an invalid request?
That is acceptable if you handle the failure cleanly and explain why it happened. Graceful failure is part of the assignment.
Q7: Can I include extra features?
Yes. Bonus features are welcome, but they do not replace the core requirements.
Q8: What counts as a valid trace log?
Any structured list or JSON output that records the flow of requests, task states, agent actions, and errors.
Instructor Note
This assignment is designed to test whether you understand the FastA2A model as a system, not just as a set of isolated notebook examples. There is no single correct domain. What matters is:
Clarity of reasoning — Can you explain why your design choices fit the FastA2A model?
Quality of implementation — Is your code modular, readable, and easy to extend?
Depth of analysis — Do you understand tasks, messages, discovery, context, and protocol flow?
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.



Comments