Your first agent¶
Register an agent on the server, sign in as a user, and run it with one of the SDKs.
Server version
Agents need a Fadenstack server from the next release, after 0.4.1.
1. Register the agent¶
An agent is created on the server by an administrator:
- In the console, open Agents and choose New agent.
- Start blank, or from an app (Chrome, Word, Excel, PowerPoint, Outlook) to get a ready set of instructions and tools.
- Give it an address, for example
my-assistant. Lower-case letters, digits and hyphens; it cannot be changed later. Your code uses this address. - Pick the model that answers, and grant the agent to the people or teams who may use it.
- Publish it.
The agent's instructions, model, knowledge and tools now live on the server. Your code never sees the instructions; it gets a profile with what it needs. See Agents on the server.
2. Sign in as a user¶
Agents act for a person. The user signs in once per device: the SDK exchanges the user's login for an agent sign-in that is kept on that device and renews itself. The password or login token is used once and not stored.
3. Run it¶
The console sample is a complete agent with host tools, approvals in the terminal, and /mode and /sessions commands:
dotnet run --project samples/Faden.Samples.Console -- \
--server https://ai.example.internal --agent my-assistant --login-token <token>
Then read Build an agent to write your own.
import { FadenClient, loginWithPassword } from "@fadenstack/client";
import { FadenAgent } from "@fadenstack/agents";
const { client, tokens } = FadenClient.forAgent({ serverUrl: "https://ai.example.internal", agent: "my-assistant", store });
if (!(await tokens.isSignedIn())) {
const login = await loginWithPassword({ apiUrl: "https://ai.example.internal", email, password });
await tokens.signIn(login, "My laptop");
}
const agent = FadenAgent.createBuilder().useClient(client).build();
const session = await agent.startSession();
const result = await session.send("Hello! What can you do?");
console.log(result.outcome);
Then read Build an agent to write your own.
4. Approve the app's tools¶
When your app connects, the SDK reports the app and the tools it brings. When the agent's tool contract is not empty, the model is not offered the tools it does not list until an administrator accepts them.
The administrator opens the agent's Apps tab, where each tool is marked as new, changed, riskier or unused, and clicks Accept and publish. A later version of your app that brings a new or riskier tool waits for the same review.
Next¶
- Tools and approvals: how tool classes and modes decide what runs.
- Outcomes: how a turn ends, including refusals.