Agents are the building blocks of Zero-Employee Enterprise. They are the ones that do the work. Agents are stateless and have a single purpose and can optionally use Tools to help them achieve their goal.

Agents can be called individually or composed together to form a ZEE to iteratively and collaboratively solve complex problems.

Creating an Agent

The simplest way to create an Agent is to use initialize an Agent with a model, description, instructions and optionally tools.

const agent = new Agent({
    name: "Reporting Agent",
    model: {
        provider: "openai",
        id: "gpt-4o-mini",
    },
    description: "This agent is responsible for generating reports",
    instructions: [
        "Generate a report on the current state of the company",
        "Use the following tools to help you generate the report",
    ],
});

Adding tools

Tools are optional and can be added to an Agent to extend its capabilities. Tools are included in the calls to the language model through the tools property.

Tools are created using the Tool class and can be sent to the agent using the tools property during initialization.

const agent = new Agent({
    name: "Reporting Agent",
    ...
    tools: {
        tool1,
        tool2,
        tool3,
    },
});

Read more about Tools to learn how to create them.

Running an Agent

Agents can be run standalone or as part of a ZEE workflow. Running an agent standalone is useful for testing and debugging. The generate method will run the agent standalone.

const result = await agent.generate({
    messages: [userMessage("What is the current state of the company?")],
});

Running an agent as part of a ZEE workflow is useful for solving complex problems. Read more about ZEE to learn how to run agents in a ZEE workflow.