Skip to Content
DocumentationLearnAdvanced Concepts

Advanced Concepts

Bubbles

Bubbles are a set of nodes that only spawn each other. In our examples and tutorials, agents are set up as bubbles, take a look at them for practical implementation details.

For example, in a ReAct agent, the llmNode and the toolNode only ever spawn each other, so the two of them together form a bubble.

This concept allows for a powerful plug-and-play primitive.

  • Package the code for all the nodes of a bubble in a folder or npm package
  • export the node definitions

Now a new developer can just drop in the nodes of this bubble into their graphs. The developer only need to understand and the input, final output, and the node names.

Recursion

Cascaide agents can recursively invoke themselves.

Imagine an agent. When it encounters a complex problem, it can spin up N instances of itself with subtasks and execute in parallel.

This enables:

  • Speed : N parallel workers outpace a single agent considerably
  • Performance : each subagent handles a narrow task and performs better for it
  • Context Isolation : the parent agent receives only the final summary, keeping its context uncluttered
  • Lower Costs : narrower tasks mean shorter contexts per call

Now imagine if each of those subagents can recurse as well. You can easily implement nested recursion with depth guards in cascaide.

All agent paradigms like supervisor, swarm, etc are built with Reasoning + Action agents as the core primitive. A single agent that can decompose, parallelize, and recombine is more capable and more efficient than a hand-wired multi-agent topology. It is our opinion that Recursive ReAct Agents should be the primitive moving forward.

Check out Recursive ReAct Agents guide in tutorials for a practical implementation guide.

As of v0.5.0, recursion breaks graceful timeout handling in serverless environments. Use with caution.

Last updated on