Given the recent advances in machine learning, such as the OpenAI GPT-3 (e.g. chatbot), it is not unreasonable to expect that artificial general intelligence (AGI) will be achieved in the foreseeable future. This may mean that there will be machines that will be indistinguishable from humans (except for physical appearance, at least at first), in that they will appear to think, interact, and even have feelings, aspirations, and a unique personality just like a regular person. There might not be any way to tell them apart from humans, aside from examining their internals.
How might halacha approach the personhood status of such artifical intelligence machines? Is there any precedent or halachic basis to recognize their status as intelligent beings who are alive? This would have practical implications in many areas, such as whether it's permissible to turn them off or destroy them, rely on them as witnesses and count them for a minyan, ask them for halachic rulings, whether amira l'akum applies to them or not, and many others areas of halacha.