View a markdown version of this page

How business rules are used - AWS Context

How business rules are used

Business rules are the facts and limits that apply to how your business works. For example, a claim always belongs to one policy, or an order’s status can only be Open, Shipped, or Closed. You can write rules like these in your ontology as SHACL shapes or OWL restrictions on the class that they apply to.

When you add your ontology to an Agent Context, AWS Context imports every rule into the Agent Context with the rest of the ontology. The rules then stay there for later use: the retrieval agent reads them when it answers questions.

AWS Context uses language models to extract information and to answer questions, so it applies your rules as guidance, on a best-effort basis. The rules help the model give answers that match your business.

AWS Context uses your rules in the following ways:

  • When it answers a question – When a question involves a class that has a rule, AWS Context gives the retrieval agent the complete rule, written out in plain words, including rules from the class’s parent classes. For example, the retrieval agent can use the rule as a filter in the SQL that it runs on a table grounded to the class. For the kinds of rules that AWS Context reads, see Rules on a class.

  • When it extracts information – A language model sorts the information that it finds in your data into your ontology’s classes, mainly by class name.

To help AWS Context apply your rules, follow these practices:

  • Explain each rule in plain words in rdfs:comment or skos:definition, in addition to stating it in OWL or SHACL.

  • Name classes and properties for what they mean in your business.