Chain of Thought reasoning in custom AI agents