Skip to main content
Glama

ai·rete·rag MCP Server

Use ai·rete·rag — deterministic rule-based decisions with RAG-powered explanations — from Claude Code, Claude Desktop, or any MCP client.

The verdict always comes from the Rete rule engine (auditable, reproducible); the LLM only explains why, grounded in your ingested policy documents.

Tools

Tool

What it does

decide

Make a decision in a domain — structured facts and/or free text, with optional Pattern 01 (rules scope retrieval) and Pattern 02 (retrieval into working memory). as_of reads the policy documents in force on an earlier day

get_parameters

The facts a domain's rules decide on (from your account's own rules), most decisive first — what to collect before decide

list_rules

Inspect a domain's rules — conditions, verdicts, salience, overlaps

get_rule_source

Fetch a domain's rule set as editable YAML

import_policy_rules

Turn a written policy document into draft rules, each citing the sentence it encodes (nothing is saved — review, then put_rules)

put_rules

Create or replace a domain's rule set from YAML (dry_run to validate)

ingest_text

Add policy text to a domain's knowledge base, optionally dated (effective_from, effective_until) or replacing an earlier version (supersedes)

list_documents

Browse a domain's ingested documents

get_usage

Check your plan and remaining monthly decision quota

Related MCP server: signet-eval

Prompt: decide_case

