Gem Index

The complete ask-rb ecosystem. All gems are independently versioned and released on RubyGems.

Foundation

These gems have zero dependencies on other ask-rb gems. They form the bedrock of the ecosystem.

Gem Purpose
ask-core Defines the core abstractions every LLM application needs — conversation message containers that normalize roles, multi-modal content types (Text, Image, Audio, Video, File) for rich messages, streaming primitives for token-by-token responses, a provider interface that all LLM backends implement, a document value object for RAG pipelines, and a model catalog that maps model names to their providers. Ships structured error types so errors bubble up cleanly.
ask-schema A Ruby DSL for building JSON Schema hashes without writing raw hashes. Declare object shapes with param, required, and type constraints the same way you would in a Rails strong parameters block. Designed for LLM function-calling schemas.
ask-auth A credential resolution chain that walks configured providers in order — environment variables, config files, Rails credentials, database-backed tokens, and OAuth flows — and returns the first match. Every service gem in the ecosystem calls Ask::Auth.resolve(:service_token) instead of reading env vars directly.
ask-sandbox-providers Four sandbox backends for safely executing untrusted code: Local process with resource limits (rlimits), Docker containers with read-only rootfs and no network, remote containers via the Daytona API, and Cloudflare Workers sandbox. Swap backends with a single assignment — Ask::Sandbox.provider = Ask::Sandbox::Docker.new(...).
ask-state-providers Four state backends for persisting agent sessions — SQLite, Redis, PostgreSQL, and MySQL. One Ask::State::Adapter contract, four databases, zero coupling to your infrastructure. Default is in-memory (no gem needed); add ask-state-providers and a database driver when you need durability, resumability, or distributed state.

LLM Providers

Gem Purpose
ask-llm-providers Every LLM provider in a single gem — 33 total. Ships 7 canonical providers (OpenAI, Anthropic, Google Gemini, AWS Bedrock, Ollama, Mistral AI, Cloudflare Workers AI) with distinct wire formats and 26 OpenAI-compatible providers (DeepSeek, Groq, Together, Fireworks, Cerebras, xAI, Perplexity, DeepInfra, Anyscale, SambaNova, Nebius, Nvidia NIM, Friendli, Hyperbolic, Novita, Nscale, Featherless, AI/ML API, AI21, Meta, GitHub Models, OpenRouter, OpenCode, OpenCodeGo, Mimo, Moonshot) configured via a data-driven registry — one line per provider, no subclass needed. All providers implement the Ask::LLM::ProviderConfig transformation contract (build_request, parse_response, parse_stream, format_tools, format_message) for testable, mechanical provider addition. Also ships bundled model definitions, alias resolution, and the Ask::LLM::Catalog loader.

Tools

These gems implement the Ask::Tool contract. Each tool is a standalone unit an agent can call.

Gem Purpose
ask-tools The tool framework itself. Defines Ask::Tool — the base class every tool inherits from — along with Ask::Result (a standardized success/error return type), a thread-safe registry for discovering and looking up tools by name, and a scaffold generator for writing new tools. This gem ships no executable tools; it only provides the contract.
ask-tools-shell Seven execution tools every agent needs: Bash for shell commands in a sandboxed temp directory, Read for reading files with line numbers, Write for creating files with automatic parent directory creation, Edit for surgical string replacements, Glob for pattern-matching filenames, Grep for regex search across files (skipping .git and node_modules), and Code for executing Ruby in a sandboxed subprocess. Output is truncated at 100KB and timeouts are surfaced as errors.
ask-web-search A single Ask::Tools::WebSearch tool that queries a local SearXNG instance and formats results as a numbered markdown-like string with title, URL, and content snippet. Deduplicates by URL and includes infobox results. Configure the endpoint with the SEARXNG_URL environment variable — defaults to http://localhost:8888.

Agent

Gem Purpose
ask-agent The core agent loop — think, call tools, execute, feed results back, repeat. Manages sessions (conversation state with an LLM), tool execution (resolving tool names to calls, passing results back as messages), conversation compaction (trimming history while preserving context), lifecycle hooks, event emission, and independent response evaluation through the Evaluator (a separate model judges output against a structured rubric). Ported from RubyLLM::Conductor into the Ask::Agent namespace.

Rails

Gem Purpose
ask-rails Rails integration for building AI-powered applications. Provides generators (rails generate ask:install), file conventions (app/agents/), a railtie that wires Ask::Agent.logger to Rails.logger, and a base class (ApplicationAgent) for defining agents that compose with ask-agent, ask-tools, and the rest of the ask-rb ecosystem.
ask-rails-harness Admin AI copilot for Rails apps. Mounts as a Rails Engine at /ask with 9 Rails-aware tools (SchemaGraph, QueryDatabase, ReadModel, RouteInspector, ReadLog, ReadFile, RunCommand, SearchCodebase, ReadRoutes), ActiveRecord session persistence, audit logging, environment permissions, and automatic service gem discovery. For internal/admin/development use.

MCP

