a fork from AGI's master branch