implement chat feature in index