Strukturēti dati bez JSON liekā apjoma

Strukturēti dati domāti mašīnām, bet AI darbplūsmās mēs bieži maksājam modelim, lai tas atkal un atkal lasa vienus un tos pašus atslēgas. HEDL struktūru...

Strukturēti dati bez JSON liekā apjoma

The invoice hiding in your braces

JSON won because it is boring in exactly the right way. Humans can read it. Machines can parse it. Every language has a library for it. If two systems need to exchange an object and nobody wants a standards meeting, JSON is usually where the conversation ends. Fine. There are worse compromises. Many of them have enterprise in the name.

The problem is not JSON as a web format. The problem is what happens when we push JSON into language-model workflows andpretend the cost is free. A model does not see a tidy object in the way an application parser sees one. It sees tokens. It reads the same keys again and again. It spends context on punctuation, repeated field names, wrappers, nested scaffolding, and shape reminders that were already known before the first record arrived.

That waste used to be mildly irritating. With AI systems, it becomes a product problem. Every repeated key competes with evidence, instructions, examples, citations, and actual user content. Every redundant structural token is a little tax on the useful work. The invoice does not say needless braces, because invoices lack poetry. It says tokens.

HEDL starts from a plain observation: when the schema is known, repeating the schema inside every record is silly. Declare the structure once. Encode records positionally. Keep the semantics exact. Convert back to the formats existing systems already expect. That is not anti-JSON ideology. It is a refusal to pay the model to reread the same road sign every ten metres.

HEDL moves repeated structure out of every record and into a shared schema contract.

This matters because structured AI work is not just chat. It is extraction, classification, tool calls, data transformation, review packets, evidence bundles, MCP calls, workflows, and agents passing objects to each other all day. The more serious the system becomes, the more structure it needs. If structure is expressed in the most verbose possible way, the system pays for its own discipline.

JSON is not the villain

It would be easy, and lazy, to write this as a JSON complaint. JSON has real strengths. It is ubiquitous, debuggable, easy to pipe through existing tools, and good enough for a huge amount of application work. The point is not that JSON is bad. The point is that JSON is often used in places where the receiving side already knows the shape, and there the repetition stops being clarity and starts being cargo.

Consider a structured extraction task. The schema says every answer has a name, source, value, confidence, and rationale. Now imagine sending hundreds of rows to a model or receiving hundreds of rows back from one. JSON repeats those field names for every object. The application parser does not mind. The model context does. The context window becomes a deliveryvan full of labels instead of goods.

HEDL treats the schema as a contract. It names the fields and types once. The records then carry values in order. That sounds obvious because it is. Many efficient formats have made similar tradeoffs for decades. The difference is that HEDL is aimed at LLM-facing structured workflows where human debuggability, conversion, and tool compatibility still matter. It is not a binary blob lobbed over a wall with a note saying good luck.

HEDL implementācijā ietilpst Rust bibliotēkas atbalsts, CLI lietošana, MCP servera un starpniekservera virsmas, WASM, FFI un saistvielas, kā arī konvertēšana uz izplatītiem formātiem un no tiem. Šī kombinācija ir svarīga. Formāts AI darbplūsmām nevar būt tikai kompakts. Tam ir jāieiet un jāiziet no haotiskās pasaules, nekļūstot par privātu kultu. Esošās API joprojām vēlas JSON. Cilvēki joprojām pārbauda datus. Rīkiem joprojām ir vajadzīgi pilni cikli. Formātam ir jābūt blīvam, nekļūstot antisociālam.

Struktūra kā līgums

Lielākā daļa AI kļūmju ar strukturētiem datiem nav dramatiskas. Tās ir sīkas, tāpēc tās ir grūtāk uztvert nopietni, līdz tās sāk maksāt reālu naudu. Lauks novirzās. Vērtība tiek ievietota zem nepareizas atslēgas. Modelis ģenerē ticamu objektu ar trūkstošu neobligātu lauku. Parsētājs pieņem formu, kurai vajadzēja atteikt. Lejupstraumes rīks saņem gandrīz pareizo lietu, kas ir visbīstamākā lieta programmatūrā.

HEDL pieeja, kurā shēma ir pirmajā vietā, ir noderīga, jo tā padara struktūru skaidru jau pirms ieraksti sāk kustēties. Shēma nav brīvs ieteikums. Tā ir lieta, kas lasītājam pasaka, kā interpretēt vērtības. Ieraksts ir kompakts, jo tam nav atkārtoti jāapraksta sevi. Apkārtējie rīki joprojām var validēt, konvertēt un nodot datus sistēmām, kas dod priekšroku JSON, YAML, XML, CSV vai citām ierastām formām.

Kompaktums palīdz tikai tad, ja nozīme izdzīvo pilnu ciklu. Citādi tā ir tikai saspiešana ar smukāku cepuri.

Pilni cikli ir pārbaudījums tam, vai formāts ir noderīgs vai tikai gudrs. Ja JSON ienāk, HEDL pārvietojas pa darbplūsmu, un JSON iznāk ar tādu pašu semantiku, sistēma iegūst blīvumu, nezaudējot saderību. Ja nozīme tiek klusi zaudēta, formāts ir izgāzies. Pareizā rīcība spiediena apstākļos nav atlaist objektu lejupstraumei. Tā ir bloķēt, ziņot un piespiest neskaidrību iznākt gaismā.

Šeit HEDL labi iederas blakus pārējam Dweve stekam. Ledger rūpējas, lai operacionālie notikumi paliktu pārbaudāmi. AION rūpējas, lai lēmumu pierādījumus varētu pārbaudīt. Trace rūpējas, lai aprēķinus varētu atkārtot. HEDL rūpējas, lai strukturētus datus varētu attēlot blīvi un atjaunot precīzi. Šie darbi saskaras, bet tie nav viens un tas pats darbs. Atkal: mazāk siltu zupas vārdu, vairāk noderīgu robežu.

