Start here
Your first agent
Build an ASP.NET Core host, register a model-backed agent, then inspect its run in the embedded console. MAF executes the agent; Tracon supplies the catalog, HTTP endpoints, and default-on recording around it.
Prerequisites
Section titled “Prerequisites”- An authorized checkout of the Tracon repository.
- The .NET SDK selected by the repository’s
global.jsonand Node.js for the embedded console build. See the checkout’s README for development prerequisites. - An OpenAI API key and a chat model available to that account. The model request is sent to your configured provider and can incur provider charges.
Build from source
Section titled “Build from source”Run these commands from the root of the Tracon checkout. They create a sibling application and reference the three source projects it needs.
dotnet new web -o ../MyAgentscd ../MyAgentsdotnet add reference ../Tracon/src/Tracon.AspNetCore/Tracon.AspNetCore.csprojdotnet add reference ../Tracon/src/Tracon.OpenAI/Tracon.OpenAI.csprojdotnet add reference ../Tracon/src/Tracon.UI/Tracon.UI.csprojdotnet user-secrets initThe commands assume the checkout directory is named Tracon. Use its actual
relative path if you named it differently. The console assets build with the UI
project; no separate console server is needed.
Store your provider settings in the application’s development secrets. Replace the example values with your key and a model identifier available to your account.
dotnet user-secrets set "Tracon:Providers:OpenAI:ApiKey" "YOUR_API_KEY"dotnet user-secrets set "Tracon:Providers:OpenAI:DefaultModel" "YOUR_CHAT_MODEL"
Register the agent
Section titled “Register the agent”Replace the generated Program.cs with the following:
using Tracon;
var builder = WebApplication.CreateBuilder(args);
var tracon = builder.AddTracon() .UseOpenAI(builder.Configuration.GetSection(OpenAIProviderOptions.SectionName)) .UseUI();
tracon.AddAgent(new AgentDefinition{ Name = "support", DisplayName = "Support Assistant", Description = "Answers order and shipping questions.", Instructions = "You are a support assistant. Answer briefly and clearly.", Model = new ModelBinding { Provider = OpenAIProviderNames.ChatCompletions, Model = builder.Configuration["Tracon:Providers:OpenAI:DefaultModel"] ?? throw new InvalidOperationException("Configure an OpenAI chat model."), },});
var app = builder.Build();
app.MapTracon("/tracon");app.Run();This first agent uses a chat model only. To let a later agent generate stored image
attachments, add UseOpenAIImages(...), set Tracon:Images:Enabled, and choose
an image model explicitly. An image model is not inferred from this agent’s chat
model; see image generation providers.
dotnet run --urls http://localhost:5081The host listens on http://localhost:5081. Open
http://localhost:5081/tracon for the console. Provider model names are explicit
configuration: Tracon does not ship a built-in model list.
The source template remains available in the repository for readers who want to inspect its generated application. A published-template install command will be added when a release is available.
Run it
Section titled “Run it”In the console. Open /tracon, pick Playground, choose support, and
send a message. The reply streams in; tool calls appear as cards with their arguments
and results.
Over HTTP. The same run, as a server-sent event stream:
curl -N -X POST http://localhost:5081/tracon/api/agents/support/run \ -H 'Content-Type: application/json' \ -d '{"message":"Where is order 4182?"}'From an OpenAI client. The compatible endpoint accepts the familiar wire format.
Point the client at Tracon, provide its authentication, and use the agent name as
the model:
curl -X POST http://localhost:5081/tracon/v1/responses \ -H 'Content-Type: application/json' \ -d '{"model":"support","input":"Where is order 4182?"}'Here model is the agent name. Which model it actually calls is the agent’s
business, not the caller’s.
Look at what happened
Section titled “Look at what happened”Run recording is on by default for agents resolved through the catalog. In the console, open Runs: status, duration, token counts, cost when pricing is configured, and the ordered event stream. Over HTTP it is the same data:
curl http://localhost:5081/tracon/api/runscurl http://localhost:5081/tracon/api/runs/{runId}curl -N http://localhost:5081/tracon/api/runs/{runId}/eventsNo additional recording registration is needed for this catalog-resolved agent. Recording can be disabled. A store failure is also best-effort: it is logged and the agent still runs, so observability cannot take down product functionality.
What you have
Section titled “What you have”An agent defined in code, a console, and a recorded history — with no database. Every store is in memory, so all of it ends when the process does.
Read next
Section titled “Read next”- Adding a tool — register a C# method the model can call.
- Persistence — retain definitions and run records across restarts.
- Securing the endpoints — configure authorization before exposing the host.