Module: RobotLab
- Defined in:
- lib/robot_lab.rb,
lib/robot_lab.rb,
lib/robot_lab/task.rb,
lib/robot_lab/tool.rb,
lib/robot_lab/error.rb,
lib/robot_lab/robot.rb,
lib/robot_lab/utils.rb,
lib/robot_lab/config.rb,
lib/robot_lab/memory.rb,
lib/robot_lab/waiter.rb,
lib/robot_lab/message.rb,
lib/robot_lab/network.rb,
lib/robot_lab/version.rb,
lib/robot_lab/ask_user.rb,
lib/robot_lab/bus_poller.rb,
lib/robot_lab/mcp/client.rb,
lib/robot_lab/mcp/server.rb,
lib/robot_lab/run_config.rb,
lib/robot_lab/agent_skill.rb,
lib/robot_lab/convergence.rb,
lib/robot_lab/script_tool.rb,
lib/robot_lab/state_proxy.rb,
lib/robot_lab/tool_config.rb,
lib/robot_lab/robot_result.rb,
lib/robot_lab/user_message.rb,
lib/robot_lab/memory_change.rb,
lib/robot_lab/robot_message.rb,
lib/robot_lab/text_analysis.rb,
lib/robot_lab/tool_manifest.rb,
lib/robot_lab/streaming/events.rb,
lib/robot_lab/delegation_future.rb,
lib/robot_lab/streaming/context.rb,
lib/robot_lab/doom_loop_detector.rb,
lib/robot_lab/history_compressor.rb,
lib/robot_lab/mcp/transports/sse.rb,
lib/robot_lab/agent_skill_catalog.rb,
lib/robot_lab/mcp/transports/base.rb,
lib/robot_lab/robot/bus_messaging.rb,
lib/robot_lab/mcp/server_discovery.rb,
lib/robot_lab/mcp/transports/stdio.rb,
lib/robot_lab/robot/history_search.rb,
lib/robot_lab/robot/mcp_management.rb,
lib/robot_lab/mcp/connection_poller.rb,
lib/robot_lab/mcp/transports/websocket.rb,
lib/robot_lab/robot/template_rendering.rb,
lib/robot_lab/robot/agent_skill_matching.rb,
lib/robot_lab/streaming/sequence_counter.rb,
lib/robot_lab/mcp/transports/streamable_http.rb
Overview
Define the module first so Zeitwerk can populate it
RobotLab is a Ruby framework for building and orchestrating multi-robot LLM workflows. It provides a modular architecture with adapters for multiple LLM providers (Anthropic, OpenAI, Gemini), MCP (Model Context Protocol) integration, streaming support, and history management.
Defined Under Namespace
Modules: Convergence, MCP, ScriptTool, Streaming, TextAnalysis, ToolConfig, Utils Classes: AgentSkill, AgentSkillCatalog, AskUser, AwaitTimeout, BusError, BusPoller, Config, ConfigurationError, DelegationFuture, DependencyError, DoomLoopDetector, Error, HistoryCompressor, InferenceError, MCPError, Memory, MemoryChange, Message, Network, RactorBoundaryError, RedisBackend, Robot, RobotMessage, RobotResult, RunConfig, StateProxy, Task, TextMessage, Tool, ToolCallMessage, ToolError, ToolLoopError, ToolManifest, ToolMessage, ToolNotFoundError, ToolResultMessage, UserMessage, Waiter
Constant Summary collapse
- VERSION =
"0.2.1"
Class Method Summary collapse
-
.build(name: "robot", template: nil, system_prompt: nil, context: {}, enable_cache: true, bus: nil, skills: nil, config: nil) ⇒ Robot
Factory method to create a new Robot instance.
-
.config ⇒ Config
Returns the Config object (MywayConfig-based).
-
.configure {|Config| ... } ⇒ Config
Yields the Config object for block-style configuration.
-
.create_memory(data: {}, enable_cache: true) ⇒ Memory
Factory method to create a new Memory object.
-
.create_network(name:, concurrency: :auto, config: nil) { ... } ⇒ Network
Factory method to create a new Network of robots.
-
.extension(name) ⇒ Object
Returns the module registered for the named extension, or nil.
-
.extension_loaded?(name) ⇒ Boolean
Returns true if the named extension gem has been loaded.
-
.loaded_extensions ⇒ Array<Symbol>
Returns the list of registered extension names.
-
.register_extension(name, mod) ⇒ Object
Registers an extension gem so core can detect it without depending on it.
-
.reload_config! ⇒ Config
Reload configuration from all sources.
Class Method Details
.build(name: "robot", template: nil, system_prompt: nil, context: {}, enable_cache: true, bus: nil, skills: nil, config: nil) ⇒ Robot
Factory method to create a new Robot instance.
181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/robot_lab.rb', line 181 def build(name: "robot", template: nil, system_prompt: nil, context: {}, enable_cache: true, bus: nil, skills: nil, config: nil, **) Robot.new( name: name, template: template, system_prompt: system_prompt, context: context, enable_cache: enable_cache, bus: bus, skills: skills, config: config, ** ) end |
.config ⇒ Config
Returns the Config object (MywayConfig-based).
Configuration is automatically loaded from:
-
Bundled defaults (lib/robot_lab/config/defaults.yml)
-
Environment-specific overrides (development, test, production)
-
XDG config files (~/.config/robot_lab/config.yml)
-
Project config (./config/robot_lab.yml)
-
Environment variables (ROBOT_LAB_*)
127 128 129 |
# File 'lib/robot_lab.rb', line 127 def config @config ||= Config.new.tap(&:after_load) end |
.configure {|Config| ... } ⇒ Config
Yields the Config object for block-style configuration.
140 141 142 |
# File 'lib/robot_lab.rb', line 140 def configure yield config end |
.create_memory(data: {}, enable_cache: true) ⇒ Memory
Factory method to create a new Memory object.
243 244 245 |
# File 'lib/robot_lab.rb', line 243 def create_memory(data: {}, enable_cache: true, **) Memory.new(data: data, enable_cache: enable_cache, **) end |
.create_network(name:, concurrency: :auto, config: nil) { ... } ⇒ Network
Factory method to create a new Network of robots.
223 224 225 |
# File 'lib/robot_lab.rb', line 223 def create_network(name:, concurrency: :auto, config: nil, &) Network.new(name: name, concurrency: concurrency, config: config, &) end |
.extension(name) ⇒ Object
Returns the module registered for the named extension, or nil.
101 102 103 |
# File 'lib/robot_lab.rb', line 101 def extension(name) @extensions[name] end |
.extension_loaded?(name) ⇒ Boolean
Returns true if the named extension gem has been loaded.
94 95 96 |
# File 'lib/robot_lab.rb', line 94 def extension_loaded?(name) @extensions.key?(name) end |
.loaded_extensions ⇒ Array<Symbol>
Returns the list of registered extension names.
108 109 110 |
# File 'lib/robot_lab.rb', line 108 def loaded_extensions @extensions.keys end |
.register_extension(name, mod) ⇒ Object
Registers an extension gem so core can detect it without depending on it.
Extension gems call this at load time to announce themselves. Core uses extension_loaded? to guard optional behavior instead of defined?/respond_to?.
87 88 89 |
# File 'lib/robot_lab.rb', line 87 def register_extension(name, mod) @extensions[name] = mod end |
.reload_config! ⇒ Config
Reload configuration from all sources.
Clears the cached Config instance, forcing it to be reloaded on next access.
150 151 152 153 |
# File 'lib/robot_lab.rb', line 150 def reload_config! @config = nil config end |