v2.0.0
v2.0.0 — Major Schema Overhaul
Added
before_callandafter_callcallbacks — Agent-level hooks that run before and after LLM calls. Use method names or blocks.- Simplified DSL with prompt-centric syntax — New inline prompt syntax for more concise agent definitions.
- Execution details table — Large payloads (prompts, responses, tool calls, error messages) split into a separate
ruby_llm_agents_execution_detailstable for better query performance. - Tenants table — New
ruby_llm_agents_tenantstable with DB counter columns for efficient budget tracking. - Database-agnostic metadata JSON queries — Helper methods for querying JSON metadata across SQLite and PostgreSQL.
- Class-level schema DSL — Define response schemas directly in agent classes.
- Upgrade generator — Run
rails generate ruby_llm_agents:upgradeto automatically migrate from v1.x to v2.0.
Changed (Breaking)
- Schema split — Detail columns moved from
executionstoexecution_details. Existing code still works via delegation. - Niche fields moved to metadata JSON —
time_to_first_token_ms,rate_limited,retryable,fallback_reason,span_id,response_cache_key. - Renamed
execution_metadatatometadatathroughout the codebase. - LLMTenant concern uses
foreign_key: :tenant_idinstead of polymorphic association. - Dashboard redesigned with compact layout and sortable columns.
Removed (Breaking)
- Workflow orchestration subsystem
versionDSL method (cache keys are now content-based)ApiConfigurationtable (use environment variables)- Built-in moderation system (use
before_callhook) - Built-in PII redaction (use
before_callhook) - Image content policy
Fixed
- Agent show pages crashing due to analytics querying removed columns
with_parameterscope now correctly queriesexecution_detailstable- Migration and upgrade path for both fresh installs and version upgrades
- LLMTenant executions association using correct
tenant_idforeign key
Upgrading from v1.x
rails generate ruby_llm_agents:upgrade
rails db:migrateThe generator will automatically create the new tables and migrate your data. See the CHANGELOG for the full migration guide.