Skills Rulebase

Querying a Rulebase workspace with SQL

Rulebase exposes workspace data to an AI client as a read-only SQL sandbox over organization-scoped views. It is the most capable tool on the server and the one that fails most often, in two ways that look nothing alike.

RulebaseProductAny helpdeskRead-only
Installnpx rulebase-skills install rulebase-workspace-sql

When to use it

Reach for this when someone says any of these — they are the phrases the skill itself triggers on:

  • query my Rulebase data
  • the query timed out
  • statement timeout
  • canceling statement due to statement timeout

How it works

The method, in the order the skill runs it. The full procedure — tables, worked examples and the edge cases — is in the skill itself.

  1. Step 0: introspect, always

    Never write a query from remembered field names. Views and columns differ between workspaces and plans.

  2. Why queries time out

    LIMIT bounds the output, not the work. This is the single most useful thing to understand about the sandbox.

  3. Patterns that finish

    1. Resolve identifiers first, fetch content second. Two cheap queries beat one expensive one. Query for the ids and metadata you need using indexed predicates, then query content keyed by those specific ids. This is the highest-leverage pattern in the sandbox and it works for almost every "show me the messages where…" question.

  4. The fan-outs that produce wrong numbers

    These are correctness bugs, not performance bugs, and they do not announce themselves. Each one has been the cause of a real reconciliation failure.

  5. Reconciling against the app

    When a number must match what the user sees in Rulebase, do not reverse-engineer the definition from SQL. Pull the equivalent figure from the purpose-built summary tools first, then reconcile your query to it. If they differ, the difference is almost always one of: the status filter, the date field (event time vs. evaluation time vs. import time), the scorecard scope, or a fan-out from the list above. Check those fou

Related skills

Free and open source, and vendor-neutral — it reads the conversations from whichever helpdesk you already run. Browse all 149 skills · connect your helpdesk over MCP · source on GitHub

Review every conversation. Act on what it finds.

AI for customer operations, built for financial services. Specialist agents chase every issue to resolution and every stalled customer to activation.

Rulebase dashboard