Skip to content

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💡 Practical GenAI-Eshop application using Semantic Kernel, multi-agent orchestrations, Mcp tools, A2A Agents, Semantic Search and more.

Note

We migrated the GenAI-Eshop application to use the microsoft/agent-framework instead of Semantic Kernel in the mehdihadeli/genai-eshop repository. You can check their differences in a practical application there.

Note

🎥 See my talk at JetBrains .NET Day 2025, where I explain Generative AI and demonstrate this practical example.

Building Scalable GenAI Apps Using Semantic Kernel and .NET Aspire

Features

  • ✅ Using microsoft/semantic-kernel for multi-agent orchestrations and AI related services
  • ✅ Using Qdrant Semantic Kernel Connector for storing vector data for doing Semantic Meaning Search and Hybrid Search using vector data and semantic kernel
  • ✅ Using Semantic Kernel EmbeddingGenerator based on chosen providers like Ollama, AzureOpenAI, and OpenAI for generating vector data for semantic search
  • ✅ Using Semantic Kernel ChatCompletion based on chosen providers like Ollama, AzureOpenAI, and OpenAI for communicating with different models for generating responses
  • ✅ Using Mcp tools based on http and json-rpc for calling endpoints in our Mcp server and calling third party tools by LLMs for Fine-grained functions
  • ✅ Using Multi-Agent Orchestrations for local and external agents communication using agents parent child agent relationships and different Semantic Kernel’s Agent Orchestration Patterns like Parent-Child, GroupChat and Sequential orchestration
  • ✅ Using Agent2Agent Protocol (A2A) protocol based on http and json-rpc for calling and using external agents
  • ✅ Using Vertical Slice Architecture as a high-level architecture
  • ✅ Using Minimal APIs for handling requests
  • ✅ Using OpenTelemetry for collecting Logs, Metrics and Distributed Traces
  • ✅ Using .NET Aspire for cloud-native application orchestration and enhanced developer experience

Architecture Diagram

Getting Started

OpenAI-compatible API

Copy .env.example to .env, then replace the placeholder endpoint, model names, and API keys. The application reads SemanticKernelOptions__... environment variables, so any provider exposing the OpenAI /v1 API shape can be used for local testing:

cp .env.example .env

Set SemanticKernelOptions__ChatEndpoint and SemanticKernelOptions__EmbeddingEndpoint to your provider's base URL, such as http://localhost:4000/v1. Keep .env local and never commit credentials.

Run the focused tests with:

dotnet test --project tests/BuildingBlocks/BuildingBlocks.Tests/BuildingBlocks.Tests.csproj

Prerequisites

Install an IDE

You can use any of the following IDEs for development:

Ensure the IDE includes support for .NET Core and plugins for C#.

Run Application

Aspire

Install the Aspire CLI tool:

# Bash
dotnet tool install -g Aspire.Cli

To run the application using the Aspire App Host and using Aspire dashboard in the development mode run following command:

aspire run

Note:The Aspire dashboard will be available at: https://localhost:17056 and http://localhost:15234

Using Docker-Compose

# Start docker-compose
docker-compose -f .\deployments\docker-compose\docker-compose.yaml up -d

# Stop docker-compose
docker-compose -f .\deployments\docker-compose\docker-compose.yaml down

This command will run the required infrastructure for the application

Open the solution file genai-eshop-semantic-kernel.sln in your preferred IDE (e.g., Rider or Visual Studio).

Now you can run each microservice using the IDE.

Run Integration and End-to-End Tests

Start Aspire before running tests so PostgreSQL, Redis, Qdrant, and the APIs are available:

export GENAI_RUN_EXTERNAL_TESTS=true
bash scripts/start-aspire-for-tests.sh
find tests -type f \( -name '*IntegrationTests.csproj' -o -name '*EndToEndTests.csproj' \) -print0 |
	while IFS= read -r -d '' project; do
		dotnet test --project "$project" --configuration Release --no-build
	done
bash scripts/stop-aspire-for-tests.sh

The integration test projects use xUnit v3's Microsoft.Testing.Platform runner, so CI invokes each *IntegrationTests.csproj and *EndToEndTests.csproj project explicitly.

The start script waits for every API health endpoint and disables vector seeding by default. Use GENAI_TEST_*_BASE_URL variables to override service URLs. CI runs the same lifecycle automatically and always stops Aspire after the test step.

License

The project is under MIT license.

About

Practical GenAI-Eshop application using Semantic Kernel, multi-agent orchestrations, Mcp tools, A2A Agents, Semantic Search, Aspire and more.

Topics

Resources

Stars

15 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages