
Weekend Productivity Challenge: TaskPilot
An AI-powered task prioritizer built on Amazon Bedrock. Paste a raw to-do list, get an instantly ranked list back — ordered by urgency and impact, with the reasoning behind every rank.
Vision & What the App Does
Everyone has a to-do list. Almost nobody has a prioritized one. The list itself is easy — the hard part is the five minutes you spend every morning staring at ten unordered tasks trying to figure out what actually matters today. That decision fatigue is the real productivity tax, not the tasks themselves.
TaskPilot removes that step entirely. Paste a raw list of tasks — one per line, no formatting required — click Prioritize, and get back a ranked list with a one-line reason next to each item explaining why it landed where it did. No login, no setup, no categories to configure ahead of time. You dump your brain into a textbox and get clarity back in about two seconds.
The severity of the reasoning is deliberately grounded rather than generic. "Reply to client email" outranks "reorganize desktop icons" not because the model guesses at vague notions of importance, but because the prompt explicitly instructs it to weigh time-sensitivity and downstream impact — a blocked teammate ranks above a nice-to-have, a deadline today ranks above a deadline next month. The goal is to compress the mental overhead of prioritization into a single click.
How I Built It
I started with the core loop before touching any UI. The first version was a raw script calling Amazon Bedrock directly with
boto3 — no Lambda, no frontend, just confirming the model could take a plain-text task list and return something structured. I picked Nova Micro ( amazon.nova-micro-v1:0 ) early: at roughly $0.000035 per 1K input tokens it's the cheapest Nova model, latency is low, and ranking a short list doesn't need a heavyweight model.The real challenge was getting reliable JSON back every time. Asking for JSON in the user message alone isn't enough — Bedrock will sometimes wrap the output in a markdown code fence, which silently breaks
JSON.parse() if you're not expecting it. I fixed this by defining the exact output schema in the system prompt rather than the user message, and added a regex strip step to remove any stray triple-backtick fencing before parsing. On top of that, a single retry: if the first response fails to parse, the Lambda calls Bedrock again once, and if that also fails, it falls back to returning the tasks unranked with an error flag instead of throwing a 500. That three-layer safety net — strip, retry, fallback — means the app never hard-fails just because the model added unexpected formatting.I deployed the Lambda with a Function URL instead of API Gateway, mainly to skip the extra setup — this app doesn't need throttling or usage plans, just a public HTTPS endpoint. That decision came with its own gotcha: CORS on a Function URL has to be configured in two places, the AWS-side CORS config and explicit headers in the Lambda response itself, plus handling for the
OPTIONS preflight. I missed the second part on my first deploy and got silent fetch failures in the browser with no useful error until I checked the network tab and saw the missing Access-Control-Allow-Origin header.The frontend is Next.js, deployed on Vercel rather than Amplify, with a single API route acting as a thin proxy in front of the Lambda Function URL — partly to keep the raw AWS endpoint out of client-side code, partly because Vercel's environment variable scoping across Production and Preview made it trivial to point different deploys at different Lambda URLs without touching code.
AWS Services Used / Architecture
Browser (Next.js UI on Vercel) | |-- POST /api/prioritize (Next.js API route, thin proxy) | └-- HTTPS POST --> Lambda Function URL --> AWS Lambda (Node.js 20.x) | └-- InvokeModel --> Amazon Bedrock (Nova Micro)- Amazon Bedrock (Nova Micro,
amazon.nova-micro-v1:0) takes the raw task list and returns a structured JSON array — priority rank plus a one-line reason per task.
- AWS Lambda (Node.js 20.x) calls
bedrock-runtime InvokeModel, strips markdown artifacts from the response, retries once on parse failure, and falls back to unranked output rather than erroring out. Exposed via a public Function URL with CORS enabled.
- AWS IAM provides the Lambda execution role, scoped to
bedrock:InvokeModelon the Nova Micro model plus basic CloudWatch Logs permissions.
- Amazon CloudWatch Logs captures Lambda execution traces and any Bedrock parsing failures for debugging.
Vercel hosts the Next.js frontend for fast global delivery — all AI logic and compute run on AWS.
What I Learned
Bedrock's request format isn't OpenAI-shaped. The
bedrock-runtime client wraps the model payload in its own envelope, and for Nova models the system prompt is a separate field from the message array rather than the first message in it — small enough to trip you up the first time you write the call.Schema-in-system-prompt beats "please return JSON." Putting the exact expected JSON shape in the system prompt, rather than asking for it conversationally in the user message, made output dramatically more consistent — combined with stripping any markdown fencing defensively, since the model doesn't guarantee it'll skip the triple backticks even when told to.
Function URLs are worth it for anything this size. Skipping API Gateway cut real setup time and complexity, and for a single-endpoint prototype the throttling and usage-plan features weren't needed — the tradeoff is you own CORS configuration yourself instead of getting it more automatically.
Always design for the model being wrong sometimes. The strip-retry-fallback pattern felt like over-engineering while writing it, then immediately caught a real malformed response during testing. Defensive parsing isn't a nice-to-have for LLM output — it's the difference between an app that degrades gracefully and one that 500s the first time the model has an off response.
The whole thing — Lambda handler, Next.js app, and deploy — came together in well under a day. Leaning on a managed model plus serverless compute meant almost no infrastructure work stood between the idea and a working prototype.
Link to Repo


Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article