The basic idea behind neural networks based chatbots is to search in a textcorpus for a replay from the past and put this to the screen. The starting point is usually a textfile which contains 100 MB of chat protocols from the past. It has a structure like “user1 says sentence1, user2 says sentence2, user1 says sentence3” and so on. If the user interacts with the chatbot, he enters a sentence, for example “Hi, what is your name?”. The chatbot takes this input, generates a sql-query to the 100 MB textfile and searches for a similar sentence in the database. The correct replay is given by the line stored below the original sentence. That means the chatbot will imitate an existing dialogue.
In reality, some detail problems have to be answered. For example what to do if an input was not in the database. Or how to modify the output slightly, so that it will sound more natural. This is treated with different techniques like nlp-parsers, dialogue models and neural networks. All these methods support the query on an existing textfile. They interpolate between existing information with the aim to improve the language retrieval.