Patterns

Patterns Overview

Pre-built agent patterns composed from Noetic's 7 primitives -- from simple ReAct loops to multi-agent task trees.

Overview

Patterns are ready-made compositions of Noetic's 7 primitives (step.run, step.llm, step.tool, branch, fork, spawn, loop). Each pattern solves a common agent architecture problem without sacrificing the ability to customize.

Every pattern returns a Step (usually a StepLoop), which means you can nest patterns inside other patterns, wrap them in additional loops, or use them as children in spawn and fork steps.

Available Patterns

PatternFunctionWhat It Does
ReActreact()Observe-Think-Act loop with tools
Ralph WiggumralphWiggum()Self-refining agent with verification
Task TreescompilePlan()Tree-structured multi-agent workflows
Adaptive PlansadaptivePlan()Dynamic planning with error-driven revision
Recursive LLMspawn() with contextIn: 'fresh'Recursive sub-task delegation
Thread Weavingfork(mode: 'all')Parallel analysis with merged results
Dual Agentspawn() + channel()Two agents communicating via channels
A2A RemoteExternalChannelInter-process agent communication

How Patterns Compose

Patterns are not special. They return plain Step objects:

import { react, ralphWiggum, fork } from '@noetic/core';

// Use a pattern as a fork path
const parallel = fork({
  id: 'parallel-research',
  mode: 'all',
  paths: () => [
    react({ model: 'gpt-4o', tools: [searchTool] }),
    react({ model: 'gpt-4o', tools: [analyzeTool] }),
  ],
  merge: (results) => results.join('\n\n'),
});

// Wrap a pattern in verification
const verified = ralphWiggum({
  model: 'gpt-4o',
  system: 'Write unit tests.',
  tools: [codeTool],
  verify: async (output) => ({
    pass: String(output).includes('expect('),
    feedback: 'Tests must use expect() assertions.',
  }),
});

Choosing a Pattern

On this page