Skip to content

What's New in Version 1.21.0

July 13, 20261:26 PM UTC

Version 1.21.0 of the relationalai Python package is now available!

To upgrade, activate your virtual environment and run the following command:

Terminal window
pip install --upgrade relationalai
  • Improved the clarity of error messages when you define membership between concept types that do not match in Model.define(). Before this release, m.define(Target(Source)) could fail with a generic type-mismatch message that did not tell you how to fix the model. Now the error explains compatible fixes, such as making Target a subtype of Source or using AnyEntity when you intentionally allow heterogeneous membership. This example shows one invalid definition and two valid fixes:

    from relationalai.semantics import AnyEntity, Model
    m = Model("Demo")
    SourceConcept = m.Concept("Order")
    # Invalid: TargetConcept does not extend SourceConcept.
    TargetConcept = m.Concept("NeedsReview")
    m.define(TargetConcept(SourceConcept))
    # Valid fix 1: make the target concept a subtype of SourceConcept.
    TargetSubtype = m.Concept("OrderThatNeedsReview", extends=[SourceConcept])
    m.define(TargetSubtype(SourceConcept))
    # Valid fix 2: use AnyEntity when membership should accept mixed concept types.
    TargetAnyEntity = m.Concept("NeedsReviewAny", extends=[AnyEntity])
    m.define(TargetAnyEntity(SourceConcept))
  • Restored arguments passed to Concept.annotate() when you generate PyRel code and load it again. Before this release, when you generated PyRel code and loaded it again, values inside annotate(...) could be dropped, for example turning annotate(Tag("customer")) into annotate(Tag). Now full annotate(...) calls, including their argument values, are preserved when you generate PyRel code and load it again.

  • Preserved decimal literal scale and precision when you generate PyRel code and load it again. Before this release, decimals such as 2.50 could come back as 2.5, and high-precision values could lose digits. Now PyRel preserves decimal meaning during code generation and reload.

  • Retained filters in where(...).require(...) rules when you generate PyRel code and load it again. Before this release, a filtered rule could be regenerated as a broader Model.require() call without the original Model.where() condition. Now the where(...) condition is preserved, so the requirement still applies only to the intended subset.