Tutorials ASP.NET Core with Agentic AI Tutorial
AI Service Architecture — Complete Guide
AI Service Architecture — 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 16 of 100
AI Service Architecture
AI basics → Agents
AI basics · 1 — Setup · ~6 min · Module 2: ASP.NET Core AI Fundamentals
What is this?
AI service architecture splits HTTP controllers, application agents, domain plugins, and infrastructure clients into layers. AgentNest keeps controllers thin — they validate DTOs and call IAgent services.
Why should you care?
ERP and hospital modules evolve independently; clear layers prevent CRM prompt strings from leaking into EF Core repositories.
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 layers (ASCII)
Controllers (AgentNest.Api)
-> Application agents (AgentNest.Agents)
-> Plugins / tools (AgentNest.Plugins)
-> Infrastructure (OpenAI, SQL, Pinecone)
*/
What happened?
- The diagram shows dependency direction downward only.
- Controllers never reference Pinecone SDKs; agents call IVectorStore abstractions.
Practice next
- Create solution folders: Api, Agents, Plugins, Infrastructure.
- Reference rules: Api -> Agents -> Plugins -> Infrastructure only.
- Move OpenAI calls out of controllers into agent classes.
- Extract IVectorStore interface and move Pinecone code to Infrastructure.
- Add a diagram to AGENTS.md for onboarding.
Remember
Layer AgentNest so AI logic lives in Agents, not controllers. Plugins wrap external systems with narrow interfaces. Infrastructure holds SDK details and connection strings.
Hospital plugin audit
Security review asks where PHI touches the LLM.
Outcome: Layer map shows only HospitalPlugin in Agents reads EHR — easy to redact.
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!