ActiveHarness is a Ruby gem for building AI agents in Ruby and Rails applications. It provides a DSL for defining agents with system prompts, multi-provider LLM support with automatic fallbacks (OpenAI, Anthropic, Groq, Gemini, OpenRouter), lifecycle hooks, and several higher-level constructs: Tribunals (parallel agents that produce a consensus verdict), Pipelines (sequential multi-step flows with early-stop logic), and Memory (conversation history with file-based storage). The framework integrates with Rails via generators that scaffold the app/ai/ directory structure, supports SSE streaming, and exposes execution time and token usage on every result object.

10m read timeFrom github.com
Post cover image
Table of contents
What is a "Harness"?Why Did I Build This?File StructurePromptsAgentsTribunalsPipelinesMemoryRailsExecution TimeToken Usage InfoLicense

Sort: