Content
# Agent Framework Aspire - Multi-Agent Microservices System
[](http://www.wtfpl.net/about/)
[](https://dotnet.microsoft.com/)
[](https://learn.microsoft.com/dotnet/aspire/)
A multi-agent microservices system built on .NET Aspire, Microsoft Agent Framework, A2A, and MCP protocols.
## 📖 Table of Contents
- [Project Background](#project-background)
- [Project Goals](#project-goals)
- [Architecture Design](#architecture-design)
- [Technology Stack](#technology-stack)
- [Project Structure](#project-structure)
- [Service Descriptions](#service-descriptions)
- [Quick Start](#quick-start)
- [Configuration Instructions](#configuration-instructions)
- [Development Guide](#development-guide)
- [License](#license)
## 🌟 Project Background
In modern enterprise environments, project management involves collaboration across multiple professional domains, including technical assessments, human resource allocation, financial budget control, quality risk management, and project scheduling. Traditional monolithic agent systems face the following issues:
### Pain Points of Traditional Solutions
1. **Conflict between Generality and Specialization**
- A single AI assistant struggles to possess deep expertise across multiple domains.
- General models lack a deep understanding of enterprise-specific fields.
2. **Difficulties in Maintenance and Updates**
- Any departmental knowledge update requires retraining the entire model.
- Permission control and data isolation are hard to implement.
3. **Misalignment with Organizational Structure**
- Contradicts the actual division of labor and collaboration patterns within enterprises.
- Responsibilities are unclear, making errors difficult to trace.
### Our Solution
Based on the application of **Conway's Law** in the AI era, this project proposes a **Multi-Agent Microservices Architecture**:
> "The architecture of a system should reflect the communication structure of the organization."
Each professional team maintains its own agent service, achieving:
- ✅ **Specialized Division of Labor**: Each agent focuses on a specific domain.
- ✅ **Standardized Communication**: Using MCP and A2A protocols for cross-service collaboration.
- ✅ **Independent Evolution**: Teams can independently iterate on their services.
- ✅ **Clear Responsibilities**: Issues can be traced back to specific domains.
## 🎯 Project Goals
1. **Reduce Integration Costs**: Based on standard protocols (MCP + A2A), reduce the complexity of system integration across teams.
2. **Increase Specialization**: Teams focus on their own domains, providing more specialized services.
3. **Enhance System Resilience**: Microservices architecture offers better fault tolerance and scalability.
4. **Facilitate Team Collaboration**: Promote cross-team collaboration through standardized interfaces.
5. **Provide Reference Implementations**: Offer complete example code for enterprises to build similar systems.
## 🏗️ Architecture Design
### Overall Architecture
```mermaid
graph TB
subgraph "User Interaction Layer"
User[👤 User/Client<br/>Blazor Web UI]
end
subgraph "Intelligent Orchestration Layer"
PM[🎯 Project Manager Agent<br/>ProjectManagerAgent<br/>━━━━━━━━━━━<br/>Unified Coordination and Decision Making<br/>3-Stage Workflow Orchestration]
end
subgraph "Specialized Service Layer - Parallel Analysis"
Tech[💻 Technical Team Service<br/>Tech Agent<br/>━━━━━━━━━━━<br/>MCP Tools + A2A Endpoints]
HR[👥 HR Team Service<br/>HR Agent<br/>━━━━━━━━━━━<br/>MCP Tools + A2A Endpoints]
Finance[💰 Finance Team Service<br/>Finance Agent<br/>━━━━━━━━━━━<br/>MCP Tools + A2A Endpoints]
QA[🔍 QA Team Service<br/>QA Agent<br/>━━━━━━━━━━━<br/>MCP Tools + A2A Endpoints<br/>Internal 4-Stage Workflow]
end
subgraph "Specialized Service Layer - Planning Integration"
PMO[📅 PMO Team Service<br/>PMO Agent<br/>━━━━━━━━━━━<br/>MCP Tools + A2A Endpoints<br/>Internal 4-Stage Workflow]
end
subgraph "Infrastructure Layer"
Aspire[.NET Aspire<br/>Service Orchestration & Configuration Management]
MCP[MCP Protocol Layer<br/>Tools and Resource Access]
A2A[A2A Protocol Layer<br/>Agent-to-Agent Communication]
AF[Agent Framework<br/>Workflow Orchestration Engine]
end
User --> PM
PM -->|Stage 1: Parallel Analysis| Tech
PM -->|Stage 1: Parallel Analysis| HR
PM -->|Stage 1: Parallel Analysis| Finance
PM -->|Stage 1: Parallel Analysis| QA
PM -->|Stage 2: Planning Integration| PMO
PM -.->|Stage 3: Final Decision| PM
Tech --> MCP
HR --> MCP
Finance --> MCP
QA --> MCP
PMO --> MCP
PM --> A2A
Tech --> A2A
HR --> A2A
Finance --> A2A
QA --> A2A
PMO --> A2A
QA --> AF
PMO --> AF
PM --> AF
Aspire -.->|Orchestration| PM
Aspire -.->|Orchestration| Tech
Aspire -.->|Orchestration| HR
Aspire -.->|Orchestration| Finance
Aspire -.->|Orchestration| QA
Aspire -.->|Orchestration| PMO
style User fill:#e1f5ff,stroke:#333,stroke-width:2px
style PM fill:#fff3cd,stroke:#333,stroke-width:3px
style Tech fill:#d4edda,stroke:#333,stroke-width:2px
style HR fill:#d4edda,stroke:#333,stroke-width:2px
style Finance fill:#d4edda,stroke:#333,stroke-width:2px
style QA fill:#d4edda,stroke:#333,stroke-width:2px
style PMO fill:#cce5ff,stroke:#333,stroke-width:2px
style Aspire fill:#f8d7da,stroke:#333,stroke-width:2px
style MCP fill:#e2e3e5,stroke:#333,stroke-width:1px
style A2A fill:#e2e3e5,stroke:#333,stroke-width:1px
style AF fill:#e2e3e5,stroke:#333,stroke-width:1px
```
### Workflow Design
The Project Manager Agent uses a 3-stage workflow orchestration:
```mermaid
sequenceDiagram
participant User as User
participant PM as Project Manager Agent
participant Tech as Technical Team
participant HR as HR Team
participant Finance as Finance Team
participant QA as QA Team
participant PMO as PMO Team
User->>PM: Submit project requirements
Note over PM: Stage 1: Parallel Analysis Stage
par Parallel Calls
PM->>Tech: A2A Call: Technical Requirement Analysis
Tech-->>PM: Technical Assessment Report
and
PM->>HR: A2A Call: Human Resource Assessment
HR-->>PM: Resource Analysis Report
and
PM->>Finance: A2A Call: Budget Analysis
Finance-->>PM: Financial Assessment Report
and
PM->>QA: A2A Call: Risk Analysis
QA-->>PM: Risk Assessment Report
end
Note over PM: Stage 2: Detailed Planning Stage
PM->>PMO: A2A Call: Planning based on Preliminary Analysis
Note over PMO: Internal Workflow:<br/>Task Decomposition → Dependency Analysis<br/>→ Resource Matching → Time Optimization
PMO-->>PM: Detailed Project Plan
Note over PM: Stage 3: Integration Decision Stage
PM->>PM: Integrate all analysis results<br/>Generate final decision
PM-->>User: Complete project plan and recommendations
```
### Agent Layered Architecture
The system adopts a four-layer agent architecture design:
```mermaid
graph TD
subgraph "Layer 4: Orchestration Agent Layer"
L4[Project Manager Agent<br/>━━━━━━━━━━━<br/>Cross-Team Coordination<br/>Complex Workflow Orchestration<br/>Final Decision]
end
subgraph "Layer 3: Expert Agent Layer"
L3A[QA Risk Management Expert<br/>━━━━━━━━━━━<br/>Internal Workflow:<br/>Identify → Assess → Mitigate → Monitor]
L3B[PMO Scheduling Expert<br/>━━━━━━━━━━━<br/>Internal Workflow:<br/>Decompose → Analyze Dependencies → Match → Optimize]
end
subgraph "Layer 2: Simple Agent Layer"
L2A[Tech Requirement Analysis<br/>━━━━━━━━━━━<br/>Single Responsibility<br/>Directly Call Tools]
L2B[HR Resource Assessment<br/>━━━━━━━━━━━<br/>Single Responsibility<br/>Directly Call Tools]
L2C[Finance Budget Analysis<br/>━━━━━━━━━━━<br/>Single Responsibility<br/>Directly Call Tools]
end
subgraph "Layer 1: MCP Tool Layer"
L1A[EstimateTechnicalComplexity<br/>ValidateTechStack<br/>GetArchitectureTemplate]
L1B[GetTeamCapabilities<br/>CheckTeamAvailability<br/>EstimateResourceCost]
L1C[ValidateBudget<br/>GetHistoricalCosts<br/>CalculateROI]
L1D[AnalyzeRiskPatterns<br/>GetComplianceRequirements<br/>ValidateDeliverables]
L1E[GetProjectTemplate<br/>ValidateSchedule<br/>CalculateCriticalPath]
end
L4 --> L3A
L4 --> L3B
L4 --> L2A
L4 --> L2B
L4 --> L2C
L3A --> L1D
L3B --> L1E
L2A --> L1A
L2B --> L1B
L2C --> L1C
style L4 fill:#ff6b6b,stroke:#333,stroke-width:3px,color:#fff
style L3A fill:#feca57,stroke:#333,stroke-width:2px
style L3B fill:#feca57,stroke:#333,stroke-width:2px
style L2A fill:#48dbfb,stroke:#333,stroke-width:2px
style L2B fill:#48dbfb,stroke:#333,stroke-width:2px
style L2C fill:#48dbfb,stroke:#333,stroke-width:2px
style L1A fill:#dfe6e9,stroke:#333,stroke-width:1px
style L1B fill:#dfe6e9,stroke:#333,stroke-width:1px
style L1C fill:#dfe6e9,stroke:#333,stroke-width:1px
style L1D fill:#dfe6e9,stroke:#333,stroke-width:1px
style L1E fill:#dfe6e9,stroke:#333,stroke-width:1px
```
**Layer Explanation**:
1. **Layer 1 - MCP Tool Layer**: Stateless pure function tools providing basic computation and data access capabilities.
2. **Layer 2 - Simple Agent Layer**: Agents with single responsibilities that directly call MCP tools using ChatClient.
3. **Layer 3 - Expert Agent Layer**: Complex workflow orchestration using the Agent Framework for multi-stage analysis.
4. **Layer 4 - Orchestration Agent Layer**: Cross-domain coordination, unified user interface, and final decision-making.
## 🛠️ Technology Stack
| Category | Technology | Version | Description |
|----------|------------|---------|-------------|
| **Framework** | .NET | 9.0 | Latest .NET platform |
| **Web** | ASP.NET Core | 9.0 | Microservices framework |
| **Frontend** | Blazor Server | 9.0 | Server-side rendered UI |
| **Orchestration** | .NET Aspire | Latest | Cloud-native application orchestration |
| **AI Framework** | Microsoft Agent Framework | Preview | Agent workflow engine |
| **Protocol** | A2A (Agent-to-Agent) | Latest | Agent-to-agent communication protocol |
| **Protocol** | MCP (Model Context Protocol) | Preview | Model context protocol |
| **AI Service** | OpenAI API | GPT-4 | Large language model |
| **Monitoring** | OpenTelemetry | Latest | Observability |
## Project Structure
```
AgentFrameworkAspire/
├── AgentFrameworkAspire.AppHost/ # Aspire orchestration host
├── AgentFrameworkAspire.Web/ # Web frontend
├── AgentFrameworkAspire.ServiceDefaults/ # Shared service configuration
├── Finance/ # Finance service (MCP + A2A Agent)
├── Tech/ # Technical architecture service (MCP + A2A Agent)
├── HumanResource/ # Human resources service (MCP + A2A Agent)
├── QA/ # QA service (MCP + Workflow Agent)
└── PMO/ # PMO service (MCP + Workflow Agent)
```
## Service Descriptions
### 1. Finance (Finance Service)
- **MCP Tools**: Budget validation, historical cost queries, ROI calculation.
- **A2A Agent**: Finance analysis agent providing budget analysis and cost control recommendations.
- **Endpoints**:
- MCP: `/finance/mcp`
- A2A: `/finance/budget-analyzer`
### 2. Tech (Technical Architecture Service)
- **MCP Tools**: Technical complexity assessment, tech stack validation, architecture template retrieval.
- **A2A Agent**: Technical requirement analysis agent providing architecture design recommendations.
- **Endpoints**:
- MCP: `/tech/mcp`
- A2A: `/tech/requirement-analyst`
### 3. HumanResource (Human Resources Service)
- **MCP Tools**: Team capability queries, availability checks, resource cost estimation.
- **A2A Agent**: HR resource assessment agent providing team capacity planning.
- **Endpoints**:
- MCP: `/hr/mcp`
- A2A: `/hr/resource-estimator`
### 4. QA (Quality Assurance Service)
- **MCP Tools**: Risk pattern analysis, compliance requirements retrieval, deliverable validation.
- **A2A Workflow Agent**: Risk management expert using multi-stage workflows for risk analysis.
- Workflow: Risk identification → Impact assessment → Mitigation strategies → Monitoring plan.
- **Endpoints**:
- MCP: `/qa/mcp`
- A2A: `/qa/risk-expert`
### 5. PMO (Project Management Office Service)
- **MCP Tools**: Project template retrieval, schedule validation, critical path calculation.
- **A2A Workflow Agent**: Scheduling expert using multi-stage workflows for project planning.
- Workflow: Task decomposition → Dependency analysis → Resource matching → Time optimization.
- **Endpoints**:
- MCP: `/pmo/mcp`
- A2A: `/pmo/schedule-expert`
## 🚀 Quick Start
### Prerequisites
- ✅ .NET 9.0 SDK ([Download](https://dotnet.microsoft.com/download/dotnet/9.0))
- ✅ Docker Desktop ([Download](https://www.docker.com/products/docker-desktop))
- ✅ OpenAI API Key or compatible API service
### Step 1: Clone the Project
```powershell
git clone https://github.com/MadLongTom/A2AMicroserviceSample.git
cd A2AMicroserviceSample
```
### Step 2: Configure OpenAI API
Edit the `AgentFrameworkAspire.AppHost/appsettings.json` file to configure OpenAI parameters:
```json
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Aspire.Hosting.Dcp": "Warning"
}
},
"Parameters": {
"openai-endpoint": "",
"openai-apikey": "your-api-key-here",
"openai-deployment": "gpt-4o-mini"
}
}
```
**Configuration Instructions**:
| Parameter | Description | Example |
|-----------|-------------|---------|
| `openai-endpoint` | API endpoint (optional)<br/>- Leave empty: use OpenAI official API<br/>- Fill in: use third-party compatible API | `""`<br/>`"https://api.openai.com/v1"`<br/>`"https://your-proxy.com/v1"` |
| `openai-apikey` | API key (required)<br/>Obtain from OpenAI or third-party service | `"sk-..."` |
| `openai-deployment` | Model name (required)<br/>Select the model to use | `"gpt-4o-mini"`<br/>`"gpt-4"`<br/>`"gpt-3.5-turbo"` |
> **💡 Tip**: If you are using Azure OpenAI, the endpoint should be similar to `https://your-resource.openai.azure.com/`, and the deployment is the model name you deployed in Azure.
### Step 3: Restore Dependencies
```powershell
dotnet restore
```
### Step 4: Start the Project
```powershell
cd AgentFrameworkAspire.AppHost
dotnet run
```
The Aspire Dashboard will automatically open in your browser (default `http://localhost:15000`), displaying the status and logs of all services.
### Step 5: Access the Web Interface
In the Aspire Dashboard, find the `webfrontend` service and click its URL (usually `http://localhost:5xxx`) to access the Project Manager Agent's chat interface.
### Test Example
Try entering the following question:
```
We want to develop an online education platform with a budget of 2 million. How long will it take to complete?
```
The system will automatically call all specialized agents for analysis and provide comprehensive recommendations.
## ⚙️ Configuration Instructions
### Aspire Configuration File Location
The main configuration file is located at `AgentFrameworkAspire.AppHost/appsettings.json`, which is the recommended configuration method.
### Development Environment Configuration (Optional)
If special configurations for the development environment are needed, you can create `AgentFrameworkAspire.AppHost/appsettings.Development.json`:
```json
{
"Logging": {
"LogLevel": {
"Default": "Debug"
}
},
"Parameters": {
"openai-endpoint": "https://your-dev-api.com/v1",
"openai-apikey": "your-dev-key",
"openai-deployment": "gpt-4"
}
}
```
> **Note**: `appsettings.Development.json` will override the configurations in `appsettings.json`.
### Environment Variable Configuration (Advanced)
You can also override configurations through environment variables (highest priority):
```powershell
# Windows PowerShell
$env:Parameters__openai-endpoint = "https://api.openai.com/v1"
$env:Parameters__openai-apikey = "your-api-key"
$env:Parameters__openai-deployment = "gpt-4"
# Then start
dotnet run
```
### Service Endpoints
After starting, the endpoints for each service are as follows (ports are dynamically assigned by Aspire and can be viewed in the Dashboard):
| Service | MCP Endpoint | A2A Endpoint | Description |
|---------|--------------|--------------|-------------|
| **Finance** | `/finance/mcp` | `/finance/budget-analyzer` | Finance analysis agent |
| **Tech** | `/tech/mcp` | `/tech/requirement-analyst` | Technical requirement analysis agent |
| **HumanResource** | `/hr/mcp` | `/hr/resource-estimator` | HR resource assessment agent |
| **QA** | `/qa/mcp` | `/qa/risk-expert` | Risk management expert agent |
| **PMO** | `/pmo/mcp` | `/pmo/schedule-expert` | Scheduling expert agent |
| **Web Frontend** | - | - | Project Manager Agent UI |
## Architectural Features
1. **Microservices Architecture**: Each business domain is independently deployed with clear responsibilities.
2. **Standardized Protocols**: Using A2A and MCP for standardized communication between services.
3. **Agent Layering**:
- **Simple Agents** (Layer 2): Finance, Tech, HumanResource.
- **Expert Agents** (Layer 3): QA, PMO (internally using Workflow).
- **Orchestration Agents** (Layer 4): ProjectManager (cross-service orchestration).
4. **Unified Configuration**: All service configurations are managed centrally through Aspire AppHost.
5. **Observability**: Integrated OpenTelemetry for tracing and monitoring.
## Development Guide
### Project Code Organization
Understand the key files and code structure of the project:
| Path | Description | Importance |
|------|-------------|------------|
| `AgentFrameworkAspire.AppHost/Program.cs` | Aspire orchestration configuration, parameter injection | ⭐⭐⭐ |
| `AgentFrameworkAspire.Web/Services/ProjectManagerAgent.cs` | Core logic of the Project Manager Agent | ⭐⭐⭐ |
| `AgentFrameworkAspire.ServiceDefaults/AgentHelpers.cs` | ChatClient and MCP factory methods | ⭐⭐⭐ |
| `Finance/Program.cs` | Finance service: MCP tools + A2A endpoints | ⭐⭐ |
| `Tech/Program.cs` | Technical service: MCP tools + A2A endpoints | ⭐⭐ |
| `HumanResource/Program.cs` | HR service: MCP tools + A2A endpoints | ⭐⭐ |
| `QA/Program.cs` | QA service: 4-stage workflow | ⭐⭐ |
| `PMO/Program.cs` | PMO service: 4-stage workflow | ⭐⭐ |
### Adding New MCP Tools
Add new tools in any microservice's `Program.cs`:
```csharp
[McpServerToolType]
public class YourCustomTools
{
[McpServerTool(Description = "Tool Description")]
public Task<CallToolResult> YourMethod(
[ToolParameter(Required = true)] string param1,
[ToolParameter(Required = false)] int? param2)
{
// Implement your business logic
var result = new {
status = "success",
data = "your data"
};
return Task.FromResult(new CallToolResult
{
Content = [new TextContentBlock {
Text = JsonSerializer.Serialize(result)
}]
});
}
}
// Register to MCP Server
mcpServer.AddToolType<YourCustomTools>();
```
### Adding New MCP Resources
```csharp
[McpServerResourceType]
public class YourCustomResources
{
[McpServerResource(
UriTemplate = "your://resource/{id}",
Name = "Resource Name",
Description = "Resource Description")]
public Task<ReadResourceResult> GetResource(string id)
{
var data = FetchYourData(id);
return Task.FromResult(new ReadResourceResult
{
Contents = [new TextResourceContents
{
Uri = $"your://resource/{id}",
MimeType = "application/json",
Text = JsonSerializer.Serialize(data)
}]
});
}
}
// Register to MCP Server
mcpServer.AddResourceType<YourCustomResources>();
```
### Creating Simple Agents (Layer 2)
Simple agents use `ChatClient` to directly integrate MCP tools:
```csharp
public class YourSimpleAgent
{
private readonly IChatClient _chatClient;
private readonly McpClient _toolsClient;
public YourSimpleAgent(IChatClient chatClient, McpClient toolsClient)
{
_chatClient = chatClient;
_toolsClient = toolsClient;
}
public void Attach(ITaskManager taskManager)
{
taskManager.OnMessageReceived = ProcessMessageAsync;
}
private async Task<A2AResponse> ProcessMessageAsync(
MessageSendParams messageSendParams,
CancellationToken cancellationToken)
{
var userMessage = messageSendParams.Message.Content.FirstOrDefault()?.Text ?? "";
// Build chat context
var messages = new List<ChatMessage>
{
new ChatMessage(ChatRole.System, "You are a professional XX assistant..."),
new ChatMessage(ChatRole.User, userMessage)
};
// Call AI (automatically uses MCP tools)
var response = await _chatClient.CompleteAsync(
messages,
cancellationToken: cancellationToken);
return new A2AResponse
{
Message = new Message
{
Role = "assistant",
Content = [new TextContent { Text = response.Message.Text }]
}
};
}
}
```
### Creating Expert Agents (Layer 3)
Expert agents use the Agent Framework's Workflow to implement multi-stage analysis:
```csharp
public class YourExpertAgent
{
private readonly Workflow _analysisWorkflow;
public YourExpertAgent(IChatClient chatClient, McpClient toolsClient)
{
// Define multiple sub-agents
var stage1Agent = new ChatClientAgent(
chatClient,
"Stage 1 expert instructions...");
var stage2Agent = new ChatClientAgent(
chatClient,
"Stage 2 expert instructions...");
var stage3Agent = new ChatClientAgent(
chatClient,
"Stage 3 expert instructions...");
// Build workflow: stage1 → stage2 → stage3
_analysisWorkflow = new WorkflowBuilder(stage1Agent)
.AddEdge(stage1Agent, stage2Agent)
.AddEdge(stage2Agent, stage3Agent)
.Build();
}
public void Attach(ITaskManager taskManager)
{
taskManager.OnMessageReceived = ProcessMessageAsync;
}
private async Task<A2AResponse> ProcessMessageAsync(
MessageSendParams messageSendParams,
CancellationToken cancellationToken)
{
var userMessage = messageSendParams.Message.Content.FirstOrDefault()?.Text ?? "";
// Execute workflow
var result = await _analysisWorkflow.ExecuteAsync(
userMessage,
cancellationToken);
return new A2AResponse
{
Message = new Message
{
Role = "assistant",
Content = [new TextContent { Text = result }]
}
};
}
}
```
### Adding New Microservices
1. **Create a New Project**:
```powershell
dotnet new webapi -n YourNewService
cd YourNewService
dotnet add package Microsoft.Extensions.AI
dotnet add package Microsoft.AI.Agents
dotnet add package ModelContextProtocol
dotnet add package A2A.Protocol
```
2. **Register in AppHost** (in `AgentFrameworkAspire.AppHost/Program.cs`):
```csharp
var yourService = builder.AddProject<Projects.YourNewService>("yournewservice")
.WithEnvironment("OpenAI__Endpoint", openAiEndpoint)
.WithEnvironment("OpenAI__ApiKey", openAiApiKey)
.WithEnvironment("OpenAI__DeploymentName", openAiDeploymentName);
// Reference in webfrontend
builder.AddProject<Projects.AgentFrameworkAspire_Web>("webfrontend")
// ... other configurations
.WithReference(yourService)
.WaitFor(yourService);
```
3. **Implement Service Logic** (refer to existing services' `Program.cs`)
### Debugging Tips
1. **View Service Logs**: Click on the corresponding service in the Aspire Dashboard to view real-time logs.
2. **Trace Request Chains**: Use the Dashboard's Traces view to see cross-service calls.
3. **Debug Individual Services**: Set breakpoints in VS Code and start a specific service.
4. **View MCP Tool List**: Access `http://localhost:<port>/<service>/mcp` to see available tools.
### Testing Recommendations
```powershell
# Test a single microservice
cd Finance
dotnet test
# Test the entire solution
dotnet test
# Run specific tests
dotnet test --filter "FullyQualifiedName~FinanceTests"
```
### Code Standards
- ✅ Use `async/await` for asynchronous operations.
- ✅ Provide detailed `Description` and parameter explanations for MCP tools.
- ✅ Ensure the system prompt for agents is clear and precise.
- ✅ Properly handle exceptions and error scenarios.
- ✅ Use structured logging (Serilog).
- ✅ Follow SOLID principles.
## 📚 More Resources
- **Detailed Documentation**: Check the `/docs` directory for a series of documents.
- `Getting Started - Multi-Agent Microservices Quick Start.md`: Suitable for beginners.
- `Advanced Guide - Multi-Agent Microservices In-Depth Practice.md`: Suitable for advanced developers.
- `Blog 1 - Understanding Business Pain Points.md`: Understand project background.
- `Blog 2 - In-Depth Analysis of Three Protocols.md`: Understand MCP, A2A, Agent Framework.
- `Blog 3 - Aspire Practical Exercises.md`: Practical exercises with Aspire.
- `Blog 4 - From Demo to Production.md`: Deployment in production environments.
- **Reference Documentation**:
- [.NET Aspire Official Documentation](https://learn.microsoft.com/dotnet/aspire/)
- [Microsoft Agent Framework](https://github.com/microsoft/semantic-kernel)
- [Model Context Protocol (MCP)](https://modelcontextprotocol.io/)
- [A2A Protocol Specification](https://github.com/microsoft/agent-protocol)
- **Source Code Reference**: The `/component_source_code_reference` directory contains the source code of third-party libraries for learning purposes.
## 🤝 Contribution
Contributions of code, documentation, or issues are welcome!
1. Fork this repository (https://github.com/MadLongTom/A2AMicroserviceSample).
2. Create your feature branch (`git checkout -b feature/AmazingFeature`).
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`).
4. Push to the branch (`git push origin feature/AmazingFeature`).
5. Open a Pull Request.
## 📄 License
This project is licensed under the **WTFPL License** - see the [LICENSE](LICENSE) file for details.
In short: **You can do whatever you want with this project.**
## ⭐ Star History
If this project has been helpful to you, please give it a star ⭐ for support!
---
**Made with ❤️ by MadLongTom**
Project address: https://github.com/MadLongTom/A2AMicroserviceSample
## Notes
1. **API Key Security**: Do not commit API keys to version control systems.
2. **Mock Data**: Current tool implementations use mock data; production environments need to connect to real systems.
3. **Concurrency Limits**: Be aware of OpenAI API rate limits.
4. **Error Handling**: Production environments need comprehensive error handling and retry mechanisms.
## Troubleshooting
### Service Won't Start
- Check if .NET 9.0 SDK is installed.
- Check if Docker Desktop is running.
- Check if the port is occupied.
### OpenAI API Errors
- Verify if the API Key is correct.
- Check network connectivity.
- Confirm if the API quota is sufficient.
### Workflow Agent Not Responding
- Check if the ChatClient configuration is correct.
- View service logs for detailed error information.
## Reference Documentation
- [.NET Aspire](https://learn.microsoft.com/dotnet/aspire/)
- [Microsoft Agent Framework](https://github.com/microsoft/agent-framework)
- [A2A Protocol](https://github.com/microsoft/a2a-dotnet)
- [Model Context Protocol](https://github.com/microsoft/mcp-dotnet)
## License
This project is licensed under the MIT License.