For the complete documentation index, see llms.txt. This page is also available as Markdown.

Concepts, relationships, and instances

Define valid data types, relationships, facts, and instances in RBlang.

Concepts

Concepts define the entities and values in your knowledge map.

<concept name="Person" type="string"/>
<concept name="Age" type="number"/>
<concept name="Birth Date" type="date"/>
<concept name="Is Active" type="truth"/>

RBlang supports exactly four data types:

  • string

  • number

  • date

  • truth

Use concept names for classes of data. Do not use specific values as concept names.

  • Good: Product Count

  • Bad: Two

Datasources on concepts

Datasources are optional child elements of a concept.

Use them when Rainbird needs to call an external API for that concept.

In practice, the concept acts as the request subject.

This is advanced functionality. Use the concept definition as the anchor point, then configure the request and mappings in Datasources.

Key points:

  • A datasource is nested inside the concept definition.

  • The concept should be a string concept that can act as a relationship subject.

  • {{%S}} inserts the current datasource subject into the request.

  • <input> fetches extra values needed to build the request.

  • <action> maps API response values onto relationships that share the same subject.

Relationships

Relationships connect two concepts.

Relationship attributes:

  • name β€” required and unique across the whole knowledge map

  • subject β€” required and must reference a string concept

  • object β€” required and can reference any concept type

  • plural β€” optional, defaults to false

  • askable β€” optional, used when Rainbird can ask a user for the value

  • allowCF β€” optional, defaults to true, lets a user provide a certainty factor when answering

  • allowUnknown β€” optional, defaults to false, lets a user skip the question

  • canAdd β€” optional, controls whether a user can add instances not already in the knowledge map. Supported values are subject, object, all, and none

  • group β€” optional, groups questions from relationships that share the same subject. Use commas to assign more than one group. Ensure a group contains two or more relationships.

Use plural="true" when a subject can have more than one object.

Askable relationships

The askable attribute controls whether Rainbird can ask for facts on the relationship, and what form that question can take.

Supported values:

  • none β€” do not ask questions for this relationship

  • secondFormObject β€” ask for the object value only

  • secondFormSubject β€” ask for the subject value only

  • all β€” allow both subject and object questions, including first-form confirmation questions

Askable values explained

none

Use none when the relationship should never prompt a user.

This is useful when the fact must come from stored data, rules, imports, or an external datasource.

secondFormObject

Use secondFormObject when you know the subject and want Rainbird to ask for the object.

This is the most common pattern.

This asks about the missing object for a known subject.

secondFormSubject

Use secondFormSubject when you know the object and want Rainbird to ask for the subject.

This asks for the missing subject for a known object.

all

Use all when Rainbird can ask in any supported form.

This includes:

  • second-form object questions

  • second-form subject questions

  • first-form confirmation questions that check whether a fact is true

Use none when user questioning is not allowed. Use secondFormObject or secondFormSubject when only one direction makes sense. Use all only when both directions and direct fact confirmation are valid for the same relationship.

Question text

When setting question text use %S as the subject placeholder or %O as the object placeholder in relevant question text.

Concept instances

Concept instances create named instances for string concepts.

Concept instances can also include metadata about the instance.

These are invalid:

Relationship instances

Use relationship instances for facts.

Use primitive values directly for number, date, and truth objects.

Validity checks

Before you save, confirm that:

  1. Every concept exists before a relationship uses it.

  2. Every relationship exists before a fact or rule uses it.

  3. Every subject concept is string.

  4. Every instance type is a string concept.

  5. Every datasource action maps only to relationships that share the datasource subject.

Last updated