If it were me, I would write the whole thing in python, then profile it and write the bottlenecks in pyrex. When you're developing complex AI-type algoritms, it's (1) useful to develop in a high-level language so you can quickly try lots of different approaches and (2) useful to have a reference implementation in a high-level language to test the C/C++ implementation against. I use python/pyrex in this way all the time and it works well for me.