Generate structured objects from natural language. Users review and approve before anything reaches your database.
|
// User types: "Quick pasta with chicken and vegetables"
const { proposal } = await pf.generate('recipe', {
input: userMessage,
});
// AI generates a complete recipe
console.log(proposal.generatedObject);
// → { title: "Tuscan Chicken Pasta", prepTime: 15, ... }
// User reviews it in your UI, then approves
const { finalObject } = await pf.decide(proposal.id, {
action: 'approve',
});Users describe what they want. AI turns it into structured data.
Users review AI output before it becomes permanent. No bad data slips through.
Not quite right? Users give feedback and the AI tries again.
Display proposals however you want. Full control over the experience.
Define what you want, let AI generate it, and give users final say.
Tell ProposeFlow what kind of objects you want to generate. Recipes, tasks, invoices—anything.
import { ProposeFlow } from '@proposeflow/sdk';
import { z } from 'zod';
// Define what a recipe looks like
const RecipeSchema = z.object({
title: z.string(),
prepTime: z.number(),
ingredients: z.array(z.object({
item: z.string(),
amount: z.string(),
})),
steps: z.array(z.string()),
});
// Register it with ProposeFlow
const pf = new ProposeFlow({
apiKey: process.env.PROPOSEFLOW_API_KEY,
schemas: { recipe: RecipeSchema },
});Users describe what they want in natural language. ProposeFlow returns a typed proposal.
// User input goes in, structured data comes out
const { proposal } = await pf.generate('recipe', {
input: 'Quick weeknight pasta with chicken',
});
// The AI-generated recipe, ready for review
console.log(proposal.generatedObject.title);
// → "Creamy Tuscan Chicken Pasta"
console.log(proposal.status);
// → "pending" (waiting for user approval)Users see the AI output in your UI. They can approve it, edit it, or reject with feedback—and the AI will try again.
// Show the AI-generated recipe in your UI
<RecipeCard recipe={proposal.generatedObject} />
// User approves → save to your database
<Button onClick={() => pf.decide(id, { action: 'approve' })}>
Looks good, save it
</Button>
// User wants changes → AI regenerates with their feedback
<Button onClick={() => pf.regenerate(id, {
feedback: 'Make it vegetarian'
})}>
Try again
</Button>A customer comments that a recipe needs more baking time. ProposeFlow notices and proposes an update—ready for your review.
AI spots problems in user feedback and proposes fixes
Real user activity drives better suggestions over time
Every suggestion needs approval before anything changes
// User leaves a comment on a recipe
await pf.registerEvent('object_created', {
object: {
type: 'comment',
data: { text: 'Needed 10 more minutes in the oven' },
},
relationships: {
recipe: [recipe], // The recipe they're commenting on
},
});
// ProposeFlow analyzes the feedback and proposes an update:
// → "Increase bake time from 35 to 45 minutes"Recipes, tasks, calendar events, invoices—if you can define it, ProposeFlow can generate it.
Hi Sarah,
I put together a quick proof-of-concept using your recipe schema. Happy to walk you through it whenever works, or I can send a recording if that's easier to share with your team.
Best, Alex
Get started in minutes. Generate your first proposal today.