This might be a tough pill to swallow, but the future of medicine is all about ingestible sensors. Things like cameras to scope out your bowels and electronics that detect if you’ve taken your medicine (recently FDA-approved, by the way).

Also, swallowable origami. Researchers at MIT have developed a frozen gizmo made of pig intestine that you drop down the hatch. As it thaws in your stomach, it unfolds. Using a magnetic field, a doctor could theoretically lead the device to something you’ve gone and swallowed but really shouldn’t have—batteries aren't as tasty as they look—and hurry the offending object out of your system.

Theoretically. The researchers have so far only tested the device on a model of a pig stomach. But it’s a fascinating glimpse into the future of incision-free surgery, one propelled in large part by magnets.

So a doctor has guided the battery out of you. (Oh and no, not the way it came in. The other more … involved route.) But the battery may have leaked and stuck to the lining of your stomach. Luckily, as the pill technology improves, so will the capabilities. "In the second phase there would be another capsule you send to patch the wound or deliver medicine," says MIT’s Daniela Rus, who developed the origami pill. No need to cut the patient open. Aces.

Aside from traditional surgery being rather traumatic, doctors also have the problem of anesthesia. Namely, it’s best avoided. And that has inspired a similar experiment to the origami pill: the next-gen magnetic colonoscopy.

I don’t reckon I need to explain to you how a colonoscopy works, other than to say doctors have to knock you out for it. "The problem is, not everybody can get sedated," says roboticist Pietro Valdastri of Vanderbilt University. "It’s a very powerful drug if you’ve got a heart problem."

So Valdastri is developing—with funding from the National Institutes of Health—a colonoscopy robot that uses the origami pill’s principle of magnetic guidance. Instead of pushing a tube through a patient's digestive system, the doctor would pull it through the intestines using a magnet on a robotic arm outside the patient’s body (the device is equipped with a camera, just like a regular colonoscope). This eliminates the discomfort of forcefully pushing the colonoscope through—and the need for anesthesia. Valdastri hopes to have it in human trials in three years, so a very magnetic colonoscopy could be in your near future.

Back at the other end of the body, a company called Proteus Digital Health has skipped all the folding and magnets and developed teeny-tiny sensors for pills because, well, medicating is hard. Fewer than 50 percent of patients the world over are taking their medications correctly. The rest of you clowns are misusing your medicines. "As they go through this therapy that's often months or years or the rest of their lives," says George Savage, chief medical officer of Proteus. "There's no feedback to tell them if they're doing a good job or not, if the therapy is helping them or not, or just what to do next."

Proteus is out to end all that. Its FDA-approved sensor, measuring just 1 mm by 1 mm by 300 microns, easily fits in a pill. Once that pill hits a patient’s stomach, the sensor pings a patch on skin, which in turn beams the data to a smartphone app. That’s extremely valuable information, both to help forgetful patients keep accurate tabs on their dosages, as well as their doctors.

Consider the case of a patient that’s a habitual double-upper, forgetting to take a pill in the morning and instead taking two at night. They may tell their doctor they’re using all their medication, and indeed they are, but this regimen is problematic. “There's no way to address this patient's problem unless you see the pattern,” says Savage. With sensor-packed pills, “the physician is able to say, ‘Oh, I see what you're doing. That can be dangerous.’”

It ain’t got the theatrics of swallowable origami, but it is a taste of a future where a pill is far more than a pill. Not that you should start eating batteries anytime soon. Or ever, really. Let’s say ever.