Skip to content

Conversation

@adham90
Copy link
Owner

@adham90 adham90 commented Feb 5, 2026

Summary

This PR introduces a major simplification of the ruby_llm-agents gem:

  • Simplified Agent DSL - Prompts as first-class citizens with {placeholder} syntax
  • Removed Workflow Subsystem - Eliminated complex workflow orchestration in favor of simpler patterns
  • Removed PII Redaction & Content Moderation - Removed built-in moderation features (use external tools)
  • Simplified Alert System - Single on_alert handler replaces built-in notifiers
  • Removed API Configuration DB Table - Simplified configuration management
  • Database Schema Cleanup - Removed unused columns and tables

New Simplified DSL

class SearchIntentAgent < ApplicationAgent
  model "gpt-4o"
  temperature 0.0

  # Prompts with {placeholder} syntax - params auto-registered
  system "You are a search intent analyzer."
  prompt "Extract search intent from: {query}"

  # Structured output with returns DSL
  returns do
    string :refined_query, description: "Cleaned search query"
    array :filters, of: :string, description: "Extracted filters"
  end

  # Simplified error handling
  on_failure do
    retries times: 3, backoff: :exponential
    fallback to: ["gpt-4o-mini", "claude-3-5-sonnet"]
    circuit_breaker after: 10, within: 60, cooldown: 5.minutes
    timeout 30
  end

  # Caching and callbacks
  cache for: 1.hour
  before { |ctx| Rails.logger.info("Starting...") }
  after { |ctx, result| Rails.logger.info("Done!") }
end

Breaking Changes

  • Workflow orchestration removed (use simple Ruby patterns instead)
  • PII redaction removed (use external tools like Presidio)
  • Content moderation removed (implement as regular agents)
  • Alert notifiers removed (use single on_alert handler)
  • API configuration database table removed

Migration

Run the upgrade generator:

rails generate ruby_llm_agents:upgrade
rails db:migrate

Test plan

  • All 3524 specs pass
  • Wiki documentation updated
  • README updated with new DSL examples
  • Example agents updated to use simplified DSL
  • Backward compatibility maintained for existing agent code

🤖 Generated with Claude Code

- Move large payload fields (prompts, responses, attempts, tool calls,
  etc.)
  from ruby_llm_agents_executions into ruby_llm_agents_execution_details
  table
- Add ExecutionDetail model with delegated accessors in Execution
- Update migrations to support splitting and backfilling existing data
- Refactor tenant budget alias with deprecation warning
- Adjust generators to create execution_details migration
- Update tests and factories to use detail association for detail fields
- Remove file migration from upgrade generator (file migration
  deprecated)
Delete `ruby_llm_agents_api_configurations` table and all associated
model,
controller, views, tests, and generators. Migrate API key and connection
settings management fully to environment variables and ruby_llm gem
config.

This simplifies the codebase, improves security by avoiding storing keys
in
the database, and aligns with 12-factor app principles.

Update docs and remove UI for managing API keys and per-tenant
overrides.

Migration drops the table with irreversible down. Users must export
existing
keys and configure via environment variables and RubyLLM initializer.
- Delete all workflow runtime code, DSL, and helpers
- Remove workflow generators, templates, and docs
- Remove workflow controllers, views, models, and helpers
- Remove workflow-related configuration and routing
- Remove workflow instrumentation and callbacks
- Remove workflow tests and specs
- Clean workflow-specific columns from migrations and models
- Remove approval and notifier classes related to workflows
- Remove references to workflows from helpers and application code
- Remove workflow UI components and badges
- Remove workflow example apps and sample workflows
- Update README to omit workflow references and features
Replace all Slack, webhook, and email notifier integrations with a
single user-configurable `on_alert` proc and
ActiveSupport::Notifications
emission. Remove AlertMailer, templates, and configuration related to
notifiers. Keep alert event dispatching, dashboard caching, and event
payload schema. Update specs and docs accordingly.
Replace deprecated config.alerts hash with a unified config.on_alert
callback.
Update documentation and examples to illustrate declarative event
filtering,
custom routing, severity handling, and integration with Slack,
PagerDuty,
webhooks, email, and ActiveSupport::Notifications.
redaction

- Add `before_call` and `after_call` callbacks for conversation agents
- Remove built-in moderation DSL, execution, classes, and example agents
- Remove PII redaction utility and configuration options
- Remove content policy enforcement for image agents
- Clean up references, specs, and dashboard related to moderation and
  redaction
