verbot 5 sdk - loading KnowledgeBases
<p>I'm looking for help from anyone who's worked with the verbot sdk.</p>

<p>I'm making a program that I want to use the LearnedKnowledge.vkb, Teacher.vkb, and any standard bot (julia, for example).  Those who've used this before will know that with the rules in Teacher, you can essentially write responses to things that the bot doesn't understand, and train it on the fly.  </p>

<p>I'm planning on using speech recognition and text-to-speech, but my problem right now is that after I load the knowledgebases, I can't seem to get any response from the bot.</p>

<p>Here's what I have: The Verbot5Library.dll, from verbots.sourceforge.net (I got the editor and player too, to make sure the files were working).  In my program, I set up the variables as such:</p>

<pre><code>    Verbot5Engine verbot = new Verbot5Engine();
    KnowledgeBase kb = new KnowledgeBase();
    KnowledgeBaseItem kbi = new KnowledgeBaseItem();
    State state = new State();
    XMLToolbox xmlToolboxKB = new XMLToolbox(typeof(KnowledgeBase));
</code></pre>

<p>Then I initialize the verbot engine and load the kbs:</p>

<pre><code>        // using the xmlToolboxKB method I saw in this forum:  http://www.verbots.com/forums/viewtopic.php?t=2984
        kbi.Fullpath = @"C:\\[full path to kb...]\\";
        kbi.Filename = "LearnedKnowledge.vkb";
        kb = (KnowledgeBase)xmlToolboxKB.LoadXML(kbi.Fullpath + kbi.Filename);
        verbot.AddKnowledgeBase(kb, kbi);

        kbi.Filename = "julia.vkb";
        kb = (KnowledgeBase)xmlToolboxKB.LoadXML(kbi.Fullpath + kbi.Filename);
        verbot.AddKnowledgeBase(kb, kbi);

        //trying to use LoadKnowledgeBase and LoadCompiledKnowledgeBase methods:  verbot.LoadKnowledgeBase("C:\\[full path to kb...]\\LearnedKnowledge.vkb");
        //verbot.LoadCompiledKnowledgeBase("C:\\[full path...]\\julia.ckb");
        //verbot.LoadCompiledKnowledgeBase("C:\\[full path...]\\Teacher.ckb");

        // set up state
        state.CurrentKBs.Add("C:\\[full path...]\\LearnedKnowledge.vkb");
        state.CurrentKBs.Add("C:\\[full path...]\\Teacher.vkb");
        state.CurrentKBs.Add("C:\\[full path...]\\julia.ckb");
</code></pre>

<p>Finally, I attempt to get a response from the verbot engine:</p>

<pre><code>        Reply reply = verbot.GetReply("hello", state);
        if (reply != null)
             Console.WriteLine(reply.AgentText);
        else
             Console.WriteLine("No reply found.");
</code></pre>

<p>I know julia has a response for "hello", as I've tested it with the editor.  But all it ever returns is "No reply found".  This code has been taken from the example console program in the SDK download (as very little documentation is available).  That's why I need some pointers from someone who's familiar with the SDK.  </p>

<p>Am I not loading the KBs correctly?  Do they all need to be compiled (.ckb) instead of the XML files (.vkb)?  I've used the verbot.OnKnowledgeBaseLoadError event handler and I get no errors.  I even removed the resource file Default.vsn needed to load the Teacher, and it throws an error when trying to load it so I'm pretty sure it's all loading correctly.  So why do I always get "No reply found"?</p>
