Quickstart guide

Building your first knowledge map in Rainbird

1. Introduction

In this introductory guide, we'll walk you through creating your first 'Hello World' model as your first step in building explainable AI models for automating complex decisions.

By the end, you'll have a foundational understanding of Rainbird's key features:

  1. Constructing a basic knowledge map

  2. Using our reasoning engine

  3. Understanding the evidence tree

2. Getting started

Let’s dive into the 'Hello World' model—the simplest model you can create in Rainbird. It's your starting point to grasp how to model intelligent decisions. The aim is to build a simple model that can help you decide what language a person might speak based on where they live.

Before you start:

  1. Log into the Rainbird Studio.

  2. Create a new map and save it as 'Hello World.' Don’t worry about losing changes; Rainbird auto-saves as you go.

Find out the difference between Community and Enterprise here.

3. Concepts and Relationships

A knowledge map is how Rainbird represents your knowledge. It consists of 'concepts' like ‘Person', ‘Country', or ‘Language’ connected by 'relationships' that describe how they interact. Some examples of concepts and their relationships might be:

People speak languages

Animals live in habitats

Companies recruit employees

Cars are made by manufacturers

Your task is to model this in Rainbird. Consider what concepts you might choose for your knowledge map.

Remember you’re ultimately interested in the language that a person speaks, so you might model the concept of a “Person” and a “Language”. In order to determine what language a person speaks, you could consider the “Country” a person lives.

After adding your first concept, add following concepts like this:

Once these concepts have been added to your knowledge map you need to consider how they are related to each other in the context of your decision.

You could tell Rainbird that:

Person speaks language Person lives in country Country has national language language

Add relationships like this:

There are many ways to configure these relationships, but this is covered in more advance materials.

4. Concept instances

Now, it's time to populate your knowledge map with actual data—or 'instances.' An instance is an example of a concept. For example, 'Fred' is an instance of ‘Person.'

Add instances like this:

Add the following as instances:

Person > Fred

Country > England, France, Spain

Language > English, French, Spanish

5. Facts

Facts link specific instances together. For example, you can state "England has a national language English," to create this as a fact that the model can use to make decisions.

Here is an example of adding a fact:

Add the following as facts:

England -> has national language -> English France -> has national language -> French Spain -> has national language -> Spanish Fred -> lives in -> England

Remember, Rainbird is more than just a store for facts—it uses them to make decisions through rules.

6. Rules

Rules allow Rainbird to infer new facts. Think of them as guidelines that tell Rainbird when certain facts apply.

Create a rule like this:

With this rule, you could provide Rainbird with a persons name and it can deduce which language they speak based on where they live and that country’s national language.

7. The Reasoning Engine

The reasoning engine is Rainbird's brain. It applies the logic of your knowledge map to intelligently gathers facts from a variety of sources and provides you with decisions. You'll learn how to use it more effectively as you continue.

8. Query

Queries are how you ask Rainbird to make decisions. You can test them directly via the Studio by clicking on any relationship and clicking Run Query.

If you run a query on a relationship that has to ask you for the information, the query will fail. For the majority of use cases, you only query a relationship that includes rules.

You will also get a Certainty Factor (cf) of 100%. This is because we didn’t adjust any of the weights or certainties in the model, but this is covered later.

Rainbird explained

The Rainbird Reasoning engine will process your knowledge map with the goal of filling in the blank. In this example it is:

Fred > speaks > [blank]

At this point, the engine will check if it is already known, perhaps this fact has been configured in the knowledge map? If not, it will check the rules in the map to determine if it can infer the fact.

We have created one that describes how we could infer the language a person speaks. It needs two facts to determine this. The country Fred lives and the national language of that country.

Both of these are known already, therefore the engine can infer the answer it is looking for is English.

Re-run the query again

Now re-run this query, this time entering your own name.

Rainbird doesn’t know where you live, therefore it will ask (Note: the question wording can be customised on the relationship).

If you select a country listed in the drop-down (England, France or Spain), the engine knows the national language of these and it can infer a fact and a result will be returned.

You can also respond with a different country and the engine will continue to try and meet its goal. In this case, it will ask for the national language of your home country. With that information it can infer the fact and provide a result.

In more advanced maps, this could use other rules to infer the national language or it could contact an external API to retrieve up-to-date information on countries and their national languages. All of this is covered in our more advanced learning modules.

9. Evidence Tree

The Evidence Tree visualises how Rainbird arrived at a decision. It shows the path Rainbird followed, using facts and rules to get a result. Click the 'i' icon next to a result to explore this tree.

Conditions within a rule can be selected for further information on how that condition was met. This could be from a user answering a question, a fact stored in the map, obtained from an external datasource or inferred by another rule.

Each rule can be further interrogated by opening a detailed view using the (-) icon. This displays a chart to demonstrate the impact the weight of each of the conditions had on the certainty of that rule.

10. Refine and Iterate

When modelling a decision in Rainbird you can start small and gradually apply more of your expertise as you, making small changes and testing them as you go.

This first model assumes that people speak the national language of the country they live—which isn't always true.

To reflect reality, you can extend the model to consider where the person was born, how long they have lived in the country or their parents native language.

You can fine-tune this further by setting the importance of conditions (weights), whether they're optional or mandatory (behaviour) and the maximum certainty of any inferred fact. This means Rainbird can then make inferences with varying degrees of confidence, depending on the data available, just like a human would.

All of this and more is covered in our more in-depth training modules on the Academy.

11. Summary and Next Steps

Congratulations! You now understand the basics of creating a decision model in Rainbird.

Why not get inspiration from some of our use cases to see how Rainbird can be used.

pageExample use cases

Get further details on building decision models in our knowledge modelling section

pageWhat is knowledge modelling?

Or if you're a developer, take a look at our API guides to help you understand how to integrate Rainbird models into your solutions

pageOverview

Last updated