Guides

Comprehensive guides to help you build powerful memory-driven workflows with MDWR.

Available Guides

Master Application Flow

Complete guide to building and using the master application workflow. Learn:

Creating Workflows

Learn how to create workflows, define steps, and use decision structures. Covers:

Memory Integration

Master memory integration to make informed decisions. Learn:

Replay Modes

Understand different replay modes for testing and optimization:

Workflow Patterns

Basic Pattern

const workflow = Workflow.create("my_workflow")
  .step("step1", handler1, true)
  .step("step2", handler2, true);

Memory-Informed Pattern

.step("decide", async (ctx) => {
  const insights = await ctx.memory.similar({
    situation: "my_decision",
    context: ctx.input
  });
  
  // Use insights to inform decision
  return { decision, reason, confidence };
}, true)

Conditional Pattern

.step("next", async (ctx) => {
  if (ctx.state.previous?.decision !== "approve") {
    return { decision: "skip", reason: "...", confidence: 1.0 };
  }
  // Continue execution
}, true)

Best Practices

  1. Use specific situations when querying memory
  2. Include relevant context for better similarity matching
  3. Check outcomes before using historical decisions
  4. Test with replay before deploying policy changes

Next Steps