staff_ai

Types

Represents an AI worker in a staff system

It represents the most simple unit of you staff who can be assigned to a task. Agent has a name, a list of skills and a list of tasks, which he is currently working on.

pub type Agent {
  Agent(
    id: UUID,
    name: String,
    role: String,
    context: Option(String),
  )
}

Constructors

  • Agent(
      id: UUID,
      name: String,
      role: String,
      context: Option(String),
    )

    Arguments

    • id

      Unique identifier of the agent

    • name

      Name of the agent, which is used to identify him in your system. It can be a real name or a nickname, e.g. “Jane Doe” or “jane_doe”

    • role

      Role of the agent, which is used to identify his skills and responsibilities in your system. It can be a real role or a nickname, e.g. “Software Developer” or “dev”

    • context

      Adding a context to an agent is optional, but it can be useful to store additional information about the agent. It can be used to store additional information about the agent as it will influence the way it reacts to tasks. E.g. “Jane Doe is a technical lead of the project X. She is responsible for the architecture and …”

Squad is a group of agents that can are working together on a specific Objective.

It represents isolated groups of agents with diverse skills and responsibilities. The squad has a name, an objective and a list of agents, which are part of the squad.

pub type Squad {
  Squad(
    id: UUID,
    name: String,
    objective: String,
    agents: List(Agent),
    tasks: List(Task),
  )
}

Constructors

  • Squad(
      id: UUID,
      name: String,
      objective: String,
      agents: List(Agent),
      tasks: List(Task),
    )

    Arguments

    • id

      Unique identifier of the squad

    • name

      Name of the squad, which is used to identify it in your system. It can be a real name or a nickname, e.g. “Software Development Team” or “dev_team”

    • objective

      Objective of the squad, which is used to identify the goal of the squad in your system. It can be a real objective or a nickname, e.g. “Develop the new feature X” or “feature_x” The objective should be as clear as possible to be sub-divided into granular tasks.

    • agents

      The list of agents that are part of the squad, this list can evolve over time.

    • tasks

      The list of tasks that are part of the squad, this list will evolve over time as tasks are created and completed.

A task that can be performed by an agent

It represents the most simple unit of work that an Agent can perform. The task can involve any input and output, but it is expected to be a small unit of work that can be performed in a short amount of time.

pub type Task {
  Task(
    id: UUID,
    title: String,
    description: String,
    status: TaskStatus,
    assigned_agent: Option(UUID),
    created_at: birl.Time,
    updated_at: birl.Time,
    completed_at: Option(birl.Time),
    cancelled_at: Option(birl.Time),
    failed_at: Option(birl.Time),
  )
}

Constructors

  • Task(
      id: UUID,
      title: String,
      description: String,
      status: TaskStatus,
      assigned_agent: Option(UUID),
      created_at: birl.Time,
      updated_at: birl.Time,
      completed_at: Option(birl.Time),
      cancelled_at: Option(birl.Time),
      failed_at: Option(birl.Time),
    )

    Arguments

    • id

      The unique identifier of the task

    • title

      A meaningful title of the task

    • description

      A description of the task, must be detailed enough to be performed

    • status

      The status of the task

    • assigned_agent

      The unique identifier of the agent that has been assigned to perform the task

    • created_at

      The time when the task was created

    • updated_at

      The time when the task was last updated

    • completed_at

      The time when the task was completed

    • cancelled_at

      The time when the task was cancelled

    • failed_at

      The time when the task has failed

The status of the task

pub type TaskStatus {
  Ready
  InProgress
  Completed
  Cancelled
  Failed
}

Constructors

  • Ready

    The task is ready to be performed

  • InProgress

    The task is currently being performed

  • Completed

    The task has been completed

  • Cancelled

    The task has been cancelled

  • Failed

    The task has failed

Represents a unique identifier, which is a string in the UUID format.

pub type UUID =
  String

Functions

pub fn create_agent(
  name: String,
  role: String,
  context: Option(String),
) -> Agent

Creates a new agent with the given parameters.

pub fn create_squad(
  name: String,
  objective: String,
  agents: List(Agent),
  tasks: List(Task),
) -> Squad

Creates a new squad with the given parameters.

pub fn create_task(
  title: String,
  description: String,
  assigned_agent: Option(String),
) -> Task

Create a new task

Search Document