Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aethis.ai/llms.txt

Use this file to discover all available pages before exploring further.

25 tools in four groups. Decision tools need no API key. Authoring tools require an Aethis API key and your own Anthropic API key for generation.

Decision tools

No API key required. Safe to call from any environment.

aethis_decide

Evaluate eligibility against a published rule ruleset.
ParameterTypeRequiredDescription
ruleset_idstringyesPublished rule ruleset ID
field_valuesobjectyesInput fields — see aethis_schema for expected names and types
include_tracebooleannoInclude evaluation trace showing how each criterion was evaluated
include_explanationbooleannoInclude human-readable rule descriptions with source references
aethis_decide({
  ruleset_id: "aethis/uk-fsm/child-eligibility",
  field_values: { "child.age": 10, "child.school_type": "state_funded" },
  include_trace: true,
  include_explanation: true
})
{
  "decision": "eligible",
  "fields_provided": 2,
  "fields_evaluated": 2,
  "trace": {
    "status": "eligible",
    "group_statuses": {
      "school_type_check": "satisfied",
      "age_check": "satisfied"
    }
  },
  "explanation": [
    {
      "criterion_id": "relevant_school",
      "group": "school_type_check",
      "title": "Pupil attends a relevant school",
      "rule_text": "child.school_type equals \"state_funded\""
    },
    {
      "criterion_id": "age_range",
      "group": "age_check",
      "title": "Child is aged 4 to 15 inclusive",
      "rule_text": "( AND child.age is at least 4 AND child.age is at most 15)"
    }
  ]
}
When the decision is undetermined, the response also includes next_question, optimal_path, and missing_fields.

aethis_schema

Get the input fields required for an eligibility check.
ParameterTypeRequiredDescription
ruleset_idstringyesPublished rule ruleset ID
aethis_schema({ ruleset_id: "aethis/uk-fsm/child-eligibility" })
{
  "ruleset_id": "aethis/uk-fsm/child-eligibility",
  "fields": [
    {
      "key": "child.age",
      "sort": "Int",
      "description": "Age of the child in years at the start of the school year."
    },
    {
      "key": "child.school_type",
      "sort": "Enum",
      "enum_values": ["state_funded", "independent", "home_educated"],
      "description": "Type of school the child attends."
    }
  ]
}
Call before aethis_decide to discover what fields to provide.

aethis_next_question

Conversational eligibility — returns the optimal next question given answers so far. Call with empty field_values for the first question, then add each answer and call again until a decision is reached.
ParameterTypeRequiredDescription
ruleset_idstringyesPublished rule ruleset ID
field_valuesobjectyesAnswers collected so far — {} for first call
aethis_next_question({
  ruleset_id: "aethis/uk-fsm/household-criteria",
  field_values: {}
})
Decision: undetermined (0/9 fields provided)

Next question to ask:
  Field: household.receives_universal_credit
  Question: Does the household receive Universal Credit?
  Priority weight: 1 (lower = more important)

Full remaining path (2 questions):
  1. Does the household receive Universal Credit? (household.receives_universal_credit)
  2. Household annual net earnings (household.annual_net_earnings)

All missing fields: household.receives_universal_credit, household.annual_net_earnings,
  household.receives_income_support, ... (9 total)
The engine evaluates all paths simultaneously — the remaining path shows only the 2 questions needed to reach a decision, not all 9 fields. After answering both:
aethis_next_question({
  ruleset_id: "aethis/uk-fsm/household-criteria",
  field_values: {
    "household.receives_universal_credit": true,
    "household.annual_net_earnings": 5000
  }
})
Decision: eligible. No more questions needed.

aethis_explain

