Skip to content
Croche / Developer docs

Agents

Read as Markdown

An agent is a conversational participant in your app: an assistant, a character, or a tutor.

Open a Croche project for a user, then open an agent from that project. The project holds configuration and tool handlers; each agent has its own conversation and memory.

In TypeScript:

const defaultAgent = await croche.agent();
const helper = await croche.agent('helper');

This fragment assumes an open project named croche. Declare helper in config.agents before opening it. The default agent is available through croche.agent().

Use an agent instance when the same kind of agent needs separate conversations, such as save slots or documents.

const savedGame = await croche.agent('helper', { instance: 'save-2' });
const newConversation = await croche.agent('helper', { fresh: true });

An instance is not a different app user. Keep user identities and storage boundaries explicit in your app.

Separate agents can have different instructions and visible tools. Those differences do not replace permission checks in your app’s tool handlers.

See tools and the TypeScript guide.