Tutorials ASP.NET Core with Agentic AI Tutorial
AI Orchestration with Kernel — Complete Guide
AI Orchestration with Kernel — Complete Guide: free step-by-step lesson with examples, common mistakes, and interview tips — part of ASP.NET Core with Agentic AI Tutorial on Toolliyo Academy.
On this page
ASP.NET Core with Agentic AI Tutorial · Lesson 27 of 100
AI Orchestration with Kernel
AI basics → Agents
AI basics · 1 — Setup · ~6 min · Module 3: Semantic Kernel
What is this?
Kernel orchestration combines prompts, plugins, planners, and memory in one execution graph. AgentNest orchestrators invoke kernel processes for multi-step CRM playbooks.
Why should you care?
Kernel already knows plugins — orchestration layers add tenant policy, telemetry, and human gates around InvokeAsync.
See it live — copy this example
Paste into an ASP.NET Core 8+ / AgentNest project, then run with dotnet run (set your API keys in user-secrets).
// AgentNest.Orchestration/KernelPlaybookRunner.cs
public sealed class KernelPlaybookRunner(Kernel kernel, ILogger<KernelPlaybookRunner> log)
{
public async Task RunCrmPlaybookAsync(Guid dealId, CancellationToken ct)
{
var enrich = kernel.Plugins["crm"]["EnrichDeal"];
var draft = kernel.CreateFunctionFromPrompt("Draft email for deal {{$dealId}}");
await kernel.InvokeAsync(enrich, new() { ["dealId"] = dealId.ToString() }, cancellationToken: ct);
var email = await kernel.InvokeAsync(draft, new() { ["dealId"] = dealId.ToString() }, cancellationToken: ct);
log.LogInformation("Playbook complete for {DealId}", dealId);
}
}
What happened?
- KernelPlaybookRunner chains a plugin function and a prompt function sequentially with structured logging.
- Follow the steps below — typing the code yourself is the fastest way to learn.
Practice next
- Register kernel with crm plugin in DI.
- Define playbooks as explicit runner methods for regulated flows.
- Pass CancellationToken into every InvokeAsync.
- Persist playbook state after enrich step for crash recovery.
- Return structured PlaybookResult DTO instead of void.
Remember
Orchestrate SK with explicit playbook runners for CRM/ERP. Chain InvokeAsync calls with logging and cancellation. Reserve planners for exploratory analytics only.
CRM playbook button
SDR clicks Enrich + Draft on a stalled opportunity.
Outcome: KernelPlaybookRunner runs two kernel steps with full telemetry in one API call.
Interview prep for this lesson
Practice these questions aloud after reading—each links to a full structured answer.
Sign in to ask a question or upvote helpful answers.
No questions yet — be the first to ask!