It’s not hard to spot the decline in brick-and-mortar stores. If you were alive in the 90s, you probably remember lounging with a book and listening to the CDs in Borders, testing out the gadgets in Sharper Image, checking out the flat-screen TVs at H.H. Gregg, picking out your next VHS for movie night at Blockbuster, and trying on sneakers at Sports Authority. None of these stores exist today. Even shopping malls are gradually becoming obsolete, with many closing a vast majority of their retail stores and becoming these cavernous, eerie ghost towns.

As more and more retail stores switch to e-commerce only or become acquired by other retailers, the ones left standing will have to get creative and come up with ways to retain their relevance in a tech-dominated world where 79 percent of U.S. consumers shopping online and 42 percent ranking convenience as an important factor for shopping online versus traveling to a store, according to a study from Pew Research. Online shopping grew at a rate of 12% year-over-year since 2009 compared to 4.5% for retail sales according to the U.S. Census Bureau’s monthly retail report.

When technology is the name of the game, the most logical thing retailers could do is utilize it to appeal to a tech-driven society- and that is exactly what some retailers are starting to do. According to leading technology research and consulting firm, Gartner, “traditional stores will have a place in the future with a new model that will blend the digital with the physical.” Enter, artificial intelligence (AI).

Artificial intelligence is the use of machines to perform tasks that normally require human intelligence. AI has both amazing potential and also some concerning implications- if we continue to outsource human tasks to robots, will we reach a day when there is no longer the need for human labor? Thankfully, that day has not yet arrived, and maybe it never well. AI is just starting to manifest in the form of personal assistants like Amazon Echo and Google Home.

One of the ways brick-and-mortar retailers are competing with online retail is by collecting customer data through video surveillance. Online vendors have always had an advantage over physical retailers in combatting cybercrime in that they store all of their customers’ data. Now, facial recognition technology and floor-level cameras allow retailers to predict the age and gender of customers and even analyze customer reactions to products. Retailers like Walmart and IBM are already implementing this technology.

Another way retailers are employing data and AI to stay on the cutting edge is through in-store help. Target plans to equip all associates with technology that will enable them to deliver superior customer service by searching inventory across the company, setting up shipping, and taking payment from the customer mobly. Lowes is taking it one step further by launching robots to assist customers on the floor, keep track of inventory, and analyze shopping patterns.

A final way retailers can take advantage of AI is by leveraging the internet to obtain key data about customers and make their shopping experience more personalized. By monitoring trends among shoppers, retailers will have a better idea of what to sell and how to attract customers.

Technology ultimately encroaches upon every corner of human life, albeit at a slower place in some parts of the world, and it is the difference between institutions that succeed and those that fail.