# Class LittleGhost::Subagents::Definition

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/Subagents/Definition.html

A Definition describes one kind of agent available for delegation. Most
applications create definitions through Agent::Delegation#subagent.

The factory receives the complete agent path and may also accept
`runtime:`. When `accepts_conversation_id` is true it receives the
durable conversation UUID as a second positional argument. Factories returning
a LittleGhost::Agent must construct it with the supplied path as `agent_path`;
the conversation UUID is a separate persistence identifier.

    # ResearchAgent is defined by the application.
    definition = LittleGhost::Subagents::Definition.new(
      kind: "research",
      description: "Investigates a bounded question",
      factory: ->(agent_path) { ResearchAgent.new(agent_path:) }
    )
    definition.kind # => "research"

## Inheritance

`LittleGhost::Subagents::Definition < Object`

## Attributes

<a id="attribute-i-accepts_conversation_id"></a>
### `accepts_conversation_id` (R)

The model-visible kind and description, callable factory, persistence policy,
and factory-arity declaration.

<a id="attribute-i-description"></a>
### `description` (R)

The model-visible kind and description, callable factory, persistence policy,
and factory-arity declaration.

<a id="attribute-i-factory"></a>
### `factory` (R)

The model-visible kind and description, callable factory, persistence policy,
and factory-arity declaration.

<a id="attribute-i-kind"></a>
### `kind` (R)

The model-visible kind and description, callable factory, persistence policy,
and factory-arity declaration.

<a id="attribute-i-persist"></a>
### `persist` (R)

The model-visible kind and description, callable factory, persistence policy,
and factory-arity declaration.

## Class methods

<a id="method-c-new"></a>
### `.new`

```ruby
.new(kind:, description:, factory:, persist: true, accepts_conversation_id: false)
```

Validates a definition. `persist` is effective only when the manager has a
parent session.
