DEV Community

Rasora
Rasora

Posted on

Importing a recipe from anywhere means never trusting the source

"Paste any recipe link and we'll import it" sounds simple until you actually have to support TikTok, Instagram, YouTube, Pinterest, a random food blog, a screenshot, and a photo of a handwritten recipe card — all through one pipeline, without the output quality collapsing to the lowest common denominator.

Here's the actual shape of the problem: every one of those sources hands you wildly different raw material. A TikTok caption might have the whole recipe crammed into hashtags. A food blog buries the actual recipe under 800 words of life story before the ingredient list. A screenshot has no text at all until OCR runs. A YouTube video might only have the recipe in spoken audio, never written anywhere.

We built this as a two-stage pipeline instead of one big "throw it all at an LLM and hope" function: a Smart Link Router that identifies the source type and picks the right extraction strategy, then a shared AI parser that only ever sees a normalized ImportDocument — the same shape regardless of whether it came from a blog's structured schema.org markup or three minutes of transcribed video audio. The router's job is entirely about getting messy, source-specific input into one consistent shape. The parser's job is entirely about turning that consistent shape into a structured recipe. Neither has to know about the other's problems.

This split matters because it means adding an 8th source doesn't mean rewriting the parser, and improving the parser doesn't mean re-testing every source's extraction logic. It's the same reason you'd split a compiler into a lexer and a parser instead of one function that goes straight from raw text to an AST — different failure modes deserve different, isolated code.

The harder discipline is what happens when extraction comes back incomplete or ambiguous. It would be easy to have the AI parser fill gaps confidently — infer a missing quantity, guess a step that got cut off in a caption. We don't let it. The same no-imputation principle that governs our nutrition engine governs import: if the source didn't actually say it, the imported recipe doesn't claim to know it. A user reviewing an imported recipe should see an honest reflection of what was actually extractable, not a confident-looking recipe that's quietly hallucinated in the gaps.

That's the real engineering tradeoff behind "paste any link, we'll import it": it's not one hard problem, it's eight source-specific extraction problems and one shared honesty constraint, and treating it as anything simpler is how you end up with an import feature that looks impressive in a demo and falls apart on real, messy internet content.

I'm building Rasora, an AI recipe app that imports from TikTok, Instagram, YouTube, and more —
check it out at myrasora.com.

Top comments (0)