This is an eleven-part, code-first series for building provider-configurable AI agents with C#, the official OpenAI .NET client, and either OpenAI or OpenRouter.
Each article begins with the working result from the previous article. New abstractions are introduced only when the course needs them, so the reader can see why each layer exists.
| Part | Article | Outcome | Status |
|---|---|---|---|
| 1 | Starter agent and multi-turn conversation | A configurable conversational agent with in-memory history | Complete |
| 2 | Structured outputs | Type-safe support-ticket extraction using JSON Schema | Complete |
| 3 | Tool calling | An agent loop that invokes local C# functions as tools | In Progress |
| 4 | Agents as tools | An orchestrator agent that delegates to specialized agents exposed as tools | Complete |
| 5 | Execution and streaming | Streaming, cancellation, retries, and execution events | Planned |
| 6 | Context and state | Explicit run context and controlled conversation state | Planned |
| 7 | Guardrails | Input, output, and business-rule validation | Planned |
| 8 | Persistent sessions | Durable conversations that survive application restarts | Planned |
| 9 | Handoffs and delegation | A triage agent that transfers work to specialists | Planned |
| 10 | Multi-agent orchestration | Parallel and sequential workflows across agents | Planned |
| 11 | Tracing and observability | End-to-end telemetry for model calls, tools, and workflows | Planned |
agentic-ai-crash-course/
├── AgenticAiCrashCourse.slnx
├── LLMSupport/
│ ├── Configuration/
│ │ └── LlmOptions.cs
│ ├── Infrastructure/
│ │ └── LlmClientFactory.cs
│ └── LLMSupport.csproj
├── a-starter-agent/
│ ├── Agents/
│ ├── appsettings.json
│ ├── Program.cs
│ ├── StarterAgent.csproj
│ └── 01-starter-agent.md
├── b-1-structured-output/
│ ├── Agents/
│ ├── Models/
│ ├── Schemas/
│ ├── Serialization/
│ ├── appsettings.json
│ ├── Program.cs
│ ├── StructuredOutputAgent.csproj
│ └── 02-structured-outputs.md
├── b-2-structured-product-review-agent/
│ └── ...
├── c-1-tool-calling/
│ ├── ToolUsingAgent/
│ │ ├── Agents/
│ │ ├── Tools/
│ │ ├── appsettings.json
│ │ ├── Program.cs
│ │ └── ToolUsingAgent.csproj
│ └── 03-tool-calling.md
└── ...
Every article uses a separate runnable console project, named with a lettered prefix (a-starter-agent, b-structured-output, ...) that reflects reading order. Each article's markdown file lives next to the project it describes instead of in a separate docs/ tree, so the article and the code stay side by side.
Provider configuration and ChatClient creation are defined once in the shared LLMSupport class library and referenced by every part's project (<ProjectReference Include="..\LLMSupport\LLMSupport.csproj" />), so that shape does not need to be recreated per article.
Every article follows this order:
- The problem introduced at this stage
- What the reader will build
- Concepts and request flow
- Incremental implementation steps
- OpenAI and OpenRouter verification
- Failure cases and design tradeoffs
- Exercises
- What the next article adds
The examples use OpenAI-compatible Chat Completions capabilities shared by the selected OpenAI and OpenRouter models. Provider-specific behavior is isolated behind configuration or an adapter and is called out explicitly.
Model capabilities vary. Each article should verify that its configured model supports the feature being taught, especially structured outputs and function calling.