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 problemFolding asks one question. Inverse folding searches for an answer.
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.
UAGUGAGCGGCAAUAGCUACGCUCUCAUAThe input is fixed. ViennaRNA evaluates possible pairings under one thermodynamic model and returns the minimum-free-energy prediction in one computation.
ACGUGAGCGGCU…folds differently · distance 6UAGUGAGCGGCA…target recovered · distance 0The 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.
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.
The first candidate folds broadly; the second recovers the requested two-stem topology
Target pairing map
Eight requested pairs across two stems.
..(.(((((((....))..))))).)...
Valid sequence, wrong fold
Compatible bases prefer one broad competing stem.
((((((((((........)))))))))).
Local repair, exact fold
Eight implicated bases change; useful choices remain.
..(.(((((((....))..))))).)...
The specialist searches. The coding agent shapes the searcher.
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.
Every measurement changes the next proposal
Searching for a better searcher
Nineteen exact folds revealed the one failure that mattered.
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.
Bird’s-eye view
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.
One prompt hypothesis changed the trajectory
Distance 6 → 18 → 13 → 4 → 4 → 9 → 7 → 4
Distance 6 → 0
An exact computational fold is evidence, not a biological claim.
Distance zero has a precise meaning inside this experiment. Keeping that boundary explicit is part of making the specialist useful.
It does establish
ExactThe 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 resultThe molecule performs a biological function.
The target dominates the full thermodynamic ensemble.
The prediction has experimental validation.
