All projects
AI2026In Progress

Agentic Workers

A multi-agent platform where LangGraph workers research, plan, and act — with a task board built on a guarded lifecycle.

Role

Full-stack engineer — agent orchestration, task domain, and API design

Built with

  • TypeScript
  • Bun
  • Hono
  • LangGraph
  • LangChain
  • MCP
  • +5 more
Agentic Workers research agent streaming interface with citations
  • Independent agent graphs
  • 5-node research pipeline
  • 8+ task statuses
  • SSE streaming

The Problem

What needed to be solved

Most agent demos work on the happy path. The hard parts are the ones that show up once agents run for real: a status field that quietly bypasses every rule, a list endpoint that duplicates or drops rows mid-scroll, and a worker that has no durable record of what it did.

Context

Why it was built this way

The goal was to build agents that behave like reliable software components rather than demos — ones that can be observed, scheduled, interrupted, and handed work through a task system with real constraints. The task board ended up being the more interesting engineering problem.

Approach

How I built it

  1. 01

    Build each agent as a standalone LangGraph graph that can be interacted with independently, rather than one large shared graph.

  2. 02

    Use a five-node pipeline for research — Router classifies the query as simple or complex, Planner decomposes complex queries into sub-questions, Researcher executes searches in parallel via Exa MCP, Analyst synthesizes findings and identifies gaps, Writer formats the output with citations.

  3. 03

    Stream everything over SSE, including custom events from nodes, so the client sees routing decisions and intermediate reasoning rather than only the final answer.

  4. 04

    Model the task board as a guarded lifecycle — status is not a field you can patch, it is a transition that has to be checked against the allowed graph before it is accepted.

  5. 05

    Keep the transition rules in a single static config module so validating a transition never needs a database round trip and the status and priority types stay statically known.

  6. 06

    Use cursor pagination instead of offset, ordered by createdAt DESC, id DESC, so a row inserted mid-scroll does not shift every later page.

  7. 07

    Persist an event history for every task, so the board can show what happened rather than only what a card looks like now.

My role

What I was responsible for

  • Designed and implemented the multi-node research graph — router, planner, researcher, analyst, and writer.

  • Built the SSE streaming layer, including custom events emitted from inside graph nodes.

  • Integrated Exa through MCP with the LangChain MCP adapters, handling tool discovery and parallel fan-out across sub-questions.

  • Designed the task lifecycle model — statuses, transitions, priorities, and the guards that enforce them.

  • Implemented cursor pagination for task and event listing with opaque cursors decoded in exactly one place.

  • Built the task board API, including assignment to either a user or an agent, and archival with a reason and actor.

  • Set up the scheduler layer on Inngest for durable, retryable background execution.

  • Built observability tracking and structured logging with Pino.

  • Designed the Hono API surface with thin route handlers and domain logic isolated in features.

Challenges

The hard parts

Status changes that bypass the rules

If status were a patchable field, a plain PATCH could walk a card past every rule in the config. Status was removed from the update schema entirely — a status change is a lifecycle move with its own guards and its own event.

Cursor paging vs offset paging

Results are ordered by createdAt DESC, id DESC. With offset paging, a row inserted mid-scroll shifts every later page. The cursor is an opaque encoding of that same pair, and the route never parses it.

Zod v4 defaults silently resetting untouched columns

Calling .required() strips the defaults first; without it Zod v4 applies defaults to optional fields and a PATCH would reset columns the caller never touched.

Parallel research without losing ordering guarantees

Sub-questions fan out in parallel, so the graph uses the Send API for node fan-out and custom streaming events to keep the client informed of progress in a defined order.

Swagger UI behind security headers

Standard OpenAPI middleware conflicted with the CORS and security-header setup. The spec is embedded directly in the Swagger UI page instead, with the OpenAPI JSON exposed at its own route.

Decisions

Key technical calls I made

Transitions are a separate operation from updates

Status is absent from the update schema on purpose. A lifecycle move carries guards and emits its own event, so it cannot be smuggled in as a field edit.

Static transition config over database lookups

The allowed transition graph lives in one module, which keeps transition checks synchronous and the status and priority types statically known.

Cursor pagination with opaque cursors

The route treats the cursor as an opaque token and only the server-side task module decodes it, which keeps the encoding free to change.

Standalone graphs per agent

Each agent is an independent graph that can be interacted with on its own, so adding a new agent does not mean growing one shared graph.

Recursion limits and explicit loop control

Agent loops get a recursion limit and an explicit stop condition, because a research agent that never stops is a failure mode, not a feature.

Gallery

Project in practice

Outcome

Where it landed

Agentic Workers combines a working multi-agent runtime with a task system built to survive real use — guarded transitions, cursor pagination, durable events, background scheduling, and observability. It is where I went furthest into the parts of agent engineering that are not about prompts: state, guards, retries, and the boring parts of reliability that decide whether an agent is usable in production.

The source for this project is private. I'm happy to walk you through the architecture, the decisions behind it, and what I would do differently — get in touch and we'll set something up.

Stack

Built with

TypeScriptBunHonoLangGraphLangChainMCPPostgreSQLDrizzleInngestPinoZod

Keep reading