Content
# Introduction
chat-a2a is a multi-agent question-and-answer service that supports the a2a protocol. Project features include:
1. A native multi-agent concept designed for the question-and-answer system, distinguishing between gate_agent and agent.
1. The gate_agent is responsible for receiving user questions and distributing them to different agents.
2. Agents answer user questions, which can be in the form of local agents or remote agents.
2. Accessing remote agents based on A2A, used in conjunction with [a2a-runtime](https://github.com/qiankunli/a2a-runtime).
<img src="assets/overview.png" alt="overview"/>
# Features
## Native Multi-Agent Concept
The native multi-agent concept is reflected in:
1. The project defaults to using the plan ==> remote agent ==> plan ==> ... ==> report chain to answer questions.
2. Agent Q&A records are stored directly in the message table, holding the same status as user questions and final answers.
|id|conv_id|task_id|role|type|content|agent|
|---|---|---|---|---|---|---|
|1|conv1|task1|user||What is the weather like?||
|2|conv1|task1|agent|query|What is the weather like?|plan|
|3|conv1|task1|agent|input_required|Which location's weather are you asking about?|weather|
|4|conv1|task1|user||Shanghai||
|5|conv1|task1|agent|query|What is the weather like in Shanghai?|plan|
|6|conv1|task1|agent|answer|The weather in Shanghai is very hot.|weather|
|7|conv1|task1|assistant||The weather in Shanghai is very hot.||
## Handling of Follow-up Questions
Support for follow-up questions is designed as follows:
1. Sub-agents express follow-up questions through input_required, which is also the recommended method by a2a.
2. In the case of follow-up questions, the two inputs from the user belong to the same task_id (a2a concept).
3. Users/front-end and the gate_agent do not perceive whether an agent's output is a follow-up question; instead, they track the agent's execution records based on the message table. This allows the gate_agent to operate more flexibly without introducing mechanisms similar to langgraph checkpoints.
If a user directly inputs a new question in a follow-up scenario, continuing to use the previous task_id may cause issues, and further optimizations will be made.
# Contact Me
The project is still under development, and contributions are welcome.
<img src="assets/wechat-qrcode.jpg" alt="WeChat QR Code" width="350" height="450"/>