# ai·rete·rag [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/zaharajabeen13-create/ai-rete-rag-mcp  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ai-rete-rag-2

## Description
Author rules from policy docs, then decide: a Rete engine gives the verdict, an LLM explains why.

## Tools
Capabilities this server exposes over MCP:

- **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

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "ai-rete-rag": {
    "command": "uvx",
    "args": ["ai-rete-rag-mcp"],
    "env": {
      "AI_RETE_RAG_API_KEY": "",
      "AI_RETE_RAG_API_URL": ""
    }
  }
}
```

**Requires environment variables:** `AI_RETE_RAG_API_KEY`, `AI_RETE_RAG_API_URL` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What ai·rete·rag does

The ai·rete·rag MCP server connects an MCP client to the ai·rete·rag decision service. It supports domains containing policy rules and a knowledge base of ingested documents. Agents can inspect existing rules, create rules from YAML, turn written policy into draft rules, and evaluate cases using structured facts or free text.

The verdict comes from a Rete rule engine. Retrieval-augmented text is used to explain the result, not to replace the rule evaluation. This separation is useful when a workflow needs reproducible decisions alongside explanations that cite the policy material behind them.

## How it works

A typical workflow starts with `get_parameters`, which returns the facts used by a domain's rules, ordered by decisiveness. The agent can then map information from a case into those fields and call `decide`. The decision response can identify missing parameters, allowing the agent to request additional facts and evaluate the case again.

`decide` accepts structured facts and/or free text. It also supports two optional retrieval patterns: one can narrow the applicable rule scope, and the other can place retrieved information into working memory. When an agent extracts facts from files or other media, `fact_sources` can record which source supplied each fact for the decision audit trail. The API receives the extracted facts rather than interpreting the media itself.

## Setup and configuration

The ai·rete·rag MCP server can be started on demand with `uvx ai-rete-rag-mcp`, installed from PyPI with `pip install ai-rete-rag-mcp`, or run from a source checkout. Configure `AI_RETE_RAG_API_KEY` with an API key created in the service settings. The key authenticates requests and associates them with the account's plan quota.

`AI_RETE_RAG_API_URL` defaults to `https://ai-rete-rag.com` and can point to another API base, such as `http://localhost:8000` for local development. A key is not required to explore shared demo domains, although free-tier limits apply.

The hosted service is also available at `https://ai-rete-rag.com/mcp`. The authenticated endpoint at `/mcp/auth` uses a browser sign-in flow and is intended for account-specific access. Clients that support a static authorization header can use the regular `/mcp` endpoint with a bearer key.

## Tools and capabilities

The server exposes these MCP tools:

- `decide` evaluates a case in a domain and returns the rule-derived verdict with an explanation.
- `get_parameters` lists the facts a domain's rules use, with the most decisive first.
- `list_rules` shows rule conditions, verdicts, salience, and overlaps.
- `get_rule_source` returns a domain's rules as editable YAML.
- `import_policy_rules` creates unsaved draft rules from policy text and cites the source sentence for each draft.
- `put_rules` creates or replaces a domain rule set from YAML and supports validation with `dry_run`.
- `ingest_text` adds policy text to a domain knowledge base.
- `list_documents` lists ingested documents.
- `get_usage` reports the plan and remaining monthly decision quota.

The import workflow does not save rules automatically. Review the drafts first, then use `put_rules` when they are ready.

## Limitations and notes

The LLM does not determine the verdict; the Rete engine does. Explanations depend on policy documents ingested into the relevant knowledge base. The service's API receives facts extracted by the agent, so the agent—not the API—reads photos, scans, voice notes, or video.

Account-based usage is tied to the configured API key and plan quota. Without a key, access is limited to shared demo domains and their free-tier constraints. Hosted connections that require browser authentication may need the `/mcp/auth` custom connector rather than a header-based connection.

_Full upstream README: https://allmcps.com/mcp/ai-rete-rag-2/readme_

