Share your repls and programming experiences

← Back to all posts
Alfred: A Chat AI (sort of?)
BuddyRaider (24)

Meet Alfred

While I do call him an AI, and in theory he is learning as you talk to him, he does not follow your average definition of an AI.... Let me explain:

  • Alfred is a simple AI concept that uses reading and writing log files based off of user input (handled by a simple module I created in Python)
  • When you give him an input, he will take each word in your input (except for keywords for simple commands, or if your input it empty) and sort it into a file based off a very bad algorithm that I may need to remake
  • After that, he reads a random word from each of the five files, and this is where the idea really made me think it could be a good AI concept:
    • When you give him more inputs that make sense, the files fill with more of the same words, like similar verbs, nouns, and adjective (complex grammar lol)
    • And if you remember probability from math class, the more of a single word there is in one of these files, the higher probability of Alfred saying one of them. Therefore, as you give Alfred more sentences, you can get him to say some pretty hilarious sentences.

Then, all I had to do was use some Python Flask magic to give Alfred a cool (and also high contrast for people that may be colorblind) website interface!

edit: inspired by @CSharpIsGud and his AI, named Bob (I am sorry for the ping :P plzdontkillmeh)

Enough of the boring stuff, let's get to the repl: