RNA sequence design with agents

A pair is an intention, not an instruction. The fold decides.

RNA Fold Lab searches for a sequence whose minimum-energy fold matches a requested structure. It proposes, measures with ViennaRNA, reads the mismatch, and repairs the next candidate — while a coding agent improves the searcher when the loop gets stuck.

Understand the problem

Folding asks one question. Inverse folding searches for an answer.

Why the reverse direction is hard

RNA is a chain of bases that can pair with one another, bending the chain into stems and loops. If the sequence is known, ViennaRNA can predict its preferred secondary structure. If only the desired structure is known, the sequence must be discovered.

a concrete examplethe same sequence and shape, opposite directions
01 · forwardFolding: sequence → predicted structure
Known sequenceUAGUGAGCGGCAAUAGCUACGCUCUCAUA
RNAfoldViennaRNA
Why folding is tractable

The input is fixed. ViennaRNA evaluates possible pairings under one thermodynamic model and returns the minimum-free-energy prediction in one computation.

02 · inverse “unfolding”Inverse folding: target structure → candidate sequence
Possible 29-base sequences429 = 288 quadrillion
ACGUGAGCGGCU…folds differently · distance 6
UAGUGAGCGGCA…target recovered · distance 0
Why the reverse is hard

The target does not reveal its sequence. Many sequences satisfy the intended local pairs, yet unintended pairs elsewhere can produce a lower-energy global structure. Every proposal must be folded and checked.

ViennaRNA is the independent measurement. It predicts each candidate’s minimum-free-energy fold; distance zero means its pairing map exactly matches the target. This is computational structure prediction, not physical folding or unfolding in a laboratory.

The inverse problem is difficult because choosing complementary bases solves only local relationships. The complete sequence is judged globally: a base intended for one stem can find a more energetically favorable partner elsewhere, producing a valid sequence with the wrong fold.

measured repairrna-12 · identical target and constraints

The first candidate folds broadly; the second recovers the requested two-stem topology

Requested

Target pairing map

Eight requested pairs across two stems.

..(.(((((((....))..))))).)...
29 bases8 pairs
Trial 1

Valid sequence, wrong fold

Compatible bases prefer one broad competing stem.

((((((((((........)))))))))).
Distance 6measured
Trial 2

Local repair, exact fold

Eight implicated bases change; useful choices remain.

..(.(((((((....))..))))).)...
Distance 08 mutations
ACGUtarget paircompeting pairchanged base
A real run, not an illustration. ViennaRNA measured both proposals. The target, validator, tools, and trial budget stayed fixed.

The specialist searches. The coding agent shapes the searcher.

Inner loop and outer loop

The RNA specialist solves one target repeatedly. The outer coding agent works at a different level: it studies failures across runs and changes the specialist’s instructions, tools, or validation feedback without handing it the answer.

running

Every measurement changes the next proposal

The validator measures; it does not suggest a sequence. The specialist must decide what the evidence means and what to try next.
running

Searching for a better searcher

The outer loop does not solve RNA. It discovers an inner-loop configuration that can solve related RNA targets efficiently and repeatedly.

Nineteen exact folds revealed the one failure that mattered.

The frozen baseline

One specialist was frozen, then run against twenty targets with increasing designed difficulty. The test varied sequence length, target topology, fixed bases, GC bands, repeat ceilings, and trial budgets.

cohort 0120 production runs · frozen baseline

Bird’s-eye view

20/20targets reached specialist execution
19/20exact minimum-energy folds
57distinct proposals measured
1saturated search worth studying
0102030405 0607080910 1112131415 1617181920
Designed difficulty was not observed difficulty. A 39-base, three-stem target succeeded immediately; the 29-base rna-12 target exhausted its budget.

The failure trace showed the baseline alternating between small edits and broad rewrites. Its first proposal already contained six of eight requested pairs, but later candidates repeatedly discarded useful structure. That suggested a search-strategy defect, not a need for more trials.

controlled probesame target · same tools · same 8-trial budget

One prompt hypothesis changed the trajectory

Unchanged controlBroad rewrites
best 4
T1T2T3T4T5T6T7T8

Distance 6 → 18 → 13 → 4 → 4 → 9 → 7 → 4

Prompt treatmentMap pairs, repair locally
exact
T1T2

Distance 6 → 0

Only two instructions changedMap target pair positions before proposing.Preserve useful choices; repair implicated bases locally.
The change improved the searcher without giving it a sequence. The same treatment also reached exact folds on three representative targets beyond rna-12.

An exact computational fold is evidence, not a biological claim.

The finish line

Distance zero has a precise meaning inside this experiment. Keeping that boundary explicit is part of making the specialist useful.

result boundarywhat the oracle establishes

It does establish

Exact

The sequence satisfies the declared constraints.

ViennaRNA predicts the requested minimum-energy structure.

The measured search history can be inspected.

It does not establish

Not a lab result

The molecule performs a biological function.

The target dominates the full thermodynamic ensemble.

The prediction has experimental validation.

Measurements shown here were recorded on September 5, 2026. They describe this frozen experiment, not a guaranteed success rate.

Give your agent its next job.

Connect Recurse to your agent, and then ask it to do something for you there.