Mert Özen Go Beyond the Code

Blog

Posts and series that take software and IT from the basics to advanced topics: from programming languages and databases to architecture and AI.

Series
1990 posts found
Human-in-the-Loop: Tool Approval, Checkpoints and Long-Running Agents
Artificial Intelligence PART 07

Human-in-the-Loop: Tool Approval, Checkpoints and Long-Running Agents

We put write tools behind approval with ApprovalRequiredAIFunction and, when approval takes hours, write the agent session to JSON and resume in another process. Reasoned rejections, an attempt to change the argument in the approval response (approval-response binding) and resuming a workflow from a checkpoint with RequestPort, all with real runs.

8 Nov 2026 10 min 87
Multi-Agent Systems: Handoff, Group Chat, Orchestration and A2A
Artificial Intelligence PART 06

Multi-Agent Systems: Handoff, Group Chat, Orchestration and A2A

Several agents bring specialization, isolation and parallelism, paid for with a token multiplier and coordination errors. We run MAF's sequential, concurrent, handoff, group chat and Magentic orchestrations on Bookstore, see a handoff where the specialist hands back without calling its tool and a group chat that won't end, with real output, and hand work to an agent in another service over A2A.

8 Nov 2026 12 min 97
Agent Workflow Patterns: Prompt Chaining, Routing, Parallelization, Orchestrator-Workers and Evaluator-Optimizer
Artificial Intelligence PART 05

Agent Workflow Patterns: Prompt Chaining, Routing, Parallelization, Orchestrator-Workers and Evaluator-Optimizer

We run five workflow patterns on Bookstore: prompt chaining and orchestrator-workers in plain C#, routing, fan-out/fan-in and a writer-critic loop with MAF WorkflowBuilder. Real runs where a small model approves "must read" and the orchestrator blows the budget, code gates, and exposing a workflow as an agent with AsAIAgent.

8 Nov 2026 14 min 73
Context Engineering: Managing an Agent's Context, Compaction and Memory
Artificial Intelligence PART 04

Context Engineering: Managing an Agent's Context, Compaction and Memory

Context is a budget, and when it fills up it can be truncated without an error: qwen3:4b loaded with 4,096 tokens loses the budget stated at the start of a long session and makes up a number. Compacting old tool output with MAF's CompactionProvider, cross-session preference memory with an AIContextProvider and taking only a summary back from a sub-agent, with real token counts.

8 Nov 2026 11 min 98
Designing Tools for Agents: Names, Descriptions, Schemas, Error Messages and Tool Count
Artificial Intelligence PART 03

Designing Tools for Agents: Names, Descriptions, Schemas, Error Messages and Tool Count

We compare twelve CRUD tools that mirror the API with two task-focused tools on the same requests with qwen3:4b: thirteen times the tokens, a book that can't be found and an agent that adds the wrong book and says "added". Why a schema isn't validation, human-readable output, messages that explain empty results, name collisions and side-effecting tools.

8 Nov 2026 13 min 66
Writing an Agent Loop from Scratch: Plan, Tool Call, Observation and Stop Condition
Artificial Intelligence PART 02

Writing an Agent Loop from Scratch: Plan, Tool Call, Observation and Stop Condition

We write an agent loop in C# without a framework: returning tool results and errors to the model, step/token/time budgets, blocking repeated calls and tracing every step. A real run shows tokens piling up turn by turn; then we do the same job with FunctionInvokingChatClient and MAF's ChatClientAgent and compare what each layer abstracts away.

8 Nov 2026 12 min 72
What Is an AI Agent? Workflows, Agents and Deciding You Don't Need One
Artificial Intelligence PART 01

What Is an AI Agent? Workflows, Agents and Deciding You Don't Need One

An agent is a system where the model directs the control flow; in a workflow, code draws the path. We run three Bookstore scenarios (order status, a return, find a book and add it to the cart) on the same code with qwen3:4b, measure model calls, tokens and time, and derive the price of an agent and the criteria for deciding you don't need one.

8 Nov 2026 11 min 61
From Semantic Kernel to Microsoft Agent Framework: History, Support Status and Migrating Old Code
Artificial Intelligence PART 14

From Semantic Kernel to Microsoft Agent Framework: History, Support Status and Migrating Old Code

Semantic Kernel still gets critical bug and security fixes, but new features go to Microsoft Agent Framework; the official commitment is at least one year after MAF GA (April 3, 2026). We build the history from NuGet and GitHub dates, run an old SK agent against a local model, migrate it to MAF and derive the mapping table.

8 Nov 2026 12 min 110
Hosting Agents in ASP.NET Core: AddAIAgent, OpenAI-Compatible Endpoints, AG-UI and A2A
Artificial Intelligence PART 13

Hosting Agents in ASP.NET Core: AddAIAgent, OpenAI-Compatible Endpoints, AG-UI and A2A

You register an agent in DI with AddAIAgent and expose it over three protocols with MapOpenAIChatCompletions, MapAGUIServer and MapA2AJsonRpc; the agent is written once and the adapters only translate the format. With real calls we look at an OpenAI response with multiple choices, an AG-UI stream that carries reasoning to the browser, the A2A agent card, and claims-based session isolation with rate limiting.

8 Nov 2026 11 min 69
Middleware, Context Providers and Session Persistence in Agent Framework
Artificial Intelligence PART 12

Middleware, Context Providers and Session Persistence in Agent Framework

In Agent Framework, agent run middleware handles inputs like card numbers, function invocation middleware blocks access to other customers' orders, and a context provider writes the user's preference into the session, which is saved and restored as JSON. In a real run we see the memory work, the model still invent an author, and reasoning bloat the session.

8 Nov 2026 11 min 63
Getting Started with Microsoft Agent Framework: From IChatClient to AIAgent
Artificial Intelligence PART 11

Getting Started with Microsoft Agent Framework: From IChatClient to AIAgent

AsAIAgent turns an IChatClient into a ChatClientAgent; the agent takes over instructions, function invocation and chat history through AgentSession, but it doesn't make the model smarter. We write the same Bookstore assistant first with a plain IChatClient and then as an agent, and compare RunAsync, RunStreamingAsync and AgentResponse with real outputs.

8 Nov 2026 9 min 68
Testing Code That Uses IChatClient: Fake Clients, Deterministic Tests and Microsoft.Extensions.AI.Evaluation
Artificial Intelligence PART 10

Testing Code That Uses IChatClient: Fake Clients, Deterministic Tests and Microsoft.Extensions.AI.Evaluation

You test the correctness of code that uses IChatClient with a fake client, without a model and in milliseconds; you measure the model's answer quality with Microsoft.Extensions.AI.Evaluation, in separate, cached evaluation runs. In real runs we see judge timeouts, reasoning hitting an 800-token cap, a cache returning stale answers, and a Relevance score that catches a prompt bug.

8 Nov 2026 15 min 80
Blog Map