Human-readable descriptions of every rule compiled into a ruleset.
ParameterTypeRequiredDescription
ruleset_idstringyesPublished rule ruleset ID
aethis_explain({ ruleset_id: "aethis/uk-fsm/household-criteria" })
{
  "ruleset_id": "aethis/uk-fsm/household-criteria",
  "criteria": [
    {
      "criterion_id": "reg4_universal_credit",
      "group": "qualifying_criterion",
      "title": "Reg 4(a) — Universal Credit with net earnings ≤ £7,400",
      "rule_text": "( AND household.receives_universal_credit equals true AND household.annual_net_earnings is at most 7400)"
    },
    {
      "criterion_id": "reg4_income_support",
      "group": "qualifying_criterion",
      "title": "Reg 4(b) — Income Support",
      "rule_text": "household.receives_income_support equals true"
    }
  ]
}
Use for audit documentation, compliance review, or surfacing rule logic to end users.

aethis_explain_failure

Diagnose why a ruleset produced an unexpected outcome for specific test inputs.
ParameterTypeRequiredDescription
ruleset_idstringyesRuleset to diagnose
field_valuesobjectyesTest input values that produced the unexpected result
expected_outcomestringyes"eligible", "not_eligible", or "undetermined"
test_namestringnoName of the failing test case (included in diagnosis)
aethis_explain_failure({
  ruleset_id: "aethis/uk-fsm/child-eligibility",
  field_values: { "child.age": 10, "child.school_type": "independent" },
  expected_outcome: "not_eligible",
  test_name: "Age 10, independent school — not eligible"
})
Returns the actual vs. expected outcome, the specific criterion that failed, a diagnosis explaining why, and a suggested guidance hint to fix it:
{
  "actual_outcome": "eligible",
  "expected_outcome": "not_eligible",
  "is_failure": true,
  "diagnosis": "The compiled rule checks age only. The school_type constraint is missing.",
  "dsl_hint": "Add guidance: Regulation 3(2)(b) restricts eligibility to state-funded schools.",
  "criteria": [
    {
      "criterion_id": "age_range",
      "group": "age_check",
      "title": "Child is aged 4 to 15 inclusive",
      "rule_text": "( AND child.age >= 4 AND child.age <= 15)"
    }
  ],
  "group_statuses": { "age_check": "satisfied" }
}

Section and field discovery

Decompose legislation into sections and discover input fields. API key required. Anthropic key required for discovery (bring your own key).

aethis_discover_sections

Propose how to split source legislation into independently testable sections.
ParameterTypeRequiredDescription
domainstringyesDomain identifier (e.g. "uk_fsm")
sourcesarrayyesSource documents: [{ name: "...", content: "..." }] (1–10)
anthropic_keystringyesYour Anthropic API key — used for this request only, never stored
aethis_discover_sections({
  domain: "uk_fsm",
  sources: [
    { name: "Education Act 1996", content: "Section 512 — Provision of meals..." },
    { name: "FSM Regulations 2014", content: "Regulation 3 — Persons who..." }
  ],
  anthropic_key: "sk-ant-..."
})
Returns proposed sections with names, descriptions, keywords, and a confidence score.

aethis_validate_sections

Compare discovered sections against an expected list.
ParameterTypeRequiredDescription
domainstringyesDomain identifier
expected_sectionsarrayyesSection names the SME expects (snake_case)
discovered_sectionsarrayyesSection names returned by aethis_discover_sections
aethis_validate_sections({
  domain: "uk_fsm",
  expected_sections: ["child_eligibility", "household_qualifying_criteria", "universal_infant_fsm"],
  discovered_sections: ["child_eligibility", "household_benefits", "universal_infant_fsm"]
})
Returns match count, missing sections (expected but not found), and extra sections (found but not expected).

aethis_refine_sections

Add guidance to improve section discovery, then re-discover.
ParameterTypeRequiredDescription
domainstringyesDomain identifier
feedbackstringyesWhat was wrong and how to fix it — reference specific legislation
sourcesarrayyesSame source documents used in the initial discovery
anthropic_keystringyesYour Anthropic API key
aethis_refine_sections({
  domain: "uk_fsm",
  feedback: "Rename 'household_benefits' to 'household_qualifying_criteria' — it covers Regulation 4 qualifying criteria, not just benefits.",
  sources: [...],
  anthropic_key: "sk-ant-..."
})

aethis_set_field_spec

