Releases: adham90/ruby_llm-agents
Releases · adham90/ruby_llm-agents
v3.13.0
Added
- Two-tier data retention —
soft_purge_after(default 30 days) andhard_purge_after(default 365 days) config options with a newRetentionJobandrake ruby_llm_agents:purgetask. Soft pass destroysexecution_detailsandtool_executionswhile preserving execution records (and a truncatederror_messagein metadata) so error-rate trends survive the purge; hard pass destroys executions in batches with cascading deletes. Either tier can be set tonilto disable it - Searchable multi-select tenant filter — Executions page tenant filter now supports multi-select with a client-side search input.
_filter_dropdownpartial gains an opt-insearchable: trueflag; dropdown stays open while selecting and batches submissions on close - Routing
auto_delegate: false— Opt out of router auto-delegation to return a classification-onlyRoutingResultwithagent_classpopulated for manual dispatch (fixes #24) - Soft-purge execution UI — Banner on execution show page; detail-backed sections hide silently after purge; system config page surfaces both purge windows
Changed
- Bumped
ruby_llmdependency to>= 1.14.1 - Deprecated
retention_period— Now an alias forhard_purge_after - Dashboard override UI now renders for regular agents —
show.html.erbrendersconfig_<kind>for all agent kinds instead of skipping"agent" - Replaced internal-class mocks in specs — Image execution, reliability, builder, speaker, transcriber, and instrumentation specs now exercise real code paths; mocks retained only at external boundaries (LLM APIs, DB error injection, Rails cache edges)
Fixed
- Router stream block forwarding — Caller's stream block is now captured and forwarded to the delegated agent so streaming flows end-to-end (fixes #24)
- Failed image executions not persisted —
ImageOperationExecution#record_failed_executionpassederror_message:toExecution.create!, raisingActiveModel::UnknownAttributeErrorthat was silently swallowed. Split intoExecution.create!+execution.create_detail!(error_message:)to match the instrumentation middleware pattern - Audio player
response.digon String — AddedExecution#response_hashnormalizer that returns{}when the response is aString,Array, ornil; fixesundefined method 'dig' for Stringwhen agents write plain-text responses to the JSON column - Override reset button — Reset controls use
button_towithturbo_confirm; "reset all" moved outside the save-overrides form to stop submitting the outer PATCH
Full changelog: v3.12.0...v3.13.0
v3.12.0
Added
- Knowledge DSL — Inject domain knowledge into agent system prompts with
knows :refund_policy(static files) orknows(:data) { ... }(dynamic blocks). Supports conditional inclusion viaif:option, multi-entryknows :a, :b, :c, and automatic## Headingformatting. Defaultknowledge_pathisapp/agents/knowledge - Analytics page — Filterable cost intelligence dashboard with period-over-period comparison, daily cost chart overlay, model efficiency table, error cost breakdown, monthly projection, and savings opportunity detection
- Dashboard-overridable agent settings — Mark DSL fields with
overridable: true(e.g.,model "gpt-4o", overridable: true) to allow tuning from the dashboard without code deploys. Stored inagent_overridestable - Tenant dashboard enhancements — Analytics section with trend chart, usage breakdowns by model/agent, and refresh counters button on tenant show page
- Average cost/tokens per call — Agent show page now displays average cost and token usage per execution
Fixed
- Instrumentation middleware —
model_provider,chosen_model_id, andfinish_reasonnow correctly populate on execution records (fixes #23) check_total_timeout!math bug — Timeout error now reports the configured timeout value instead of an inflated number- Prior period boundary overlap — Analytics prior period scope uses exclusive range to prevent boundary-day double-counting
- Budget middleware double tenant lookup — Tenant record is now resolved once per request instead of twice (check + record)
trend_analysisN+1 queries — Replaced 28 individual queries (4 per day × 7 days) with a single GROUP BY querydaily_reportexcessive queries — Consolidated 11 individual count/sum queries into a single aggregated query- Analytics view XSS hardening — Replaced
rawhelper with.to_json.html_safefor data injection in JavaScript blocks
Removed
- Orchestration/sub-agents feature — Removed as out of scope for this gem
Full Changelog: v3.11.0...v3.12.0
v3.11.0
Added
agentsDSL — Separate DSL for declaring sub-agent delegates, distinct fromtools. Supports simple form (agents [AgentA, AgentB], forward: [:workspace_path]) and block form with per-agenttimeout:anddescription:overrides,forwardparameter auto-injection, andinstructionstextforwardparameter injection — Auto-injects parent agent params into sub-agent calls and removes them from the LLM-facing tool schema, eliminating token waste and reducing failure points- System prompt auto-generation — Agents with the
agentsDSL automatically get "## Direct Tools" and "## Agents" sections appended to their system prompt, helping the LLM distinguish between cheap local tools and expensive autonomous agents StreamEventvalue object — Typed streaming events (:chunk,:tool_start,:tool_end,:agent_start,:agent_end,:error) for full execution lifecycle visibility. Opt-in viastream_events: trueon.call()— default raw chunk behavior unchanged- Router auto-delegation — Routes with
agent:mapping now automatically invoke the mapped agent after classification.RoutingResultexposesdelegated?,delegated_to,routing_cost, andtotal_costfor full visibility into the classification + delegation pipeline OrchestratorAgentexample — New example agent demonstrating theagentsDSL with block form,forward, andinstructions
v3.10.0
Added
RubyLLM::Agents::Toolbase class — ExtendsRubyLLM::Toolwith agent context access, per-tool timeouts, and automatic error handling. Users implementexecute()(standard RubyLLM convention) whilecall()wraps with context, timeout, and error recoveryToolContextaccessor — Read-only context wrapper providing method-style (context.container_id) and hash-style (context[:container_id]) access to agent params, tenant ID, and execution ID from within tools- Per-tool timeout DSL —
timeout 30class-level DSL on tools, withconfig.default_tool_timeoutglobal fallback ToolExecutionmodel — Real-time per-tool tracking with individual database records (INSERT on start, UPDATE on complete), enabling live dashboard views and queryable tool-level analytics- Cancellation support —
on_cancelled:proc checked before each tool execution. RaisesCancelledErrorwhichBaseAgentcatches to returnResultwithcancelled? = true Result#cancelled?— Query whether an agent execution was cancelled mid-run- Example coding agent —
CodingAgentwithFileReaderTooldemonstrating tool context and timeout features
Fixed
- Undefined method
error?on Context — Fixed budget middleware breaking tenant budget tracking whenPipeline::Contextlacked theerror?method
v3.9.0
Added
RubyLLM::Agents.trackblock API — Group multiple agent executions into a single tracked request withrequest_idand tags. IncludesTrackerandTrackReportclasses for aggregated cost/token analytics- Requests dashboard — New dashboard page for viewing and filtering tracked request groups with per-request detail views
- Convenience query API —
RubyLLM::Agents.executions,.recent,.for_agent,.for_modelclass-level query methods for accessing execution data from host apps doctorgenerator —rails generate ruby_llm_agents:doctorvalidates installation, configuration, database tables, and RubyLLM connectivitydemogenerator —rails generate ruby_llm_agents:demoscaffolds a working example agent with demo rake task- Structured logging & pipeline tracing — Middleware base class now provides structured
log_info/log_warn/log_errorhelpers with trace context for debugging pipeline execution - Trackable results — All
Resultsubclasses register with the active tracker for automatic request-level aggregation - Wiki guide — "Using Data In Your App" wiki page documenting the convenience query API
Changed
- Modernized generators — Agent and install generators produce cleaner, DSL-focused templates with better inline documentation
- Improved error messages — Actionable error messages for common configuration mistakes (missing API key, missing model, etc.)
- README quickstart — Streamlined golden-path getting started section
- Bumped ruby_llm dependency to v1.13.2
Fixed
- Tenant API keys — Use
RubyLLM::Context#chatinstead of passing context as keyword arg, fixing tenant-scoped API key isolation - Test isolation — Fixed
verify_partial_doublesissues in specs
v3.8.0
Added
- Inception Labs Mercury provider — New provider for diffusion-based LLMs via Inception Labs API. Includes model registry, capabilities detection, and chat integration. Configure with
config.inception_api_key - AgentRegistry service — Centralized agent discovery combining filesystem scanning with execution history for dashboard agent listings
- Dashboard performance indexes — New composite indexes (
[status, created_at],[model_id, status],[cache_hit, created_at]) for dashboard query optimization. Available via upgrade generator
Changed
- Dashboard query optimization — Rewrote analytics queries to use SQL
GROUP BYwith conditional aggregation instead of loading records into Ruby. Reduces dashboard page load from ~75 SQL queries to ~10 - Thin controllers — Extracted query logic from dashboard and agents controllers into models and AgentRegistry service
- Consolidated instrumentation — Deprecated legacy
Instrumentationmodule in favor of pipeline middleware, DRY'd up shared logic - Thread-safe tenant API keys — Store tenant API keys on pipeline context instead of mutating global configuration
Fixed
- Code quality — Fixed error logging, race conditions in budget tracking, tenant scoping, XSS in views, and test mock violations
- Flaky test — Fixed
tenant_auto_create_spectest pollution from leakedtrack_executionsconfig - Test coverage — Added specs for TenantsController, SystemConfigController, ExecutionDetail, and Mercury provider
v3.7.2
Fixed
- Fix missing trace_id and request_id extraction in pipeline instrumentation middleware — The instrumentation middleware was not properly extracting
trace_idandrequest_idfrom the pipeline context, causing these fields to be missing in execution logs.
v3.7.1
Fixed
- Upgrade generator missing usage counter columns migration — The upgrade generator had a template for adding usage counter columns (
monthly_cost_spent,daily_cost_spent, etc.) to the tenants table but never wired it into the generator steps. Users upgrading from older versions would hitPG::UndefinedColumnerrors on the dashboard. Runningrails generate ruby_llm_agents:upgradenow correctly detects and generates the missing migration.
v3.7.0
Added
- Evaluation framework — New
RubyLLM::Agents::Evalmodule for testing and benchmarking agents:EvalSuite— Define test cases with expected outputs, run evaluations with built-in scorers (exact match, includes, semantic similarity, custom), and generate summary reportsEvalResult— Structured result objects with pass/fail status, scores, and metadataEvalRun— Batch evaluation runner with parallel execution support and aggregate statistics
- Evaluation examples in example app (
SchemaAgentEval,SupportRouterEval) - Evaluation framework documentation in README, wiki, and LLMS.txt
- Comprehensive unit and integration specs for eval framework components
Fixed
- Dashboard overview stats overflow on mobile viewports
Removed
- Dead redaction references left over from v3.0.0 removal
v3.6.0
Added
- Agent-as-tool composition — Wrap any agent as a RubyLLM tool with
AgentTooladapter. Usetools AgentTool.from(OtherAgent)to let agents call other agents. Execution hierarchy tracked viaparent_execution_idin metadata - Queryable agents — Query execution history directly from agent classes:
.executions,.last_run,.failures(since:),.total_spent(since:),.stats(since:),.cost_by_model(since:),.with_params(**params). Includes replay support for A/B testing models on real inputs - ActiveSupport Notifications — Instrument the full pipeline with
ruby_llm_agents.*events:- Execution lifecycle:
execution.start,execution.complete,execution.error - Cache:
cache.hit,cache.miss,cache.write - Budget:
budget.check,budget.record,budget.exceeded - Reliability:
reliability.fallback,reliability.exhausted
- Execution lifecycle:
- Custom middleware — Inject custom middleware into the pipeline globally via
config.middlewareor per-agent viamiddlewareDSL. Supportsbefore/after/aroundpositioning relative to built-in middleware - Agent rename support — Three complementary approaches for handling agent class renames:
- Aliases DSL —
aliases "OldName", "AnotherOldName"on agent classes makesby_agentscopes, analytics, and budget checks automatically include records from all previous names - Programmatic helper —
RubyLLM::Agents.rename_agent("Old", to: "New")updates execution records and tenant budget keys in-place, withdry_run: truesupport - Migration generator —
rails generate ruby_llm_agents:rename_agent OldName NewNamecreates a reversible migration - Rake task —
rake ruby_llm_agents:rename_agent FROM=Old TO=New [DRY_RUN=1]as a CLI alternative
- Aliases DSL —
- Debugging helpers —
Configuration#to_h,BaseAgent.config_summary,Result#executionfor console inspection - Parameter descriptions —
desc:/description:keyword onparamDSL for documenting agent parameters - Dashboard enhancements — Custom date range picker for stats/charts, cache savings display, top tenants overview, favicons
Changed
- Tenant middleware now supports objects responding to
llm_tenant_idin addition to string/symbol tenant IDs - Deep symbolize hash keys in agent response processing for consistent access patterns
- Replaced test doubles with real objects across spec suite for more reliable tests
Removed
- Dead code cleanup: removed unused
Reliability::Executorsub-classes, duplicate error classes, orphanedasync_max_concurrencyconfig, unimplemented redaction stub, hardcoded pricing constants, deadPipelineconvenience methods andInstrumentationdiagnostic methods