LyraLearn AI Learning Platform
Exams
← Module 15 Β· Enterprise AI Architecture
🎧 Listen

A Reference Architecture

Most teams adopt AI by bolting a model call onto an existing app. That works for a demo and collapses under real load, real security review, and real change requests. A reference architecture gives a .NET shop a default shape β€” a set of named layers with clear responsibilities β€” so every new AI feature starts from the same defensible blueprint. LyraLearn is that blueprint, so we'll use it as the running example.

A seven-layer reference stack from database to user interface, with a cross-cutting rail of security and observability spanning every layer.

The layered AI stack, made concrete

For a .NET / SQL Server / Azure shop, the stack has seven layers. Each maps to a real component:

  1. Data & system-of-record β€” SQL Server 2025 holds both the business data (lessons, users, knowledge-base documents) and the vector embeddings. One database is the source of truth and the vector store, so retrieval joins against live business data with no second system to keep in sync.
  2. Ingestion service β€” a background worker that pulls approved content in, chunks it, embeds each chunk, and writes the vectors back. It runs continuously, not as a one-off.
  3. Retrieval β€” given a query, find the most relevant chunks via SQL Server native vector search, optionally blended with keyword filters.
  4. Inference β€” embedding and generation calls, each behind an interface so the provider (local model, Azure OpenAI, etc.) is a configuration choice, not a code rewrite.
  5. Orchestration β€” the use-case logic that sequences retrieve β†’ ground β†’ validate β†’ answer. This is where the AI Tutor lives.
  6. API & UI β€” the ASP.NET Core endpoints and Razor/Blazor pages the user touches.
  7. Cross-cutting β€” security, observability, audit, and governance, threaded through every layer rather than added at the edge.

Why the boundaries pay off

Each boundary is a place to enforce one quality goal and to swap an implementation without disturbing its neighbors. Cost is contained at inference (local embeddings cost nothing per call). Correctness is enforced at retrieval and orchestration (grounding, validation). Security is enforced at the data and inference layers (what the AI may see; where data travels). When a hallucination, a leaked record, or a runaway bill appears, the architect's first question is which layer failed β€” and a layered system always has an answer.

LyraLearn as the worked example

The rest of this module zooms into each concern β€” Clean Architecture, integration, scaling β€” using exactly this stack.

🧠 Quiz yourself on this lesson →

Ask the AI Tutor

Grounded in the course lessons β€” it cites its sources and says when it doesn't know.