SimplAgent: A .NET Aspire Solution with AgentFramework
SimplAgent is a modern agent-based application built on .NET Aspire
and developed with AgentFramework. It orchestrates requests via ApiService,
performs Retrieval-Augmented Generation (RAG) with a dedicated Knowledge Service,
and extends capabilities through a built-in SimpleTool plugin alongside an
MCP Server for MCP Tools integration.
Introduction
SimplAgent demonstrates agentic patterns on .NET Aspire with clear orchestration, RAG-driven knowledge, and extensible tools. The architecture is designed for reliability, observability, and straightforward scaling.
- Built with AgentFramework to model agent behaviors and tools
- Uses .NET Aspire for cloud-native composition and diagnostics
- Extensible via SimpleTool and MCP Server (Model Context Protocol)
Solution Overview
The solution centers around ApiService as the orchestrator, delegating tasks to specialized services and tools:
- ApiService (Orchestrator): Routes requests, manages sessions, coordinates downstream calls.
- Knowledge Service (RAG): Ingests documents, creates embeddings, retrieves context for grounded responses.
- SimpleTool (Built-in Plugin): Quick utilities and domain-specific helper functions.
- MCP Server: Hosts and exposes MCP Tools for capability expansion.
Technical Architecture
Core Flow
- User sends a request to ApiService.
- ApiService determines intent and routes to Knowledge Service or Tools.
- Knowledge Service performs embedding-based retrieval for RAG when needed.
- For utility or integration tasks, SimpleTool or MCP Tools are invoked via the MCP Server.
- ApiService aggregates results and returns a structured response.
Key Design Considerations
- Observability (Aspire): metrics, tracing, health checks.
- Scalability: services are independently deployable and horizontally scalable.
- Extensibility: new tools can be registered via MCP with minimal changes.
- Security: API auth, sanitized tool invocation, controlled access to embeddings/storage.
Technology Stack
- .NET Aspire for composition, hosting, and diagnostics
- AgentFramework for agent behavior and tool abstractions
- Vector store & embeddings (RAG) — pluggable providers
- MCP Server for tool hosting & protocol integration
Project Breakdown
- ApiService
- Endpoints for Q&A, tool invocation, and RAG queries
- Session routing and response formatting
- Knowledge Service
- Document ingestion (.txt and more)
- Embedding generation and indexing
- Similarity search and context assembly
- SimpleTool
- Built-in helper operations (text utilities, quick lookups)
- MCP Server & MCP Tools
- Tool registry and discovery
- Sandboxed tool execution and capability exposure
Sample Use Cases (Demo)
1) User asks a simple question
The user submits a straightforward query. ApiService handles intent detection and either responds directly or delegates minimal processing to SimpleTool for a quick result.
2) User uploads a .txt document, generates embeddings for RAG, then searches
The user uploads a .txt file. Knowledge Service ingests it, creates embeddings,
and indexes it. On search, the service retrieves relevant passages to ground the answer (RAG).
3) User asks for information served by MCP Tool
ApiService detects that the query needs an external integration or specialized function. It invokes the MCP Server to run an MCP Tool, collects the output, and returns a consolidated answer.
Conclusion
SimplAgent provides a practical, extensible pattern for agentic applications on .NET Aspire. With orchestration via ApiService, robust RAG, and tooling powered by SimpleTool and MCP Server, the solution is engineered for clarity, scalability, and rapid iteration.
Demo Source Code: https://github.com/haima24/SimplAgent