Skip to content
Write to me

PRTL Labs

Software EngineerOct 2024 to Jun 2025Part-time, then full-time from Apr 2025

AI agents that plan and run marketing for local retail brands.

Each campaign runs as ten durable steps on Cloudflare. Every finished step is saved, so when one fails, only that step runs again.

The agent console

One request, and the plan that came back

Ask the agent one plain-English sentence

Schedule a marketing campaign for the next daySend

The plan recorded reply

{"understanding": "Plan a marketing campaign for tomorrow, built on what is happening locally""tool": "createMarketingCampaign""reason": "User wants a marketing campaign for the next day""tool": "searchWebTrends""reason": "Needs fresh local topics for the post""strategy": "Start the campaign workflow and a trend search side by side"}
The product's own agent code, run locally on invented data, in a small console made for this demonstration. The model's reply is a recorded stand-in, and the plan's settings are left out.

01 of 04Case studyFilm 1:39

How the agents plan, run and schedule a campaign

Windows and cards come from the product's own agent code, run locally on invented data, in a console made for this demonstration. The model's reply is a recorded stand-in, outside services are stubbed and nothing was posted. The Instagram failure was forced and some waiting cut. Drawn: posts, tiles, headlines, pointer, MCP scene (MCP, a standard way agents call tools).

steps from a local trend to a post
10
Durable Object (a small server) per task
1
of the agent's code from my commits
99%

At PRTL Labs I worked on AI agents that run marketing for local retail brands. We tried to get several agents working together on Cloudflare, and the parts below are the ones I designed and built.

How I did itHide how I did it

A local shop wants posts that feel local. I built the agent that turns one typed sentence into a planned campaign, runs its ten steps, recovers when one fails, and sets an alarm for anything scheduled.

Transcript

The film has music and no voice. These are the words that appear on screen, in order.

Local shops need posts that feel local.

Making one meant starting every job by hand.

Now it takes one sentence.

The agent reads it and writes its own plan.

It picks its tools and says why.

Then it runs the campaign in ten steps, and saves each one as it finishes.

It finds what's happening in town and writes about that.

If a step fails, only that step runs again.

Tell it when, and it sets its own alarm.

Every scheduled post gets its own alarm.

When the alarm rings, the campaign starts itself.

Other agents can call it too, over MCP.

One sentence goes in, and a running campaign comes out.

PRTL Labs

AI agents that run marketing for local retail brands.

02 of 04Agent orchestration

Turning a sentence into workflows

A still from the film. The headline reads: It picks its tools and says why. Under it, the decision trail from the demo console: each tool the agent ran, why, and the workflow it started. From the product's own agent code, run locally on invented data in a console made for this demonstration.
tools the agent chooses between
4
ways other programs can call it
3
of the agent's code from my commits
99%

An agent here is a program that reads a request, picks its own tools and uses them. Our pipelines were separate jobs that someone had to start with the right settings. I designed and built one agent to start them all. Other programs call it over SSE, a connection that stays open and streams the reply, over plain HTTP, or directly over RPC, a call from one program straight into another.

03 of 04Durable pipeline

A campaign as ten durable steps

A still from the film. The headline reads: It finds what's happening in town and writes about that. Under it, three saved steps from the demo console: recent campaigns, local trends and write the post. From the product's own agent code, run locally on invented data in a console made for this demonstration.
durable steps from trend to post
10
retries at most for a failed step
2 or 3

A campaign takes ten jobs in order, and most call an outside service that can fail. So it runs as one Cloudflare Workflow, one step per job.

04 of 04Scheduling

Scheduling: one object and one alarm per task

A still from the film. The headline reads: Every scheduled post gets its own alarm. Under it, three task cards from the demo console, each with its alarm set, for 09:00, 13:00 and 18:00 UTC. From the product's own agent code, run locally on invented data in a console made for this demonstration.
alarm a Durable Object can hold
1
Durable Object per scheduled task
1
how often the old sweep ran
1 min

When I tested it, posts scheduled through the API fired on time. From chat, some did not, so adding checks there was next on the list.

Also at PRTL Labs

  • Extended a teammate's knowledge-graph agent so it repairs its own database queries. When a generated query fails, the error and the schema go back to the model for a rewrite and another try.
  • Found that the graph database lost its data whenever the host scaled down, because it wrote to local disk, and argued for running it on a VM.
  • Set up builds on Google Cloud with triggers that rebuild only when the paths they watch change.
4 moreShow fewer
  • Merged the separate agent and workflow apps into one TypeScript monorepo, with one set of schemas shared by the workflows, the agents and the APIs.
  • Before the platform, built agents on the open-source Pippin framework. One checked basketball scores every hour, made a highlight image and posted it to X. Another posted weekly marketing and sent advertising notifications.
  • Built loyalty sign-up pages that put a membership card straight into Apple Wallet or Google Wallet, picking the right one for the phone.
  • Added Google sign-in, email verification and analytics to a chat CRM, and ran a loyalty-points sync as a scheduled Kubernetes job.

Next project

HelpHive

Final year project

A marketplace where hotels book housekeeping staff by the hour, with an Android app for hotels and providers, a web app and an admin console.

25 kmjobs nearby arrive as an alert