Etalons nav dekorācija

Veiktspējas apgalvojumi par AI infrastruktūru bieži tiek rakstīti kā makšķerēšanas stāsti. Skaitlis kļūst lielāks katru reizi, kad to pārstāsta. HEDL ir konkrēts etalona apgalvojums: 571 strukturētas ekstrakcijas uzdevums septiņās datu kopās, par 56 procentiem mazāk marķieru nekā JSON un 10,3 procentpunktu precizitātes pieaugums salīdzinājumā ar JSON.

Šie skaitļi jālasa kā etalona apgalvojums, nevis kā universāls fizikas likums. Tie apraksta etalona iestatījumu. Tie nenozīmē, ka katra darbplūsma maģiski iegūst tādu pašu rezultātu. Bet tie izskaidro, kāpēc formāts pastāv. Marķieru skaits LLM sistēmās nav ieviešanas zemsvītras piezīme. Tā ir daļa no saskarnes. Ja divi attēlojumi nes vienu un to pašu nozīmi un viens patērē daudz vairāk konteksta, smagākais nav neitrāls.

Etalona apgalvojums attiecas uz strukturētu ekstrakciju: mazāk marķieru un labāka precizitāte dokumentētajā uzdevumu kopā.

The accuracy gain is especially interesting. It suggests the benefit is not only cheaper prompts. A cleaner representation can also make the task easier for the model. That should not be surprising. If the model spends less attention on repeated syntactic clutter, it has more room for values and relations. This is the same reason good forms beat messy forms in human work. The human may be smart, but do not hand them a tax form written by a printer having a difficult childhood.

There is a broader design lesson here. AI interfaces should not be judged only by whether the model can cope. Models can cope with many bad interfaces. People can also carry furniture up stairs with poor grip and no plan. That does not make it architecture. A good AI interface reduces avoidable work, exposes structure, preserves meaning, and fails loudly when the structure is wrong.

Why proxy surfaces matter

A format rarely wins by being pure. It wins by fitting the ugly middle. HEDL's MCP and proxysurfaces matter because most organisations cannot simply announce that everything now speaks a new representation. They have existing APIs, data stores, validation rules, dashboards, notebooks, and export formats. Replacing all of that to save tokens would be aheroic way to lose friends.

The proxy pattern is more practical. Let models and tools benefit from dense structured representation where it matters. Convert at the boundary. Validate before data leaves the controlled path. Keep downstream JSON compatibility. Let systems that expect JSON receive JSON, but stop forcing the model to haul the full JSON shape through every internal step.

The proxy is not plumbing for plumbing's sake. It is where conversion, validation, and compatibility meet.

This is also where governance enters, quietly and usefully. If the proxy validates structure, it can reject malformed objects before they become business facts. If it preserves a lossless round trip, it can prove that conversion did not change the meaning. If it keeps compatibility with existingsystems, it can be adopted without turning every integration into a migration programme. We are European. We have enough migration programmes. Some of them still have steering committees from 2014.

For agent systems, the proxy is even more important. Agents pass structured calls and results across boundaries. They call tools, receive outputs, update memory, produce artifacts, and hand state to other agents. A dense representation with validation keeps those handoffs less wasteful and less ambiguous. It does not make the agent wise. It makes the envelope less stupid. That is a respectable engineering outcome.

Where HEDL should not be used

Every useful tool has a place where it should not be used. HEDL is not a replacement for every JSON file on earth. If asmall config file is read once by a human and edited twice a year, JSON or TOML will survive the tragedy. If a public API needs maximum familiarity and the payloads are tiny, JSON is fine. If the schema is genuinely unknown and ad hoc, schema-once encoding is not the right starting assumption.

HEDL becomes interesting when structure is repeated, volumes are meaningful, model context is expensive, round trips matter, and tools need compatibility at the edges. That is why LLM workflows are such a good fit. They sit precisely at the intersection of structured intent and token economics. They also tend to grow from prototype to production faster than anyone planned, because apparently nobody has learned this lesson despite the entire history of software looking mildly offended in the corner.

The practical adoption path should therefore be narrow. Do not rewrite the organisation. Pick a structured extraction workflow. Pick an agent tool-call path. Pick an MCP proxy boundary. Measure token use, failure rate, validation outcomes, and round-trip fidelity. If the numbers hold, expand. If they do not, keep the boring thing. The goal is not to worship a format. The goal is to stop paying for avoidable structure.

The lesson

The lesson of HEDL is that structure is not free just because it is useful. In ordinary software, repeated keys are mostly an annoyance. In AI workflows, they are context, money, attention, and failure surface. If the schema is known, repeating it in every record is often the least imaginative option available.

HEDL makes a simple trade: declare structure once, encode records densely, preserve semantics, convert back when needed, and validate at the proxy boundary. It is not a replacement for JSON as the common language of the web. It is a better internal envelope for structured AI work where the model should be spending its context on meaning, not on reading the same field names until the heat death of the budget.

That is the useful standard for AI infrastructure. Not cleverness for its own sake. Not novelty tax.Not a format that requires everyone else to suffer. A good layer removes waste, keeps the contract explicit, and lets the rest of the system keep working. HEDL earns its place when the object becomes smaller without the meaning becoming softer.

JSON can stay. It has done nothing wrong. It can even have a cup of coffee. It just does not need to sit inside every model call carrying the same set of keys like a man moving house one spoon at a time.