Hey @shiva, for implementation you may want to have a look at this new python notebook. It’s a lot like the existing API demo with some additional stuff. You can implement the encoding, SP and TM algorithms piece by piece: