The Book of AI

How To Build Chatbots with The Personality Forge
Chapters
Chapter 5: The Seek System
1 Seeks
Seeks

Seeks are a powerful part of the AI Engine. They let you thread Keyphrases and Responses - in other words, they are Keyphrases that apply only after the Response they're attached to. And then the selected Seek's Responses can have Seeks of their own. You can go as deep as you want. Seeks are Keyphrases, so they can do all the things Keyphrases can, but they have a few additional powers.

How To Use It

To add Seeks to a Response, click "+ Seek" to the right of the Response.

Special Seeks

yes, no, & haha

There are three Keyphrases that have extended matching power: "yes","no" and "haha". Each of these has an expanded reach in the AI Engine and cover every possible way of saying them. Seeks of "yes" and "no" are extremely useful and common.

xnomatch

If you add a Seek called xnomatch, it will be triggered if no other Seeks are found.

Let's say a chatbot asks "Do you love me?" and that Response has three Seeks: "yes", "no", and "xnomatch". If the person responds to the chatbot by saying "Yes, I sure do!" then the yes Seek will be triggered. If the person's response is "I need to get going", then xnomatch will trigger and the chatbot could say "Why are you avoiding the question?". If there was no xnomatch Seek, then the general list of Keyphrases would then be searched as usual.

Reusing The Original Keys

As you know, whenever a Keyphrase or Seek is matched, Key Plug-ins such as (key1) and (key2) are generated. When you are writing Responses for Seeks, you can access the Key Plug-ins from the original Keyphrase match. This lets you access the original topics of conversation in Seek Responses. To access them, put "first" at the beginning of each: for example (firstkey1) or (firstpostkey)

Therefore:
Person: "Do you ride white horses?"
Bot: "I ride white horses every day."
Person: "Even on your birthday?"
Bot: "Yes, I especially like to ride white horses on my birthday."

2 Pointing To Other Keyphrases
Goto Responses

Let's say you've got a solid set of Responses for a particular Keyphrase, and you want to use that set somewhere else as well. Rather than copying those Responses, you can have a Response that looks like this: "goto 12345". When that Goto Response is selected, the AI Engine will instead choose a Response from the Keyphrase with the ID 12345. There are three times when you should use gotos:

  1. Goto Responses really shine when you're writing Seeks. As Seeks can form complex structures, it's sometimes useful for one Seek to point into the structure of another, or end on another Keyphrase.
  2. When you want to sometimes use Responses from another Keyphrase, then you can write several normal Responses and then add one or more Goto Responses that point to the other Keyphrase whose Responses you want to sometimes use.
  3. When you want different Keyphrases to use the same Responses, use Keyphrase Lists. However, if there are too many variations to fit in one Keyphrase (this should be very rare), you can get more space by creating another Keyphrase List with a single Goto Response pointing to the first.

Hover over the [go] box to the right of any Keyphrase in the Language Center, and you'll see a little popup that says "goto" followed by a number. That's the goto and ID that you can use as a Response to redirect to that Keyphrase's Responses.

Be aware - if the new Responses you are pointing to require (key)s, make sure the Keyphrase with the goto Response is collecting the same (key)s. Otherwise the (key)s in the resulting Response will be blank. For similar reasons, you cannot goto xgossip, xfavorite, or xmath. All of these require a number of things from internal processing and must be triggered naturally.