Summary#
An agent is something you declare, and calling it is calling a name. Its declaration supplies its instructions, its tools and its model, so the call site stays about what you are asking rather than about how the model is configured.
using Osyrin.Agents;
[Principal] entity User {
[Required, MaxLength(100)] string DisplayName;
security { allow read when IsAuthenticated; allow create when IsAuthenticated || IsAnonymous; }
}
agent Support {
Purpose = "Answer questions about an order.";
Prompt = "You answer order questions from the context you are given.";
Principal = new User { DisplayName = "Support" };
}
string Answer(string question) {
var turns = new List<Turn>();
turns.Add(Turn.User(question));
return Support.Ask(turns).Text;
}Description#
You hand it the turns it should see. There is no hidden session: the question, the history worth replaying and the context you assembled are the argument (running an agent from your code). What it "remembers" is what you passed — see agent conversation memory (using Osyrin.Agents) for the shapes that are worth passing and the ones that are not.
Every run is a task, recorded. Cost, duration and outcome are captured whether or not you look (the agent task log (AgentTask)). watching a task run (task.Watch) follows one in flight, what the agent saw (task.Transcript) reads what it actually said and did, what a task cost, and what it did (task.Calls) lists the tools it reached for, and stopping work (task.Stop) ends one.
The model is a declaration, not a call-site argument. app.Models — the models an app admits, each with a name is how a model is named and default LLM model (app.DefaultModel) what a call gets when it names none — so changing which model an agent uses is an edit in one place, not a sweep of call sites.
A long-running agent is a workflow, not a loop you write. the agent loop (app.Agent, Loop) is the shape for repeated turns, and an agent asking a person (the human slot) is how a person is brought into one — which is a parking point, with everything the workflow area says about surviving a deploy. what an agent hands back (AgentDeliverable) is how a run's output becomes something the app holds.
The pages#
Run osy docs agent for the full listing.
- Calling one — running an agent from your code, agent conversation memory (using Osyrin.Agents), the agent loop (app.Agent, Loop)
- Which model — app.Models — the models an app admits, each with a name, default LLM model (app.DefaultModel)
- People in the loop — an agent asking a person (the human slot), what an agent hands back (AgentDeliverable)
- Watching a run — the agent task log (AgentTask), watching a task run (task.Watch), what the agent saw (task.Transcript), what a task cost, and what it did (task.Calls), stopping work (task.Stop)
See also#
- running an agent from your code — the call, and what a turn list is for
- the agent task log (AgentTask) — what every run records, without being asked
- an agent asking a person (the human slot) — bringing a person in, and why that makes it a parking point