Store expected fields for a project. Once set, every aethis_discover_fields call auto-validates against this spec.
ParameterTypeRequiredDescription
project_idstringyesProject ID
expected_fieldsarrayyes[{ key, sort, enum_values? }]
aethis_set_field_spec({
  project_id: "proj_8CzLVwyx53rTGEJv",
  expected_fields: [
    { key: "child.age", sort: "Int" },
    { key: "child.school_type", sort: "Enum", enum_values: ["state_funded", "independent", "home_educated"] }
  ]
})
Field types: Bool, Int, Enum, Date, Duration, String.

aethis_discover_fields

Discover input fields from the project’s source text. Run before writing test cases.
ParameterTypeRequiredDescription
project_idstringyesProject ID
anthropic_keystringyesYour Anthropic API key — used for this request only, never stored
Returns fields with name, type, description, enum values, a completeness score (0–1), and any missing pathways. If a field spec was set, also returns validation results.

aethis_validate_fields

Explicit validation of discovered fields against an expected spec.
ParameterTypeRequiredDescription
project_idstringyesProject ID
expected_fieldsarrayyes[{ key, sort, enum_values? }] — same format as aethis_set_field_spec
Returns PASS/FAIL with lists of: missing fields, type mismatches, enum value mismatches, and extra discovered fields.

aethis_refine_fields

Add guidance to improve field discovery, then re-discover.
ParameterTypeRequiredDescription
project_idstringyesProject ID
feedbackstringyesWhat was wrong — reference specific source text
anthropic_keystringyesYour Anthropic API key
aethis_refine_fields({
  project_id: "proj_8CzLVwyx53rTGEJv",
  feedback: "Section 512ZA defines 'relevant school' as maintained schools and Academies only. Add child.school_type as an Enum with values: state_funded, independent, home_educated.",
  anthropic_key: "sk-ant-..."
})

Rule generation

Create, iterate, and publish rule rulesets. API key required. Anthropic key required for generation.

aethis_create_ruleset

Create a new project with source text and test cases.
ParameterTypeRequiredDescription
namestringyesHuman-readable name
section_idstringyesUnique section identifier (e.g. "child_eligibility")
source_textstringyesSource legislation, policy, or specification text
test_casesarrayyes[{ name, field_values, expected_outcome }] — at least 1
domainstringnoDomain hint (e.g. "uk_fsm")
aethis_create_ruleset({
  name: "Child eligibility gate",
  section_id: "child_eligibility",
  domain: "uk_fsm",
  source_text: "Section 512 — Provision of meals...",
  test_cases: [
    { name: "Age 4, state school — eligible", field_values: { "child.age": 4, "child.school_type": "state_funded" }, expected_outcome: "eligible" },
    { name: "Age 3, state school — too young", field_values: { "child.age": 3, "child.school_type": "state_funded" }, expected_outcome: "not_eligible" }
  ]
})
Returns project_id. Use this ID for all subsequent calls.

aethis_generate_and_test

Generate rules from source text and run all test cases. Takes 60–120 seconds.
ParameterTypeRequiredDescription
project_idstringyesProject ID from aethis_create_ruleset
anthropic_keystringyesYour Anthropic API key — used for this request only, never stored
aethis_generate_and_test({
  project_id: "proj_8CzLVwyx53rTGEJv",
  anthropic_key: "sk-ant-..."
})
Returns pass/fail count, individual test results, and for failures: the criterion that failed and a hint for fixing it.

aethis_refine

Add guidance and immediately regenerate. Shortcut for aethis_add_guidance + aethis_generate_and_test.
ParameterTypeRequiredDescription
project_idstringyesProject ID
feedbackstringnoGuidance text — must reference specific source clauses
anthropic_keystringyesYour Anthropic API key — used for this request only, never stored
aethis_refine({
  project_id: "proj_8CzLVwyx53rTGEJv",
  feedback: "Regulation 3(2)(b) restricts eligibility to state-funded schools. Independent schools and home-educated children are excluded.",
  anthropic_key: "sk-ant-..."
})
Returns the same output as aethis_generate_and_test — pass/fail count with test results.

aethis_add_guidance