An agent workflow for deciding a case in any domain on your account, including your own: it calls get_parameters to learn which facts the rules decide on, reads the case — text, photos, document scans, voice notes or video (the agent reads the media itself; the API only receives the facts) — maps it onto those exact fields, calls decide with fact_sources recording which file each fact came from (kept in the decision's audit trail), and — while the result's missing_parameters is non-empty (facts that could still change the verdict) — asks you for them, most decisive first, and decides again. The verdict always comes from the rules.

Connect by URL (no install)

The server is also hosted, which is the only route for clients that connect to a URL and have no field for a static header — claude.ai and Claude Desktop custom connectors, in particular.

URL

Auth

Reaches

https://ai-rete-rag.com/mcp/auth

Sign in with Google, once, in the browser

Your account — your domains, your plan quota

https://ai-rete-rag.com/mcp

None, or Authorization: Bearer ik_...

Shared demo domains anonymously; your account with a key

Add https://ai-rete-rag.com/mcp/auth as a custom connector and approve the prompt. Connections are listed under Settings → Connected apps, and disconnecting one takes effect immediately.

Install

No install needed with uv — uvx ai-rete-rag-mcp fetches and runs the server on demand (see the config snippets below).

Alternatively, install it as a package:

pip install ai-rete-rag-mcp         # from PyPI
pip install .                       # or from source, in this repo

Configure

First create an API key: sign in at ai-rete-rag.com, open Settings → API Keys, and create a key (ik_... — shown once).

Claude Code

claude mcp add ai-rete-rag -e AI_RETE_RAG_API_KEY=ik_your-key-here -- uvx ai-rete-rag-mcp

(If you installed via pip, use -- ai-rete-rag-mcp instead of -- uvx ai-rete-rag-mcp.)

Or skip the install entirely and point it at the hosted endpoint with your key:

claude mcp add --transport http ai-rete-rag https://ai-rete-rag.com/mcp \
  --header "Authorization: Bearer ik_your-key-here"

Claude Desktop / other clients (JSON)

{
  "mcpServers": {
    "ai-rete-rag": {
      "command": "uvx",
      "args": ["ai-rete-rag-mcp"],
      "env": {
        "AI_RETE_RAG_API_KEY": "ik_your-key-here"
      }
    }
  }
}

(With a pip install, set "command": "ai-rete-rag-mcp" and drop "args".)

Environment variables:

Variable

Default

Purpose

AI_RETE_RAG_API_KEY

(none)

Your API key — authenticates calls and ties them to your plan quota

AI_RETE_RAG_API_URL

https://ai-rete-rag.com

API base URL — point at http://localhost:8000 for local dev

Without a key you can still explore the shared demo domains (loan, fraud, clinical, …) subject to free-tier limits.

Example

"Use ai·rete·rag to decide whether this loan application should be approved: credit score 645, annual income $52k, requested amount $30k."

Claude calls decide(domain="loan", facts={...}) and returns the rule-derived verdict plus a plain-English explanation citing the underwriting policy.

Available Tools

9 tools
decideMake a decisionAInspect

Make a deterministic, auditable decision in a domain.

The verdict comes from the domain's rule set (Rete engine, never the LLM), so it is reproducible and compliant. The explanation is generated from the domain's ingested policy documents.

Without an API key only the shared demo domains are available, and the response carries next_step: how to get a free key for your own rules.

Args: domain: Rule-set domain, e.g. "loan", "fraud", "clinical". query: Natural-language question or decision request. facts: Structured facts for working memory, e.g. {"credit_score": 710, "annual_income": 85000}, keyed by the field names the domain's rules test. Facts read from photos, document scans, voice notes or video belong here too; explicit facts always win over anything extracted server-side. fact_sources: Where each fact in facts came from, e.g. {"monthly_income": "payslip.jpg", "claim_usd": "voice note 1"}. Stored in the decision's audit record so a reviewer can tell typed facts from ones read off evidence. Facts without a source are recorded as "request". as_of: Read the domain's policy documents as of this day, as YYYY-MM-DD (default: today), so a case can be decided under the policy in force on the day it was filed; the rules themselves are always the current ones. unstructured_text: Optional free text (an application, a case note, a voice-note transcript, what a photo or video shows); facts are extracted from it automatically and merged. response_mode: "verdict_only" (fastest), "verdict_with_explanation", or "full_audit" (every rule evaluation + retrieved chunks, available on every plan including the free tier). rule_firings come back in causal order: a rule that matched a fact asserted by an earlier firing appears after it, with the derived facts listed under asserted_facts. filter_retrieval_with_rules: Pattern 01 — run the rules first and let a fired rule's retrieval_scope action narrow which documents the retrieval searches before it runs. extract_from_retrieval: Pattern 02 — parse the retrieved documents into facts and assert them into working memory, so rules fire on what was actually read (not just the facts you passed).

The result's missing_parameters lists rule inputs that were not supplied but could still change the verdict, most decisive first. When it is non-empty the verdict is provisional; when it is empty, more facts cannot change the verdict.

Inputs: query (required), domain (required), as_of, facts, +5 more. Returns: result

get_parametersGet decision parametersA
Read-only
Inspect

List the input parameters a domain's rules decide on — the facts a decision in that domain uses. Derived from your account's own copy of the rules, so it covers your custom domains too.

Each parameter has its field name (the key to use in facts), kind (number / boolean / string), the tests rules make on it (e.g. >= 720 — match these units and scales), the rules and verdicts it can lead to, and max_salience. Parameters come most decisive first: those feeding the highest-salience rules, which win when several rules fire. Also returns every verdict the domain can reach.

Inputs: domain (required). Returns: result

get_rule_sourceGet rule source (YAML)A
Read-only
Inspect

Fetch a domain's rule set as editable YAML (plus the parsed rules and whether you may edit it). For a built-in demo domain you get your own copy's rules once you have edited it, otherwise the shared demo's.

Inputs: domain (required). Returns: result

get_usageCheck usage and quotaA
Read-only
Inspect

Show this account's decision usage, plan, and remaining monthly quota.

Inputs: no named parameters. Returns: result

import_policy_rulesDraft rules from a policyA
Read-only
Inspect

Convert a written policy document into DRAFT decision rules (LLM-assisted).

Returns validated draft rules (when/action, including chained asserts where the policy stages its determinations), derived rule→rule edges, and overlap warnings. Each returned rule carries a citation field holding the policy sentence it encodes (also summarized in the top-level citations map). Coverage runs the other way too: uncovered_sentences lists policy sentences no rule's citation points back to (out of policy_sentence_count), and unverified_citations names rules whose quote is missing or not found verbatim in the policy. An uncovered sentence may need a rule; an unverified one may be a paraphrase that misstates the policy. background_sentences is the subset of uncovered sentences with no obligation language (definitions, preamble), split by a keyword heuristic. Nothing is saved: the drafts are returned for review only.

Args: domain: Domain the rules are drafted for (an owned domain or a new name). policy_text: The policy document text (max ~50k characters).

Inputs: domain (required), policy_text (required). Returns: result

ingest_textIngest policy textAInspect

Add policy/reference text to a domain's knowledge base.

The text is chunked and embedded; explanations for future decisions in this domain will cite it. Creating a new domain claims it for your account (plan limits apply). Ingesting into a built-in demo domain gives your account its own copy of that demo (it counts as one of your domains); the shared demo others see is unchanged. On team plans, only the domain admin (the member who created the domain, or the subscription owner) can add documents.

Documents can be dated. A decision only cites documents in force on its date, so a replaced policy is never quoted for a new decision. To publish a new version, ingest it under a new source with supersedes naming the old one: the old document stops applying on the new one's effective_from (today if not given), and the new one starts that day. A document can be superseded only once; to replace a successor, supersede the successor.

Args: domain: Domain to ingest into (existing or new). text: The policy or reference text. source: Optional source name shown in the document list. effective_from: First day this document applies, as YYYY-MM-DD (default: always). effective_until: First day it no longer applies, as YYYY-MM-DD (default: no end). supersedes: Source name of the document this one replaces.

Inputs: text (required), domain (required), source, supersedes, +2 more. Returns: result

list_documentsList documentsA
Read-only
Inspect

List the documents ingested into a domain's knowledge base.

Inputs: domain (required). Returns: result

list_rulesList rulesA
Read-only
Inspect

List the decision rules for one domain (or all domains).

Returns each rule's conditions — either a flat AND list (field / operator / value) or a when condition tree (nested all/any/not) — plus its verdict, salience, and any asserted facts (action.assert, the facts a rule produces for other rules to consume). edges lists the derived rule→rule dependencies: src asserts a fact type that dst's conditions test (forward chaining). Each rule may also carry citation — the policy sentence it encodes — which is what lets a decision be traced back to the source clause. Also includes overlap warnings and, through the conditions, the fact fields the domain's rules test.

Inputs: domain. Returns: result

put_rulesSave rulesA
Destructive
Inspect

Create or replace a domain's rule set from YAML (self-serve rule authoring).

The first save to a new domain claims it for your account (plan limits apply). Saving to a built-in demo domain saves your own copy of it, seeded from the demo; the shared demo others see is unchanged. Rules are validated before saving — set dry_run=true to validate without persisting. The response reports ok/errors, the parsed rules, and any overlap warnings.

YAML format — a list of rules. Flat form (conditions are AND-ed): - name: "Approve" salience: 10 conditions: - type: loan field: credit_score op: ">=" value: 700 action: verdict: "APPROVED" reason: "Credit score meets threshold"

Tree form — when: holds nested all/any/not condition groups, and an action may assert derived facts that other rules consume (forward chaining; the rule graph derives from these automatically): - name: "Sepsis Screen" salience: 30 when: all: - {type: clinical, field: temperature_f, op: ">=", value: 101.5} - any: - {type: clinical, field: wbc_count, op: ">", value: 12.0} - {type: clinical, field: bands_pct, op: ">", value: 10} action: verdict: "URGENT_ALERT" assert: - {type: sepsis_flag, fields: {severity: high}} - name: "Escalate" salience: 40 when: all: - {type: sepsis_flag, field: severity, op: "==", value: high} - {type: clinical, field: age, op: ">=", value: 65} action: verdict: "ADMIT_ICU"

Use either conditions: or when: per rule, never both. not passes when the inner condition does not hold (including when the field is absent). Produce/consume cycles between rules are rejected at validation. An action may also carry retrieval_scope: { <key>: <value> } to narrow which documents retrieval searches (Pattern 01).

A rule may also carry citation: — the policy sentence it encodes. It is stored with the rule and shown beside it in decision audits, so a verdict can be defended with the source language, not just the rule name: - name: "Decline Late Returns" salience: 20 citation: "Returns are accepted within 30 days of delivery." when: all: - {type: retail, field: days_since_delivery, op: ">", value: 30} action: verdict: "DENIED"

A rule saved without its citation has no link from its decisions back to the policy clause that justifies it.

Args: domain: Domain to author (an owned domain, or a new name to claim). rules_yaml: The full rule set as YAML text. dry_run: Validate only, without saving.

Inputs: domain (required), rules_yaml (required), dry_run. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 9 tools

    Disambiguation4/5

    Each tool has a clearly distinct role: decide executes a verdict, put_rules authors rules, ingest_text adds documents, and the introspection tools expose rules, parameters, and YAML source respectively. The only potential confusion is between list_rules, get_parameters, and get_rule_source, which all surface rule information in different forms, but the descriptions distinguish their outputs well.

    Naming Consistency4/5

    Names use snake_case with a verb_noun pattern (get_usage, list_rules, list_documents, ingest_text, import_policy_rules). Minor deviations: the bare verb 'decide' and the HTTP-style 'put_rules', which pairs oddly with 'get_rule_source' rather than a matching noun form.

    Tool Count5/5

    Nine tools is well-scoped for a rule-engine-plus-RAG decision server. Each tool covers a distinct stage of the workflow (inspect, author, ingest, decide, usage) with no filler.

    Completeness4/5

    The surface covers the full loop: ingest documents, import or author rules, inspect rules/parameters, run decisions, and check usage. Gaps are minor but real: no way to delete a document or a domain, and no tool to list or replay past decisions/audits.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Deterministic policy enforcement for AI agent tool calls. It evaluates every tool call against user-defined rules before execution, with no LLM in the authorization path.
      4
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables users to run deterministic rule checks against their own metrics or HTTP/CSV sources and pull back a short decision brief: only the items that crossed a threshold, each with the number that tripped it and suggested next steps. Users can also record accept/reject/edit feedback so subsequent briefs reflect their own playbook, all without API keys or a live LLM.
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      Enables clients to run deterministic eligibility and decision evaluations from compiled legislation, policy, contracts, and regulation, inspect schemas and traces, route next questions, and discover rulesets, with optional private-beta authoring tools for rule generation, testing, refining, and publishing.
      36
      395 npm
      2
      MIT