Osy#betaRun it on Osyrin: osyrin.com

Reference / Agent

Agents (a class with a job, its own account, a budget and a record)

An agent is a class of the `Osysharp.Agents` kit: a purpose, the skills it holds and what it may spend. A skill is a typed job whose tools are your app's own functions. The agent runs as an account of its own, never past what the person it works for may do, and every piece of work leaves a receipt and a record of each step. Under it, `Osysharp.Llm` is every model call: routed, budgeted and metered.

stableagentllmovervieworientation

Summary#

An agent is a class, and giving it work is a call. The class says what it is for and what it can be asked to do; a skill says what goes in, what comes back and which of your functions it may use.

Writing an agent — a class with a purpose, skills and an account of its own (Agents kit) is one agent whole — its class, its skill, its tools and its tests — compiled and run.

Description#

Its rights are declared, and they are a ceiling. The agent is an account holding the roles its class names. Working for a person, its tools read and change only what both may; a tool its skill does not list never runs (Writing an agent — a class with a purpose, skills and an account of its own (Agents kit), A skill — a typed job an agent can be given, its check and its tools (Agents kit)).

Work is typed, and every way out is a status. Do answers the skill's result type, checked, or says how the work ended; Ask answers in words; Stream hands an answer on as it arrives (Giving an agent work — Do, Ask, Stream, For and Decide (Agents kit)).

