Inside a warehouse in the middle of the suburban office sprawl of San Carlos, a Silicon Valley town south of San Francisco, hundreds of heads of lettuce and herbs grow next to a mobile robot designed to move the plants as they get bigger. In a lab next door, engineers tweak robots that can handle every part of the growing process, from planting seeds to packaging harvested heads of lettuce for a grocery store.

By early 2018, Iron Ox, the startup behind the R&D farm, plans to open an 8,000-square-foot production farm nearby–all fully automated, in a system that the company says can make local, pesticide-free food production as cheap as traditional agriculture in the field.

When the co-founders decided to launch the startup, one was working on delivery drones at Alphabet’s X, and the other was building room service robots for hotels. They liked the work but wanted to do more with the available technology. “Robotics has come so far in the past few years–sensors have gotten cheaper, software has become more robust,” says co-founder and CEO Brandon Alexander. “We felt that we could be doing something with more impact.”

They saw an opportunity in food production, where traditional farming faces multiple challenges. Most lettuce, for example, is grown in California and Arizona, two states that face an increasing risk of water shortages and stress from heat as the climate changes. A head of lettuce may be treated with nine different pesticides before it’s harvested and then shipped hundreds or thousands of miles across the country to consumers. As fewer people want to work on farms, producers also struggle with labor shortages.

Indoor farming, which uses a tiny fraction of the water and space, doesn’t require pesticides, and can happen within cities or suburbs, is often billed as a solution. But as Alexander and co-founder Jon Binney researched the market, they realized that cost was a challenge. “We loved the idea [of greenhouses],” Alexander says. “But our question was, if this is so much better, why is most produce grown outdoors? The biggest thing we found was that it costs significantly more–at least twice as much–to grow a head of lettuce indoors than outdoors.”

Other companies, such as Plenty–another farming startup based in Silicon Valley, which grows greens in vertical towers and recently raised $200 million in funding–say that it can produce lettuce at a cost that is competitive with traditional farms. Plenty uses a layout that maximizes yield in small spaces and notes that the cost of key components for growing, like LED lights, have dropped dramatically. But Iron Ox’s approach is to focus on removing another cost: labor, which for some growers, can account for 50% of the cost of production.

Some greenhouse-grown lettuce might cost $3.99 now, versus $1.99 for the same head of lettuce from the field. “At the end of the day, if you’re always going to have to cost more, then you’re going to be this niche product,” says Alexander. “For the impact that we’re after, one of the biggest things for us is we need to make this produce accessible. Accessible doesn’t just mean affordable–that’s part of it–but it’s affordable and available. Ideally to everybody.”