Module: LittleGhost::Agent::Delegation
- Included in:
- LittleGhost::Agent
- Defined in:
- lib/little_ghost/agent/delegation.rb
Overview
Give one agent a bounded way to ask another agent for help. Delegated agents can run as managed subagents or behind an ordinary tool call.
class CustomerSupportAgent < LittleGhost::Agent
subagent ResearchAgent, kind: "research"
agent_as_tool SentimentAgent, name: "classify_sentiment"
end
The support model receives spawn, messaging, interruption, waiting, and
listing tools for the research kind. It sees the sentiment agent as one
regular tool whose result is returned to the current turn.
Static declarations may be combined with a resolver that returns dynamic Subagents::Definition objects. Managed conversations persist when a session store is configured unless persist: false keeps them local to one invocation. An agent exposed as a tool starts with empty history unless preserve_context: true serializes calls and retains its history.
Tool overrides must be classes. A delegated agent otherwise receives only its own declared tools; it does not inherit the parent's registry. The manager enforces its concurrency, identity, polling, and persistence bounds.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.included(base) ⇒ Object
:nodoc:.
Class Method Details
.included(base) ⇒ Object
:nodoc:
27 28 29 30 31 32 33 34 |
# File 'lib/little_ghost/agent/delegation.rb', line 27 def self.included(base) # :nodoc: base.extend(ClassMethods) base.class_attribute :subagent_long_poll_duration_value, default: Subagents::Manager::DEFAULT_WAIT_TIMEOUT base.class_attribute :subagent_declarations_value, default: [] base.class_attribute :subagent_resolvers_value, default: [] base.class_attribute :agent_tool_declarations_value, default: [] end |