AI Chat Bot

I am working on an AI chat bot in Python. It works by comparing user input to a text file of possible responses. It finds the closes match to your question in the responce file, then uses the responce in the text file. This means you don’t have to spell words exactly, and there does not have to be a perfect string match.

This would be perfect for in game characters.

If you use this give me credit.

You can ask “How do you work?” for a simple summary of how the code is designed.



have you looked into ALICE ?

there are python implementations. i already successfully tested it. works quite well. depending on your chat-database you can have quite good conversations with it.

i planned to use it to make an in-game AI intelligent enough to talk to you (via alice and speech-synthesis). i didnt continue due to my lazyness to have a database which fits the in-game situation,tho

Yes, that is one of the many reasons I wanted to create my own. In my option, my method works better in a limited, game environment. And the database is very easy to edit.

I did something like this for an IRC bot, except it used JSON to serialize responses. It would also devoice, kick, and even temp ban you if you made it mad.

Any examples on how to use it?

Simple run the .py file. You can chat in the console window.

Oh I thought it provided a API of some sort to incorporate it into a panda3D project.

No, as this was not created just for games. It would be very easy to modify the code to do so, though.

The the to an updated version is in my first post.

I like it:) I may use it in one of my games for the npcs. It be nice to have the power to chat with the npc to get information from them instead of the point and click style.

I gived you credit with in the file/credit list, but I remove the creater lines from the database. Hope that’s ok.

Its perfectly okay to mod the database files.



I might be able to help on this one - give me a shout if you feel so. I have recently had to develop a 3D Jabber Bot game for a client.

Based around “activities”/scenes. The player selects scene, logs in, bots appear in the scene (if online and if the scene configuration file dictates they appear in that scene). As noted, every bot is just a “jabber bot”, it signs on to an openfire server and if available - responds to chat.

User communicates … all 3D environment and animated characters. I wrote one generic “chat bot” that is driven by a configuration file itself - just run multiple instances (with different configurations) for each bot required (brain is powered by AIML).

Contact me via the FlatCoder link below if it sounds useful.

Cheers and Good luck with the project!

For example, this scene:

Is driven by this configuration file (the choice of ‘server’ appears in a drop-down on the main game menu as does the list of activities):

name =

name =

uuid = Restaurant
model = newcafe
camera_xyz = 1500 -52 180
camera_hpr = 120 -10 0

uuid = bob
model = bots/bob/bob
idle = bots/bob/bob_idle
start_xyz = 879 -295 0
start_hpr = 130 0 0
appears_in_uuids = Restaurant

uuid = bill
model = bots/bill/bill
idle = bots/bill/bill_idle
start_xyz = 1120 -95 0
start_hpr = 100 0 0
appears_in_uuids = Restaurant

The bot (AIML powered) is a separate piece of code driven by a config file (passed as a command line parameter - just run multiple instances with different configurations):

password: botpassword
name: Bob
brain: brains/bob.xml
master: Yoda
gender: man
birthday: 1st April 2011
birthplace: England
location: Spain
favoritecolor: Green
favoritefood: Pizza
favoriteband: Metallica
favoritebook: Moby Dick

level: 5
filename: logs/bob.log

Each chat bot can hold multiple conversations (i.e., talk to more than one person at a time without getting confused in the conversation).


Interesting. My chat bot is more a replacement for the AIML engine you used. Its meant as a frame work to be built on to.

Did you by any chance have lip syncing from the chat bots?

The lasted incarnation of this can be found here: [Tressy 2.0)

No, no lip syncing as of yet - that would imply parsing the bot response and mapping it… just animations for now, but I do like the idea of lip syncing ‘eventually’. :slight_smile:

Meanwhile - as your project is a replacement for AIML… this project, the client in particular, is a completely generic 3d jabber bot environment. Bots could be those I have written (using AIML), human people, or ‘any other bot that can sign on to Jabber’.