Gem Purpose
ask-mcp A full Model Context Protocol client for Ruby. Connect to MCP servers via stdio (subprocess), SSE (Server-Sent Events), or Streamable HTTP. Discover tools, resources, and prompts from any MCP server — the same protocol used by Claude Code, Codex, Cursor, and GitHub Copilot. Supports OAuth 2.1 authentication.
ask-web-search-mcp A minimal MCP server that exposes the web_search tool over stdio. Depends on ask-web-search and ask-mcp. Query a local SearXNG instance from any MCP-compatible client (ZCode, Claude Code, Codex). Configure the SearXNG URL with SEARXNG_URL (defaults to http://localhost:8888).

Instrumentation & Observability

Gem Purpose
ask-instrumentation Emits ActiveSupport::Notifications events for every LLM operation — chat completions, embeddings, tool calls, and image generation. Works with any provider. Subscribe to events for cost tracking, custom logging, analytics dashboards, or alerting. The foundation that all other observability gems build on.
ask-opentelemetry Subscribes to ask-instrumentation events and creates OpenTelemetry spans for every LLM operation. Works with any OpenTelemetry-compatible backend — Langfuse, Datadog, Honeycomb, Jaeger, Arize Phoenix, and more. Install and call Ask::OpenTelemetry.install to start tracing.
ask-monitoring A Rails engine that provides a real-time monitoring dashboard at /ask/monitoring. Tracks cost, throughput, error rates, and response times for all LLM calls. Uses Hotwire Turbo to auto-refresh every 30 seconds. Ships Slack alert integration so your team gets notified when error rates spike.

Service Contexts

Service gems provide an authenticated client and contextual metadata so agents can interact with third-party APIs by writing Ruby code, not by learning raw HTTP.

Gem Purpose
ask-github Provides an authenticated Octokit client, system prompt context describing the GitHub API surface, and a structured error guide that helps agents diagnose and recover from common GitHub API errors. Manage issues, pull requests, repositories, and code search.
ask-slack An authenticated Slack Web API client with system prompt context and error knowledge. Post messages to channels, list conversations, manage users, upload files, and search message history.
ask-notion An authenticated Notion API client using the notion-ruby-client gem. Query databases, retrieve and create pages, search workspaces, and update page properties. Includes structured error knowledge for common Notion API errors.
ask-linear An authenticated GraphQL client for the Linear API. List teams, create and update issues, query projects and cycles. Ships system prompt metadata and a structured error guide for the Linear API, all resolved via ask-auth.
ask-sentry A client for the Sentry error tracking API. List and inspect errors, project configuration, release tracking, and performance monitoring — all authenticated through ask-auth.
ask-honeybadger A client for the Honeybadger error tracking API. List recent faults, get fault summaries, inspect individual faults, and list projects. Authenticated through the shared credential resolution chain.
ask-solid_errors Accesses errors stored in your Rails database via the solid_errors gem. Query recent errors, inspect error details, and analyze error patterns — no API key needed since it reads directly from your database.

Skills

Gem Purpose
ask-skills A skill discovery and loading system for agents. Searches project directories, user config paths, and installed gems for markdown skill files. Skills are listed in the agent’s system prompt by name and description, then loaded on-demand when the agent decides it needs domain guidance. Ships built-in skills for codebase exploration and debugging methodology.

RAG

Gem Purpose
ask-rag A RAG pipeline for the ask-rb ecosystem. Load documents from files (Text, Markdown, CSV, JSON, HTML, PDF, Directory), split them into chunks (RecursiveCharacter, Markdown), store embeddings in vector stores (InMemory, PGVector), and retrieve relevant context via similarity search. Supports metadata filtering, MMR (diversified results), and a high-level Query.query for one-shot retrieve → prompt → answer. Works standalone or with ask-agent through a search tool. Optional deps: nokogiri (HTML), pdf-reader (PDF), pgvector (PostgreSQL).

Evaluation

Gem Purpose
ask-eval An LLM evaluation framework built on Minitest. Ships Minitest-native assertions — assert_faithful for verifying responses stay true to provided context, assert_not_hallucinating for detecting fabricated information, plus bias and toxicity checks. Uses LLM-as-judge for the semantic checks and deterministic assertions for basic checks. Outputs CI-native test results.

Dependency Graph

	ask-core           ──► (no deps)
	ask-schema         ──► (no deps)
	ask-auth           ──► (no ask deps)
	ask-sandbox-providers ──► (no deps)
	ask-state-providers   ──► ask-core
	ask-skills         ──► (no deps)
	ask-eval           ──► (no deps)
  │
  ├── ask-llm-providers   ──► ask-core, ask-auth
  ├── ask-tools           ──► ask-schema
  ├── ask-instrumentation ──► (no ask deps)
  │     ├── ask-opentelemetry ──► ask-instrumentation
  │     └── ask-monitoring    ──► ask-instrumentation
  │
  ├── ask-github       ──► ask-auth
  ├── ask-slack        ──► ask-auth
  ├── ask-notion       ──► ask-auth
  ├── ask-linear       ──► ask-auth
  ├── ask-honeybadger  ──► ask-core, ask-auth
  ├── ask-sentry       ──► ask-core, ask-auth
  ├── ask-solid_errors ──► ask-core
  │
  ├── ask-tools-shell  ──► ask-tools, ask-sandbox-providers
  │     └── ask-agent  ──► ask-core, ask-llm-providers, ask-tools, ask-skills
  │           ├── ask-rails  ──► ask-agent
  │           └── ask-rails-harness  ──► ask-agent, ask-tools-shell, ask-auth
  │
	  ├── ask-web-search   ──► ask-tools
	  ├── ask-rag          ──► ask-core
	  │
		  └── ask-mcp          ──► (no ask deps)
		        └── ask-web-search-mcp ──► ask-mcp, ask-web-search
		```

## Installation

```ruby
# Single gem
gem "ask-agent"

# For Rails apps — user-facing AI features
gem "ask-rails"

# For Rails apps — admin copilot (pulls in agent, tools, shell, auth)
gem "ask-rails-harness"

All gems follow semantic versioning. Breaking changes increment the major version.

Next Steps


This site uses Just the Docs, a documentation theme for Jekyll.