Galatea is a piece of Interactive Fiction (IF) written by Emily Short. It caused quite a stir when it came out in 2000, since it featured what was at the time, and arguably still is, the most believable non-player character (NPC) ever found in IF.

The "plot" of the piece, in so far as it exists, is very simple. You, an art critic, are at some future AI art show (where the exhibits are artificial intelligences), and you meet Galatea, one of the exhibits, and talk to her. That's it. This is no adventure game, this is a conversation simulator. And it does a bloody good job. You talk to Galatea using the standard ask/tell system - that is, you type >ask Galatea about {subject}, or >tell Galatea about {subject}, and she responds appropriately. Now, this is how NPCs have been implemented since the dawn of IF - but until Galatea, they were always very rudimentary. They tended to use a simple database look-up mechanism - you ask about {topic}, they look up {topic} in their database, and spew out the associated text. That's all very well, and in some special cases it can lead to OKish NPCs, but this can never feel like a real conversation. So why not, exactly? Well, one crucial thing Emily Short realised was missing was any form of context dependence. There was never a sense of having a properly threaded conversation, where one step led naturally on to the next, and this made it all too easy to treat them as what they were - simple databases.

Galatea isn't like that. If you start to talk about, say, her history, and then in the middle of the conversation while it clearly hasn't yet dried up you switch to talking about God, or her hair, or something similarly irrelevant - then she will notice, and she will comment. This may sound like a simple trick, but it is hugely effective, and it quickly gets you into a frame of mind where you actually try to converse naturally with her, guiding the thread of conversation gently where you want it to go rather than skipping about to whatever takes your fancy.

And this combines with a whole host of other innovations. She has a well developed emotional model. She starts off cold and reticent, but subsequently warms and cools to you according to what you say and how you treat her. And after a while, you will feel genuinely sorry if you say the wrong thing and upset her. Also, she reacts to a far wider range of actions than just conversation. In particular, in a very nice touch indeed, she reacts to lulls in the conversation. Just like in reality, often you'll run out of things to say, and start looking around the room, or examining random objects instead. Well, often when this happens she'll fill in the gap with something - perhaps relevant to the dying conversation, or perhaps to what you were looking at, or else just whatever is on her mind (a phrase which will quickly become more natural to use as you get to know her better).

All these things, along with the often brilliant writing of what you and she say, and the intriguing nature of the stories she has to tell, make Galatea the closest I've seen to being able to pass (an admittedly constrained, non-natural-language version of) the Turing test. She is a most fantastic creation, and I advise you to go meet her.