You could write the AI as a back-end program, and then write a set of front-ends, e.g one that re-directs standard input/output from/to IRC.
You might do it like this:
1. Connect to IRC server
2. Connect to a channel
3. Read input from IRC and pass to AI back-end (via pipes or something similar)
4. Take output from back-end and send over IRC
5. Repeat steps 3 & 4
For a general structure for my AI, I was thinking of this:
Inputs -> Input Translators (convert inputs into internal format) -> AI stuff -> Output Translators -> Outputs
However, I wasn't sure whether to have queues for input messages, or callback functions or what... I need to do some planning and I have far too many upcoming exams to plan it properly now :(