(Note: the above is slightly outdated. Most of chat functionality now lives in the upper layer.)
architecture diagram