Asked

Improving JD Humanoids Conversation Responses

I am working with a JD Humanoid Robot and utilizing Bing Speech Recognition and AIMLBot to enable conversational interactions with it. However, I am encountering issues where the robot responds with irrelevant or nonsensical answers to my questions. For example, when I ask, "Robot, do you have a name?" the robot simply replies, "I obey your command."

How can I configure the system so that the robot provides more meaningful and contextually appropriate responses to such questions? I am looking for guidance on improving the robot's conversational capability using AIML (Artificial Intelligence Markup Language) or any other recommendations within the Synthiam ARC environment.


Related Hardware JD Humanoid
Related Controls AimlBot OpenAI ChatGPT

ARC Pro

Upgrade to ARC Pro

With Synthiam ARC Pro, you're not just programming a robot; you're shaping the future of automation, one innovative idea at a time.

Author Avatar
PRO
Canada
#1  

Thanks - good details. Below are practical steps and examples to improve JD Humanoid’s conversational responses using AIML, plus ideas to combine AIML with the OpenAI ChatGPT robot skill as a fallback for richer answers.

Summary (quick):

  • Improve AIML by adding focused categories for common questions, using <random> variations, and using <set>/<get> for memory.
  • Use context (<that>, <topic>) so replies match the flow of conversation.
  • Make a fallback path: if AIML returns a generic/unknown reply, forward the user’s phrase to OpenAI ChatGPT for a meaningful answer.
  • Edit AIML in the AimlBot config folder (copy the default AIML files into a project-specific folder first to prevent overwrite).
  • Optionally, use AimlBot’s Response Script to speak response and/or call OpenAI when needed.
  1. Edit AIML files (where & how)
  • Open the AimlBot robot skill Settings (three-dot kebab menu) Open Config Folder.
  • Copy the AIML and CONFIG folders into a new project folder (prevents updates overwriting your edits).
  • Edit the AIML files with the GaitoBot editor or any text editor (files are XML).
  • Save, then restart the AimlBot skill or ARC project to reload AIML files.
  1. AIML best practices & examples
  • Use clear patterns, lots of alternatives, and <random> for variety.
  • Use <set> to remember values and <get> to reference them later.
  • Use <that> to only match replies when the bot recently asked something (context management).
  • Use <srai> to redirect similar patterns to a canonical category.

Example AIML categories you can add (save in a file like myresponses.aiml):

<aiml version="1.0.1" encoding="UTF-8">
  <category>
    <pattern>DO YOU HAVE A NAME</pattern>
    <template>
      <random>
        <li>Yes, my name is JD.</li>
        <li>I'm called JD. What's your name?</li>
        <li>My name is JD Humanoid. Nice to meet you!</li>
      </random>
    </template>
  </category>

  <category>
    <pattern>WHAT IS YOUR NAME</pattern>
    <template>
      <random>
        <li>My name is JD. You can call me JD.</li>
        <li>I go by JD Humanoid.</li>
      </random>
    </template>
  </category>

  <!-- Remember the user's name -->
  <category>
    <pattern>MY NAME IS *</pattern>
    <template>
      <think><set name="<star/>" /></think>
      Nice to meet you, <get name/>!
    </template>
  </category>

  <category>
    <pattern>WHAT IS MY NAME</pattern>
    <template>
      <condition name="name">
        <li value="">I don't know your name yet. What should I call you?</li>
        <li><get name/>, that's what I remember.</li>
      </condition>
    </template>
  </category>

  <!-- Fallback canonicalization -->
  <category>
    <pattern>DO YOU HAVE A *</pattern>
    <template>
      <srai>DO YOU HAVE A NAME</srai>
    </template>
  </category>
</aiml>

Notes:

  • Add many synonyms and word orders (e.g., "what’s your name", "who are you", "are you named").
  • Add multiple files or split topics to keep things organized.
  • Use <random> to avoid repetitive answers.
  1. Use context (<that>) to avoid wrong answers If the robot asked "What is your name?" and the user replies "I obey your command" it suggests pattern mismatches. Use <that> to match the user reply only when appropriate.

