picoflow.io Docs

picoflow.io

PicoFlow is a platform for building customer-facing AI conversational applications that replace or supplement traditional web applications. The flow is the application, the conversation is the UI, and PicoFlow is the runtime.

Build your first conversational assistant

What a step looks like


export class DOBStep extends Step {
  public defineTool(): ToolType[] {
    return [{
      name: "dob",
      description: "Capture a valid date of birth.",
      schema: z.object({
        year:  z.number().int().min(1900).max(2100),
        month: z.number().int().min(1).max(12),
        day:   z.number().int().min(1).max(31),
      }),
    }];
  }

  @Tool
  protected async dob(args: Record<string, any>): Promise<ToolResponseType> {
    if (!isRealCalendarDate(args)) {
      // stay(...) keeps this step active and corrects the model.
      return stay("That date is not valid. Ask again in M/D/YYYY format.");
    }
    this.saveState({ year: args.year, month: args.month, day: args.day });
    // go(...) advances the durable conversation cursor.
    return go(AddressStep);
  }
}
		

Routing is a value returned from ordinary application code, not a rule buried in prompt prose. The transition, the validation, and the persisted state all live in one place you can read, test, and step through in a debugger.