Add a guidance hint without regenerating. Use to accumulate multiple hints before triggering a run.
ParameterTypeRequiredDescription
project_idstringyesProject ID
guidance_textstringyesDomain knowledge or correction — reference specific source text
process_typestringno"rule_generation" (default) or "field_extraction"
adherencestringno"exact", "guided" (default), or "loose"
process_type controls which authoring phase the hint targets:
  • "rule_generation" — influences how rules are compiled from source text
  • "field_extraction" — influences how input fields are discovered
adherence controls how strictly the LLM must follow the hint:
  • "exact" — must follow precisely
  • "guided" — strong preference (default)
  • "loose" — suggestion only

aethis_add_domain_guidance

Add guidance that applies to all projects in a domain — use for cross-section principles.
ParameterTypeRequiredDescription
domainstringyesDomain identifier
guidance_textstringyesCross-section guidance
process_typestringno"rule_generation", "field_extraction", or "section_discovery"
adherencestringno"exact", "guided" (default), or "loose"
notesstringnoSME commentary or provenance — never sent to LLM
aethis_add_domain_guidance({
  domain: "uk_fsm",
  guidance_text: "Use child.* prefix for child fields, household.* for household fields.",
  process_type: "field_extraction",
  adherence: "exact"
})

aethis_list_guidance / aethis_list_domain_guidance

List all guidance hints for a project or domain.
ParameterTypeRequiredDescription
project_idstringyes (list_guidance)Project ID
domainstringyes (list_domain_guidance)Domain identifier

aethis_publish

Publish the current rule ruleset. Runs tests first — refuses if any fail unless force: true.
ParameterTypeRequiredDescription
project_idstringyesProject ID
forcebooleannoPublish even if tests are failing
labelstringnoHuman-readable version label
aethis_publish({
  project_id: "proj_8CzLVwyx53rTGEJv",
  label: "v1 — child eligibility gate (age 4–15, state-funded schools)"
})
Returns ruleset_id, version, and test pass count. Auto-deprecates the previous active ruleset.

Discovery and management

aethis_list_projects

List all projects. No parameters. Returns project IDs, names, domains, and latest ruleset info.

aethis_list_rulesets

List all rulesets for a project.
ParameterTypeRequiredDescription
project_idstringyesProject ID

aethis_archive_project / aethis_archive_ruleset

Permanently archive a project or ruleset. Archived items are preserved but excluded from listings and /decide resolution.
ParameterTypeRequiredDescription
project_idstringyes (archive_project)Project to archive
ruleset_idstringyes (archive_ruleset)Ruleset to archive

Common workflows

Evaluate eligibility (2 calls)

aethis_schema({ ruleset_id })          → field names, types, enum values
aethis_decide({ ruleset_id, fields })  → eligible / not_eligible / undetermined

Conversational evaluation (loop)

aethis_next_question({ ruleset_id, field_values: {} })        → first question
aethis_next_question({ ruleset_id, field_values: { ... } })   → next question or decision
// Repeat until decision is reached

Single-section authoring

aethis_create_ruleset(name, section_id, source_text, test_cases)  → project_id
aethis_discover_fields(project_id)                                → confirm field names
                                                                  → write test cases
aethis_generate_and_test(project_id)                              → run tests
aethis_refine(project_id, feedback) × N                           → iterate on failures
aethis_publish(project_id)                                        → ruleset_id

Multi-section authoring (three phases)

Phase 1 — sections (once per domain):
aethis_discover_sections(domain, sources)
aethis_validate_sections(domain, expected, discovered)
aethis_refine_sections(domain, feedback, sources)     // if wrong
Phase 2 — fields (per section):
aethis_set_field_spec(project_id, expected_fields)    // optional, recommended
aethis_discover_fields(project_id)
aethis_validate_fields(project_id, expected_fields)   // explicit gate
aethis_refine_fields(project_id, feedback)            // if wrong
Phase 3 — rules (per section):
aethis_create_ruleset(...)
aethis_generate_and_test(project_id)
aethis_refine(project_id, feedback)     // repeat until all pass
aethis_publish(project_id)             → ruleset_id
See Section discovery, Field vocabulary, and Rule generation for detailed guidance.