From ReAct to ScriptAct: Introducing NuwaScript — The Language of Agent Intent

From ReAct to ScriptAct: Introducing NuwaScript — The Language of Agent Intent

4/27/2025Jolestar

AI can write poems, code programs, but can it "draw"?

Not by pressing a button and generating a full picture at once, but like a human: stroke by stroke.

First draw a wall, then add a roof; If it's sunny, draw a sun; if cloudy, draw a cloud.

This is not just about drawing. It's about answering a bigger question: If we give AI a set of tools, can it learn behaviors like a human?


🌟 Tools provided. Can it truly learn?

Suppose we provide AI with basic tools:

  • drawRect to draw rectangles
  • drawCircle to draw circles
  • drawEllipse to draw ellipses
  • drawLine to draw lines

Then assign it a task: draw a house.

Can it do it?

Currently, most AI agents use ReAct (Reason + Act)

Step by step: Think → Act → Observe → Think again...

But ReAct has bottlenecks:

🧱 ReAct's Limitations

  • One step, one chat: Every minor action requires a full LLM roundtrip. Slow, expensive, fragile.
  • State chaos: Coordinates, variables are buried in context history. Forgetfulness inevitable.
  • Hard to express logic: Conditionals, loops, and error handling are messy.
  • Lack of atomicity: Multi-step tasks can fail mid-execution, leaving inconsistent states.

Like teaching a novice:

  • "Draw a wall."
  • "Done, now what?"
  • "Draw a roof."
  • "Okay, and then?"

Inefficient and error-prone.


🧐 NuwaScript: Let AI "write the plan"

While designing @NuwaDev's Agent system, we hit these bottlenecks head-on.

Thus was born a new idea: ScriptAct.

AI no longer thinks step-by-step, but generates a full multi-step plan and logical script in one shot. The interpreter executes it.

Enter NuwaScript — a domain-specific language for agents to express intentions and actions clearly.


✨ Drawing the house (for real)

Example script:

LET wallX = 50
LET wallY = 150
LET wallWidth = 200
LET wallHeight = 100
LET roofPeakX = wallX + wallWidth / 2
LET roofPeakY = wallY - 50

CALL drawRect { x: wallX, y: wallY, width: wallWidth, height: wallHeight, color: "brown" }

CALL drawLine { x1: wallX, y1: wallY, x2: roofPeakX, y2: roofPeakY, color: "red" }
CALL drawLine { x1: wallX + wallWidth, y1: wallY, x2: roofPeakX, y2: roofPeakY, color: "red" }

LET weather = CALL get_weather {}

IF weather == "sunny" THEN
  CALL drawCircle { x: 350, y: 50, radius: 25, color: "yellow", fill: "yellow" }
ELSE IF weather == "cloudy" THEN
  CALL drawEllipse { x: 320, y: 40, width: 80, height: 40, color: "lightgray", fill: "lightgray" }
END

PRINT("House drawn!")

One-shot planning. One-shot execution. No more "what's next?"


🧪 NuwaScript Design Goals

  • ✅ Minimal structure, easy for AI to learn and output
  • ✅ Built-in expressions to enhance calculation accuracy
  • ✅ Platform-agnostic interpreters: browser, desktop, blockchain
  • ✅ Non-intrusive: pluggable into any Agent framework

We call it "The Language of Agent Intent."


🎨 Drawing is just the playground

Drawing isn't the goal. It's a visual sandbox to validate:

  1. Can AI create more complex operations if given more tools?
  2. Can AI reason over multi-turn states and incrementally create?
  3. Can AI integrate external data (e.g., weather) into its action plans?

If successful, NuwaScript extends naturally to:

  • DeFi transactions
  • Smart contract agents
  • Web automation
  • In-game AIs

✨ Industry Trends: Agents are Writing, Not Just Chatting

Alongside NuwaScript, a growing trend is reshaping agent architectures:

  • CodeAct: LLMs generate executable Python code to orchestrate multi-tool usage and logic flow.
  • ReWOO: Separates reasoning and execution, plans first, acts later.
  • Program of Thoughts (PoT): Encourages LLMs to generate runnable code as a chain-of-thought.
  • Graph of Thoughts: Extends CoT into flexible graph-structured reasoning.

These works share a common philosophy:

LLMs aren't just answering questions. They're producing structured executable plans.

NuwaScript fits naturally into this trend, focusing especially on multi-platform compatibility, strict tool invocation, and verifiable execution.

Compared to traditional ReAct agents, ScriptAct agents powered by NuwaScript:

  • Plan actions logically, including conditionals and loops
  • Drastically reduce API round-trips and token usage
  • Are auditable — their scripts are human-readable, inspectable
  • Are more reliable — deterministic execution under interpreter control

This shift is becoming the new standard. Recent research like CodeAct shows that allowing AI to generate executable scripts or code improves success rates significantly on complex tasks. ReWOO reduces token consumption by planning first. Program of Thoughts demonstrates that generating code-based plans yields better reasoning accuracy. Graph of Thoughts shows that letting AI maintain multiple reasoning paths (not just a single chain) leads to better solutions.

NuwaScript is part of this wave — but uniquely positions itself by enabling agents to script behaviors across platforms, from browsers to blockchain smart contracts.

In short: tomorrow's AI Agents will write scripts — not just sentences — to get the job done.


🔧 Try NuwaScript Yourself

We launched a Playground with two modes:

  • Canvas: Give the AI a drawing board and basic tools. Let it paint.
  • DeFi: Mock a user wallet and transaction tools. Let it manage assets.

Experience it here:

🔗 NuwaScript Playground

Explore the codebase:

🔗 NuwaScript on GitHub


💡 What's Next

  • Smarter state querying: let AI pull relevant context, not full states.
  • Conditional mid-task reevaluation: when AI needs to think again mid-execution.

👋 Get Involved

NuwaScript is still evolving.

We welcome feedback, contributions, and collaborations from the agent developer community:

  • Is the syntax minimal yet expressive enough?
  • Can you imagine integrating NuwaScript into your AI agents?
  • Which execution platforms (browser, node, blockchain) do you need most?

Comment, fork, PR, or ping us on Twitter 🪐


References