Alot LabsBook the briefing
Software · Frontline

Frontline

A support agent and a marketing agent on one platform. Every reply streams as it is written, and every conversation is kept for you to read.

What it does

Two agents, two jobs

One agent handles support: product questions and fixes. The other is a marketing representative at the top of the funnel. Each has its own persona, and they share no prompt.

Replies stream

Each reply arrives word by word over a server-sent stream, so the customer reads while the agent writes.

One schema for every surface

One API schema generates the server types and client hooks, so the dashboard, the chat and the backend cannot drift apart.

How a message is answered

The light takes a support question, then a marketing one. Both replies stream into the command centre.

How a message is answeredsupportmarketingstreamedstreamedA customerSupport or marketing?Support agentquestions, fixesMarketing reptop of funnel, own voiceCommand centreevery word, readable

Core responsibilities

  1. Run two agents

    One answers product questions and troubleshoots; the other opens the conversation with new visitors. Each has its own persona and its own prompt.

  2. Stream every reply

    Each answer streams to the visitor word by word as the agent writes it.

  3. Keep the record

    The business gets a dashboard of live counts and every exchange either agent has had, open to read.

  4. Hold one schema

    Server types and client hooks come from one schema, so the dashboard, the chat and the server cannot drift apart.

  5. Replay recorded conversations

    The public demo is the real interface replaying recorded conversations, with the streaming reproduced and labelled as a replay.

Frontline in figures

  • 2agents, support and marketing, with no shared promptthe repository
  • 1schema generates the server types and the client hooksthe repository
  • 133files in the repositorycounted in the repository
  • 2days to build, first commit to lastread in the commit log

Counted in the repository, read from a run or set in the code. No figure is estimated.

FrontlineBuilt

Why it is built this way

The code enforces two rules.

Apply for a seat

The whole conversation, in order

Opening a conversation returns every message in the order it was written. Deleting a conversation deletes its messages too.

Read one agent at a time

The list of conversations can be narrowed to one agent, so the business reads support and marketing apart.

The code behind Frontline

Three files from the repository, shown in turn. Select one to read it.

01router.get("/agents/stats", async (_req, res): Promise<void> => {02  const [totalConvRow] = await db.select({ count: count() }).from(conversations);03  const [totalMsgRow] = await db.select({ count: count() }).from(messages);04 05  const allConvs = await db.select().from(conversations);06  const marketingConversations = allConvs.filter((c) => c.agentType === "marketing").length;07  const supportConversations = allConvs.filter((c) => c.agentType === "support").length;08 09  res.json({10    totalConversations: totalConvRow?.count ?? 0,11    marketingConversations,12    supportConversations,13    totalMessages: totalMsgRow?.count ?? 0,14  });15});

Bring the workflow that keeps breaking.

Our engineers work through it with you in a free 45-minute briefing.