+ 1
Do some research about it. Once you understand how it works and what it tries to achieve, then you will have the basis on which to start to writing such a program. I don't know which CBT you are talking about but I think you should start off with what I suggested.