Skip to content

Getting Started

This path takes you from the basic agent loop to a local chat assistant, saved conversation state, and a hosted runtime.

HPD Agent gives you a small builder surface for the first run, then lets you add the runtime pieces that real apps need: tools, sessions, branches, events, middleware, persistence, content, hosting, and workflows.

Primary Path

Read these in order:

StepPageWhat You Build
0What Is An Agent?Understand the loop before writing code.
1Hello AgentCreate an agent, call a model, and print the response.
2Streaming EventsPrint assistant text as it arrives.
3Add A ToolLet the model call one C# function.
4Multi-Turn SessionsKeep conversation history across turns.
5Tiny Console Chat LoopBuild a usable local assistant loop.
6Save Sessions And StateSave sessions, branches, content, and agent definitions.
7ASP.NET HostingExpose the runtime over HTTP.

Optional Early Detours

These are first-class HPD surfaces, but they do not need to interrupt the shortest path:

PageUse It When
Tool HarnessesYou want to register a group of related C# functions.
BranchingYou want one session to fork into alternate conversation paths.
MiddlewareYou want behavior around turns or tool calls, such as retrieval, policy, or usage tracking.
Build A Multi-Agent WorkflowYou want explicit stages, routing, or handoffs after you understand one agent.

When To Use What

NeedUse
A deterministic operationA normal C# function.
Open-ended language, tool use, or planningAn agent.
A specialist called by another agent during a turnA subagent.
Explicit stages, routing, or handoffsA workflow.
External clients, web apps, TUIs, or process boundariesASP.NET hosting.

If ordinary code can do the job predictably, start with ordinary code. Use an agent when language understanding, generation, or model-directed tool use is the useful part.

Before You Start

You need:

  • a supported .NET SDK
  • one model provider
  • an API key or a local model runtime

The first page uses OpenAI. Hello Agent also links to a local Ollama option.

Built for production .NET agent applications.