added some socket boilerplate to ai