add basic ai framework

@pamboat Can you take a look at this.