ai·rete·rag
v0.12.1Author rules from policy docs, then decide: a Rete engine gives the verdict, an LLM explains why.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
decide Make a decision
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…
| Parameter | Type | Description |
|---|---|---|
domain * | string | |
query * | string | |
as_of | ||
extract_from_retrieval | boolean | |
fact_sources | ||
facts | ||
filter_retrieval_with_rules | boolean | |
response_mode | string | |
unstructured_text |
list_rules List rules
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 sou…
| Parameter | Type | Description |
|---|---|---|
domain |
get_parameters Get decision parameters
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 verdi…
| Parameter | Type | Description |
|---|---|---|
domain * | string |
ingest_text Ingest policy text
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…
| Parameter | Type | Description |
|---|---|---|
domain * | string | |
text * | string | |
effective_from | ||
effective_until | ||
source | ||
supersedes |
list_documents List documents
List the documents ingested into a domain's knowledge base.
| Parameter | Type | Description |
|---|---|---|
domain * | string |
delete_domain Delete domain
Permanently delete your own copy of a domain: its rule set and every ingested document. This frees its slot in your plan's domain limit. Decision audit records are kept for the audit trail. A domain created later under the same name starts empty, with a fresh history. The shared demo domains are never affected: deleting `loan` removes only your own copy of it. Args: domain: The domain to delete. confirm: Must repeat the domain name exactly; any other value is refused.
| Parameter | Type | Description |
|---|---|---|
confirm * | string | |
domain * | string |
get_rule_source Get rule source (YAML)
Fetch a domain's complete rule set as editable YAML, plus whether you may edit it. The whole YAML file is returned as one fenced block; show it to the user in full, never just its first lines. For a built-in demo domain you get your own copy's rules once you have edited it, otherwise the shared demo's.
| Parameter | Type | Description |
|---|---|---|
domain * | string |
put_rules Save rules
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 condi…
| Parameter | Type | Description |
|---|---|---|
domain * | string | |
rules_yaml * | string | |
dry_run | boolean |
import_policy_rules Draft rules from a policy
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…
| Parameter | Type | Description |
|---|---|---|
domain * | string | |
policy_text * | string |
get_usage Check usage and quota
Show this account's decision usage, plan, and remaining monthly quota.