Every piece of work leaves a receipt and a record. Who asked, as whom it ran, what it cost, how it ended — and each step in a plain sentence, chained so a changed line is found (The receipt and the record — what every piece of an agent's work leaves (Agents kit)).

Money is a hard limit. Room is reserved before each call leaves; work whose money runs out is stopped and keeps what it did (What an agent may spend — a hard limit on every piece of work (Agents kit)).

Longer work has an owner. An assignment is a piece of work somebody asked for, owned until its criteria are met; an agent's work is attached to it, and what the agent finds is kept in its repository as items.

People are asked, and what waits for them waits. A question, an approval of one exact version of a thing, a form — put to a person in the inbox they already work, or to somebody with no account through a link — with the answer coming back to the process or the piece of work that waits for it (Requests to people — a question, an approval, a form, and the answer coming back (HumanRequests kit)).

It does alone only what it is trusted with. An agent's class says what it runs by itself, what it must propose to a person first, and what it never does; said nothing, it looks things up alone and proposes the rest. A proposal is the exact call, and a yes runs it as whoever said yes (What an agent does alone, what it proposes, what it never does — the gate and proposals (Agents kit)). In an app with the requests kit it is an approval in that person's inbox (An agent's proposals and questions in a person's inbox, and an inbox item in an agent's hands (Agents.HumanRequests kit)).

It can ask for help. An agent may name a more capable model to consult — by choice, when it is stuck, or when it is not sure of a decision (Asking for help — an agent that consults a more capable model (Agents kit)) — and, when its class says so, a person, whom its work then waits for however long that takes (An agent asks a person, and waits — the person rung of the ladder of help (Agents kit)).

It can hand work on. An agent's class may name skills of other agents — or of its own — that its model hands pieces of its work to, several at once. Each piece has its own receipt under the one that handed it on, is done for the same person, proposes what any piece of work above it would have to propose, and spends out of what is left above it (An agent hands work on to other agents — at once, typed, and never with more than it holds (Agents kit)).

It gets better through people. Somebody who sees its work corrects it; an instruction drawn from the correction reaches the agent only once a person the app trusts with that has made it active; every change to what it is told is a numbered set, a piece of work records the set it ran under, and the agent can be put back to an earlier one (Correcting an agent, and what it is told from then on — corrections, instructions, instruction sets and rollback (Agents kit), and its screens in Correct this, and an agent's Instructions page — the screens people teach an agent on (Agents.Teaching kit)).

Tests cost nothing. A test scripts what the model answers and asserts what the agent then did (Testing an agent without a model — Says, AgentScript and Trajectory (Agents.Testing kit)).

The pages#

Run osy docs agent for the full listing.

See also#

Related

Writing an agent — a class with a purpose, skills and an account of its own (Agents kit)

An agent is a class of the `Osysharp.Agents` kit: what it is for, the skills it holds, what it may spend. It runs as an…

A skill — a typed job an agent can be given, its check and its tools (Agents kit)

A skill is a class: what goes in, what comes back, and the app's own functions the agent may use to get there. The…

Giving an agent work — Do, Ask, Stream, For and Decide (Agents kit)

`Do` gives an agent a typed job and answers an `AgentOutcome<TOut>`: the checked result, how it ended, what it cost and…

What an agent does alone, what it proposes, what it never does — the gate and proposals (Agents kit)

An agent's class says what it may do alone, what it must propose to a person first, and what it never does — by what a…

An agent asks a person, and waits — the person rung of the ladder of help (Agents kit)

An agent that says so may put one focused question to a person: the model chooses to (a tool it is offered), or work…

An agent hands work on to other agents — at once, typed, and never with more than it holds (Agents kit)

An agent's class may name work it hands on: skills of other agents, or of its own done apart. Its model is offered each…

Guards and trying again — the app's own checks on an agent's work, and what happens when work fails (Agents kit)

A guard is a class of the app's that is asked at four points of every piece of an agent's work — before a request…

An agent's proposals and questions in a person's inbox, and an inbox item in an agent's hands (Agents.HumanRequests kit)

With the Agents kit and the HumanRequests kit both in an app, this bridge is there: what an agent proposes is an…

What an assignment asks of people — requests as an assignment's work and as inbox items (Assignments.WorkQueues kit)

With the Assignments kit and the HumanRequests kit both in an app, a request put for an assignment is a piece of the…

The receipt and the record — what every piece of an agent's work leaves (Agents kit)

Every piece of work leaves one receipt, `AgentTask` — who asked, the account it ran as, what it cost against its limit…

Correcting an agent, and what it is told from then on — corrections, instructions, instruction sets and rollback (Agents kit)

An agent gets better through people. Somebody who sees a piece of its work corrects it — what was wrong, what right…

Correct this, and an agent's Instructions page — the screens people teach an agent on (Agents.Teaching kit)

Osysharp.Agents.Teaching draws the two places people teach an agent. WorkTeaching(task) goes on the page of one piece…

Who is in charge of an app's agents — every policy in one table, pausing, sponsoring, and trying work again

One table of who may do what with an app's agents. An app answers UsesAgents and SupervisesAgents; supervising brings…

The management screens — where a person runs an app's agents (Agents.Management kit)

Osysharp.Agents.Management draws the place a person runs an app's agents from, eight screens under one path. Agents:…

Privacy for the agent family — agents, the model meter, assignments and work repositories under a person's request

An app that uses `Osysharp.Privacy` beside the agent kits gets a holder for each without writing one:…

What an agent may spend — a hard limit on every piece of work (Agents kit)

Every piece of work has a limit in dollars — the skill's `Budget`, else the agent's `Limits.PerTask`, else the app's…

Asking for help — an agent that consults a more capable model (Agents kit)

An agent can name one of the app's models to consult. The model doing the work may then ask it one focused question…

Testing an agent without a model — Says, AgentScript and Trajectory (Agents.Testing kit)

`Osysharp.Agents.Testing` scripts what the model answers, turn by turn, and reads back what the agent then did. Only…

The Llm kit — call a model, and know what each call cost

`Osysharp.Llm` is the road every model call takes, written in Osy#: the operator's AI switch, the app's router, a…

Model spend — budgets, the meter and the price book (Llm kit)

The Llm kit keeps three things about what model calls cost. The METER: one `ModelCall` row for every attempt, with the…

Typed answers from a model — Llm.Extract<T> and Llm.Decide<T> (Llm kit)

Two calls of the Llm kit that answer a VALUE instead of text. `Llm.Extract<T>` reads a `T` out of text: the model is…

Testing model calls without a model — ScriptedModel (Llm kit)

The Llm kit ships a provider whose answers a test writes. Name a `ScriptedModel` where a real provider would go, and…

turning AI off (the runtime switch)

An operator can switch an application's AI off while it runs — no recompile, no redeploy. Text generation and embedding…

[Actor] — a principal that code may run as

A class marked `[Actor]` declares a principal that code may run as: a robot, a nightly job, an integration, a digital…