Installation¶
This guide covers installing RobotLab in your Ruby project.
Requirements¶
- Ruby: 3.2 or higher
- Bundler: 2.0 or higher (recommended)
Install via Bundler¶
Add RobotLab to your Gemfile:
Then install:
Install via RubyGems¶
Or install directly:
Dependencies¶
RobotLab automatically installs these core dependencies:
| Gem | Purpose |
|---|---|
ruby_llm (~> 1.12) |
LLM provider integrations (Anthropic, OpenAI, Gemini, etc.) |
prompt_manager (~> 1.0) |
Template-based prompt management with YAML front matter |
simple_flow (~> 0.3) |
Pipeline workflow execution for networks |
myway_config (~> 0.1) |
Layered configuration (defaults, env vars, config files) |
ruby_llm-mcp |
Model Context Protocol client for external tool servers |
ruby_llm-schema |
Schema validation for structured outputs |
ruby_llm-semantic_cache |
Semantic caching for LLM responses |
zeitwerk (~> 2.6) |
Autoloading and eager loading |
async (~> 2.0) |
Fiber-based concurrency |
Optional Dependencies¶
For specific features, you may need additional gems:
Verify Installation¶
Create a test file to verify everything works:
# test_robot_lab.rb
require "robot_lab"
puts "RobotLab version: #{RobotLab::VERSION}"
puts "Installation successful!"
Run it:
Rails Installation¶
For Rails applications, use the install generator:
This creates:
config/initializers/robot_lab.rb- Configuration filedb/migrate/*_create_robot_lab_tables.rb- Database migrationsapp/models/robot_lab_thread.rb- Thread modelapp/models/robot_lab_result.rb- Result modelapp/robots/- Directory for robot definitionsapp/tools/- Directory for tool definitions
Then run migrations:
Environment Setup¶
RobotLab uses a layered configuration system (see Configuration for full details). The simplest way to get started is with environment variables:
Using dotenv
For development, consider using the dotenv gem to manage environment variables:
Direct provider env vars
RubyLLM also reads provider-specific environment variables directly (e.g., ANTHROPIC_API_KEY). If you already have those set, they will be picked up automatically. The ROBOT_LAB_RUBY_LLM__* prefix gives you explicit control through RobotLab's config layer.
Troubleshooting¶
Gem Installation Fails¶
If you encounter SSL or network errors:
# Update RubyGems
gem update --system
# Try installing with verbose output
gem install robot_lab --verbose
Missing Dependencies¶
If you see "LoadError" for optional gems:
API Key Issues¶
If you see authentication errors:
- Verify your API key is set:
echo $ROBOT_LAB_RUBY_LLM__ANTHROPIC_API_KEY - Check the key is valid in your provider's console
- Ensure you're using the correct environment variable name
Next Steps¶
Now that RobotLab is installed:
- Quick Start - Build your first robot
- Configuration - Configure defaults