Eliminate PII redaction and moderation config, callbacks, UI links,
examples, and references to simplify the codebase and documentation.
Dropped version attribute and references for cache invalidation to rely
on
content-based cache keys. Updated database schema, filters, views,
specs,
generators, and documentation accordingly.
Add execution_details table for detailed execution data storage and
clean up UI to omit workflow-related badges and filters since workflows
feature was removed.
- Add simplified DSL reference and example agent for concise prompt
  setup
- Enable `prompt` DSL with placeholder param auto-registration
- Provide `system`, `returns`, `on_failure`, `cache`, `before`, and
  `after` as simple unified methods
- Update base agent and DSL modules to support simplified prompt and
  system methods
- Add comprehensive tests covering simplified DSL usage and inheritance
- Document simplified DSL with usage examples and best practices
- Replace string delimiters with double quotes for consistency
- Use system, prompt, and returns blocks for prompt and output
  definitions
- Simplify caching syntax with `cache for:` instead of `cache_for`
- Replace reliability block with `on_failure` for error handling DSL
- Remove deprecated param and prompt methods in favor of simplified DSL
- Update comments and examples to reflect new simplified syntax
- Limit activity chart ranges to today, 7d, and 30d (remove custom and
  compare options)
- Simplify range display helper to match allowed ranges
- Remove model cost breakdown partial and now strip partial from
  dashboard views
- Update dashboard view to show concise activity summary with fixed
  range options and streamlined metrics
- Adjust chart container height and styling accordingly
Refactor dashboard index view to redesign the Activity section layout
and
update the activity chart styling and scripting for improved appearance
and consistency.
- Use monospace fonts and refined color palette in charts
- Replace tables with compact flexbox lists for agents, errors, and
  models
- Simplify and restyle recent activity section with status dots and cost
  display
- Adjust chart height and improve tooltip styling and formatting
- Update range selector styles and layout for better usability
- Simplify and unify layout of config partials for agents, embedders,
  image generators,
  moderators, speakers, and transcribers using compact, monospaced, and
  color-coded design
- Improve circuit breaker, reliability, parameters, and tools display
  with clearer visuals
- Redesign agent show page header, stats, filters, executions table,
  charts, and finish reasons
  for better readability and UX using a monospaced font and compact
  styling
- Replace tables with accessible flexbox layouts in executions list for
  responsiveness
- Update status badges and filter dropdowns for a cleaner, modern
  appearance
- Add TailwindCSS type to styles and adjust badge dark mode colors
- Replace status dots with badges for agent and executions tables
- Add today’s stats and error sparklines on agent show page
- Show tools and parameters with badges on agent detail view
- Make executions table hide agent column optionally and use badges for
  status
- Replace table with flex-based list for better responsiveness
- Implement inline sort links with active indicators
- Show tenant column conditionally for multi-tenant setups
- Simplify pagination controls with minimal styling
- Update status badges for consistent styling and smaller size
- Streamline executions header styling and layout
- Remove redundant container classes in filters partial
- Replace breadcrumbs with compact back link
- Simplify header with inline badges and info
- Convert stats and token usage to inline rows
- Redesign attempts table with badges and expandable stack traces
- Restyle error, parameters, response, and tool calls sections
- Improve copy buttons and consistent font sizing
- Streamline badge CSS classes and markup structure
- Simplify error messages in tenant form and unify styling
- Replace headers with small caps section titles using monospaced font
- Update tenant list to use compact list layout with badges and hover
  navigation
- Revamp tenant show page with concise header, usage bars, and per-agent
  limits section
- Replace breadcrumbs with simple back links across tenant views
- Standardize font sizes, colors, and spacing for clarity and
  consistency
Rewrite system configuration view to use a clean,
sectioned layout with badges and concise labels.
Remove legacy card styles and improve readability.
- Update badge styles to use consistent "badge-sm" class and improved
  colors
- Simplify tenant budget, action center, and empty state views with
  cleaner layouts
- Remove unused partials: _alerts_feed, _breaker_strip, _budgets_bar,
  _nav_link, _stat_card, _breadcrumbs, _agent.html.erb
- Adjust action center alert styling for compactness and clarity
- Minor style fixes for enabled badge and agent type badge colors
- Add ruby_llm_agents_execution_details table with detailed execution
  info
- Rename tenant_budgets table to tenants and add active and metadata
  columns
- Remove deprecated agent_version column from executions
- Remove workflow_id, workflow_type, and workflow_step columns from
  executions
- Ensure idempotent migration steps and preserve existing data
  throughout upgrades
@angelDrivana
Copy link

Why such a small change? xd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants