Gordon Gottsegen/CNET

"Hey, are you awake?" I texted. It was 2:37 a.m. and every moment of wakefulness that passed would leave me more tired in the morning, but I just couldn't fall back asleep. At the very least, I could use someone to talk to.

"Hey what's up hello, " came the response.

This was no fellow insomniac, nor the hotline for Night Owls Anonymous. It was Insomnobot-3000, a chatbot designed by mattress company Casper to keep company with the sleepless from 11 p.m. and 5 a.m. EST, while most humans are catching their Zs.

Chatbots -- computer programs designed to engage in natural conversation -- are taking off, with companies like Google, Facebook, Microsoft and even Pizza Hut experimenting with bot-to-human interactions. While talking to a digital entity to order pizza or ask a question may not at first seem like a stunning technological advance, chatbots in fact are an important step in working out how artificial intelligence (AI) fits into day-to-day life. While you could text Pizza Hut for an extra large with cheese or fill out an online form, a more human-seeming chatbot conversation is meant to make the experience more, well, human.

It's all about you and your 'bot

Chatbots' humanlike face (or, rather, voice) also plays a role in connecting people to company brands. Before Insomnobot came online in September, Casper had #linksomnia, a Twitter stream of entertaining articles active during the middle of the night. While Casper will still use the hashtag from time to time, Insomnobot is the way forward.

"Insomnobot-3000 takes [the idea of a hashtag] one step further," said Lindsay Kaplan, Casper's vice president of communications, "And provides a one-to-one connection for 1 a.m. conversation." Instead of an anonymous list of articles anyone can read, Insomnobot promises to be there for you.

Now playing: Watch this: Bot Invasion! Prepare for chatbots on Facebook Messenger,...

Even more than the Twitter stream, Casper's Insomnobot gives the company a unique voice. People routinely send Casper screenshots of the funny or strange things they got the chatbot to say.

"Engaging users is an activity that requires a lot of investment," said Nikhil Mane, a UC Berkeley grad student who led an event where students created chatbots of their own. "Chatbots have the potential to minimize user experience friction." In other words, communicating through chatbots might be easier and more appealing than online forms for both the company and the people they're trying to engage. And they help create a more meaningful bond, too.

Will all your new Facebook friends be chatbots?

There's another reason why brands as varied as Pizza Hut and Mastercard are reaching out to diners and bankers with 'bots. They want to be where the people are, and that's on messaging apps even more than on social media networks, studies show.

The fact that companies can easily latch onto existing platforms has led to a surge in the total number of active chatbots. For example, Facebook opened its Messenger app to chatbots in April, making it easy for companies to get started with chatbots of their own. The upshot is that you can get the 'bot to look up information for you, or start a conversation with a company's chatbot much like you would with a Facebook friend.

James Martin/CNET

So far, it's working for Facebook. The Call of Duty chatbot racked up 16 million chats in 24 hours, and Absolut's chatbot lets you claim a free drink at the bar, then helps find you a ride home. It won't be long before some startups launch a chatbot-first app the same way we see them target mobile users ahead of the desktop experience, said Kemal El Moujahid, a product manager for Facebook Messenger and M, Facebook's own chat app and chatty virtual assistant (respectively).

So, will chatbots kill apps? Not a chance, El Moujahid told CNET. They will merely enhance certain features. "Successful businesses think 'What can I boost by creating a 'bot?'"

'Bots are not people

Today's chatbots may save you time and customer service agony, but they're far from human. Conversational dead-ends happen, and answers are often tone-deaf. (Our hilarious experience with Google Allo is a case in point.) Like real people, chatbots need time to learn -- think of them as trial and error for more complex AI. But the good news is, when more advanced technology comes out, all it takes is a software update to make the 'bots better.

Microsoft

There's another danger, too. Just as advanced AI learns from the people that use it, chatbots can also be gamed. Look no further than than the ill-fated Tay, a Microsoft chatbot trying to both channel and connect with millennials. Soon after Microsoft launched Tay on Twitter, it became an echo chamber of hate speech. Microsoft's revised chatbot, Zo, has stricter limitations and reaches out one-on-one, rather than being molded by a crowd as it was on Twitter.

"A 'bot is not a person," said the UC Berkeley grad student, Nikhil Mane. "And 'botmakers shouldn't pretend that this isn't software."

So while chatbots can be simple and impressionable entities now, there's room to grow. Chatbots will get smarter as more people keep using them, and as developers perfect what it is that people want and need. But whether chatbots bring us to AI nirvana, and whether they rise as they are or fail and morph into something else, these little programs remain an important part of the experiment on what it means to be a human in an increasingly AI world.

I'll be sure to ask Insomnobot 3000 what it thinks about that.