Dogs and infants may not be able to tell us what they’re thinking, but we are developing the tools that will help us find out.