Example: match "I AM *" only if the bot previously asked for a name.

<category>
  <pattern>I AM *</pattern>
  <that>WHAT IS YOUR NAME</that>
  <template>
    <think><set name="<star/>" /></think>
    Nice to meet you, <get name/>!
  </template>
</category>
  1. Make AimlBot speak and run actions
  • In AimlBot settings you can add scripting for each response (the "Response Script").
  • Prefer JavaScript or Python here (we prefer JavaScript). Use getVar("$BotResponse") to read the AIML reply and then Audio.say() or Audio.sayEZB() to speak.

Example JavaScript response script to speak and catch fallback keywords:

// Speak AIML reply out of PC speaker
Audio.say(getVar("$BotResponse"));

// If the AimlBot reply is a generic fallback, send the original user phrase to OpenAI for a richer reply
var botResp = getVar("$BotResponse", "").toLowerCase();
var userPhrase = getVar("$BingSpeech", ""); // or whatever variable you use for incoming phrase

// list of fallback phrases your AIML uses (adjust to match your AIML)
var fallbacks = ["i don't know", "i do not know", "i cannot answer that", "i'm not sure"];

// if fallback detected, call OpenAI ChatGPT with the original user phrase
for (var i = 0; i < fallbacks.length; i++) {
  if (botResp.indexOf(fallbacks[i]) !== -1) {
    // Send to OpenAI ChatGPT (fallback)
    ControlCommand("OpenAI ChatGPT", "Send", userPhrase);
    break;
  }
}

Notes:

  • Replace getVar("$BingSpeech") with whichever variable holds the original user text you pass into AimlBot.
  • The OpenAI skill will return a richer answer; you can configure the OpenAI Response Script to speak and/or set variables.
  1. Route unknowns directly to OpenAI (alternate) Instead of or in addition to fallback in the AimlBot response script, you can detect "no-match" patterns in AIML and immediately produce a special token like "OPENAI". Then the Response Script checks for that token and forwards the original user phrase to the OpenAI skill.

  2. Improve input quality (speech text) Sometimes errors come from speech recognition translating phrases poorly:

  • Review the $BingSpeech output (or your voice recognition variable) for mis-transcriptions.
  • Add spelling and alternate misheard words in AIML or add grammar-specific patterns.
  • Enable VAD auto-recording or reduce ambient noise.
  1. Debugging tips
  • Use AimlBot’s "Show All Settings / Conversation History" to see what AIML matched and what’s in memory.
  • Temporarily print variables in the AimlBot Response Script:
print("UserPhrase=" + getVar("$BingSpeech"));
print("BotResponse=" + getVar("$BotResponse"));
  • This will help you see why the robot said "I obey your command" - often because AIML pattern matched wrong rule.
  1. Combine AIML + OpenAI for best of both
  • Use AIML for deterministic, robot-specific facts, memory, and behaviors (name, available commands, robot personality, safe movement).
  • Use OpenAI for open-ended, creative, or fallback answers and image descriptions.
  • In OpenAI skill settings, use the Personality tab to give the robot consistent voice & instructions so responses won’t conflict with AIML.
  1. Want me to create examples for you? I can:
  • Create a set of AIML categories for common robot questions (name, capabilities, hello/goodbye, how are you).
  • Provide a ready-to-paste AimlBot Response Script (JavaScript) to speak and forward unknowns to OpenAI.
  • Create an example workflow to route Bing Speech AimlBot OpenAI fallback.

Before I prepare files or scripts, tell me:

  1. Which speech recognition skill are you actually using (Bing Speech, Google, etc.)? (So I can use the right global variable like $BingSpeech.)
  2. Do you want fallback to OpenAI automatically, or only when you explicitly ask (e.g., "ask the internet")?
  3. Do you want the robot speak with PC speaker or EZB speaker (Audio.say vs Audio.sayEZB)?

If you want, paste the exact AIML or the AIML category that’s returning "I obey your command" and the user phrase you said - I’ll diagnose why it matched and show a fix.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.