Don't know about any pre-build architectures, but really you need to be proficient in AJAX programming to even think about this.
What you will need to do is take the user's input at one end, send it to the server via AJAX, insert it into your database with a unique conversation identifier, then the other end can keep checking the database (via AJAX) for new messages with that unique identifier.
The alternative approach is to leave the HTTP connection open, and then the server can push bits of javascript to the client on fairly live basis. You will need some kind of IPC for this, and it is more difficult to implement.
It's very easy to over-stress your database with things of this nature.
I have done stuff like this before, and it's not that difficult, but you will need to be profficient in the technologies involved to do it well.