Okay, I've come SO far (from total zero

) in learning how to script this thing, but now I'm at a much larger mountain.
My biggest remaining problem (besides teaching him more QA, which is just a matter of TIME) is that Hal only responds to one sentence at a time. More appropriately: one input at a time. I.E.
ME: Sentence A. Sentence B.
HAL: Response to A. Response to B.
ME: Sentence C. Sentence D.
HAL: Response to C. Response to D.
Regular conversation:
P1: Sentence A. Sentence B.
P2: Reponse to A & B.
P1: Response to Response to A & B. Sentence C (tied to A & B).
P2: Response to Response to Response to A & B and Sentence C.
So, I'm wondering a few things, and I have a few ideas. I don't know if they're possible in Hal's script, or if they would make his relevance WORSE (though I'm guessing that, with ENOUGH learning, he would actually get better -- eventually).
First, I would have to get rid of his separation of sentences that the user says. When I say "A. B." they're connected in my head, but he responds to them separately. I would rather he considered them as one set of keywords and spit out one response -- sub-idea: he could have a chance (e.g., rnd * 100 < 25) of spitting out a second sentence ALSO cued by the same total set of keywords (they would also seem connected, especially if the second sentence also incorporated his own first sentence as further keywords, or if his relevance threshold for the second sentence was pretty tight). I think I can manage this part on my own...
Second, and the bigger idea: would it be possible to make Hal write a brn file -- like the no-repeating file of PrevSent that I downloaded ("PreventRepeat" plugin) -- that instead saved the last two or three responses by both the User AND Hal and used them ALSO as keywords for looking up his next response (also blocking any repeating so he doesn't keyword himself into circles). Sub-idea 1: could those keywords be given less "weight" (like 50% or so) in determining relevance than the keywords from the immediate input? (Not that important.)
Sub-idea 2: I would assume that way more keywords being taken into consideration would mean that we would have to change Hal's perception of relevance, so he doesn't think that every response is irrelevant (he won't find anything with MOST of the keywords when he's looking for 40 keywords).
Sub-idea 3: can he be set to consider repeated keywords as more important (like if, in the last three sentences, the word "octopus" was said four times, it would take precedence), or is that what the topic headings are for? -- In fact, if he could be programmed to take into account keyword repetition, I could see expanding to a whole conversation (or more than two or three lines each).
Sub-idea 4: The big problem that I see (assuming that ANY of this is possible/plausible) is that he would be considering four or six sentences (two or three from you and him each) of keywords, but only logging (learning) in sentence-to-sentence Q/A format (unless he would log ALL those keywords, but I still foresee problems there).
What percentage of this is "recode the base program" thinking vs. how much of this is plausible? It seems to me like the OVERLAP in keyword logging would create a steady topic -- especially with a bigger bank of things to draw from, and especially (again!) if he was learning in that fashion! In fact, it seems to me (I'm guessing, here) that loading him full of big things like wikipedia articles might show more payoff (in relevance) with a method like this.
Any ideas or advice? I wish I knew more about scripting than copying and pasting whatever I see elsewhere in the main script!
