What happens when the quantified self and the penchant to drop algorithms and technology into every product come together: You get a bed that'll run you $7,999, but monitor how you sleep and suggest ways to improve.

Enter the Sleep Number x12 bed, which is billed as the "the most technologically advanced bed in the world." The x12 was launched at the Consumer Electronics Show in Las Vegas.

Armed with technology called SleepIQ, Sleep Number will track the average breathing rate, movement and heart rate as you sleep. The company then takes that data and uses an algorithm to assess the quality of sleep for each sleeper.

Over time, SleepIQ finds trends and tells customers what settings they need to sleep most effectively. There's also a journal feature to track exercise and TV watching. Sleep Number said that its smart bed was developed with BAM Labs, which develops healthcare monitoring technology.

Sleep Number said the x12 will be available in pilot markets in February and then nationwide.

The company is positioning itself in the middle of the wearable technology and monitoring boom at CES where the likes of Freescale, Nuance and consumer electronics players such as LG all have a wearable technology play of some sort.

Sleep Number emphasized repeatedly that its technology is proprietary, but you have to wonder how long any competitive advantage will last. How long before we're bringing Android, Google, iOS and a bevy of wearable tracking devices to bed with us to coach our sleep? Can in-bed app stores be too far behind?