Skip to content
← All work

Real-time task board with an AI agent

Stackboard

A real-time collaborative task board with an AI agent that plans changes and asks before it applies anything.

My role: Designed and built end to end: frontend, backend, realtime layer, AI agent and DevOps

Visit taskboard-nine-pink.vercel.app ↗
  • Agents
  • Next.js 16
  • FastAPI
  • Redis
  • WebSockets
Screenshot of Stackboard, real-time task board with an ai agent, built by Anshuman Verma

Overview

Stackboard is a Trello-style board built to show production-grade patterns: live updates over WebSockets with presence, role-based access, a full audit log — and a board-scoped tool-calling agent that creates, moves, edits and deletes cards from plain language.

The challenge

Adding an AI assistant to a collaborative tool is risky. If it misreads "move everything to done" or guesses the wrong date, it changes work that a whole team depends on, and nobody knows who or what made the change.

Stackboard was built to show how to do it properly: a real-time board several people use at once, with an agent that can act on plain-language requests but proposes risky changes for approval, and an audit trail that covers both people and AI.

How it works

  1. 1Plain-language request
  2. 2Board context
  3. 3OpenAI tool calls
  4. 4Reviewable plan
  5. 5User confirms
  6. 6WebSocket broadcast

Architecture

The frontend is Next.js 16 with React 19; the backend is FastAPI with SQLAlchemy 2 and Pydantic v2. It runs on SQLite for local development and PostgreSQL in production, wired together with Redis by Docker Compose. Users, boards, memberships, lists, cards and the activity log use cascading deletes enforced in the database, and schema changes apply additively at startup.

Real-time updates use native WebSockets with a per-board connection manager. Clients authenticate by sending their JWT as the first socket message, which keeps tokens out of URLs and logs. With Redis, broadcasts go through pub/sub and presence lives in a shared hash, so several backend instances stay in sync; a Redis lock stops duplicate reminders. Without Redis it falls back to single-instance mode.

The agent uses OpenAI function calling with six tools and receives the whole board as context. Any plan with more than three changes, a deletion, a possible duplicate or a guessed date is returned as a reviewable plan with per-action checkboxes; plans expire and are re-validated before applying. Relative dates are resolved in code, duplicates are caught by fuzzy matching plus embedding similarity, embeddings are computed in background tasks, and every AI action is logged as "AI · user" with its prompt.

What I built

Tool-calling agent

Six OpenAI function tools with the whole board as context, so it can act and answer “what's overdue?” or “summarise for standup”. Replies stream over SSE with 12 turns of memory.

Confirm before apply

Any plan with more than three changes, a deletion, a possible duplicate or a guessed date comes back as a reviewable plan with per-action checkboxes. Plans expire and are re-validated before applying.

Realtime at scale

Per-board WebSocket manager; with Redis, broadcasts use pub/sub and presence lives in a shared hash so several backend instances stay in sync.

Duplicate detection

Fuzzy title match plus embedding similarity, with thresholds calibrated on real scores so “fix signup bug” vs “fix login bug” doesn't false-positive.

Audit everything

Every mutation — human or AI — writes an activity row, with keyset pagination so the feed stays fast. AI actions are logged as “AI · user” with the prompt.

Semantic search

Cards are embedded in a background task on create/update and scored with a vectorised cosine pass, portable across SQLite and Postgres.

Engineering decisions

  • Resolve relative dates (“by Friday”) in code, after measuring that the model got weekday arithmetic wrong about half the time.
  • Send the JWT as the first socket message instead of in the URL, keeping tokens out of logs.
  • Compute embeddings in a background task so creating a card never waits on OpenAI.

Results

  • Live demo at taskboard-nine-pink.vercel.app, no sign-up required.
  • Agent changes above a safety threshold always go through human confirmation.
  • Multi-instance real-time sync through Redis pub/sub and shared presence.
  • Complete audit trail for human and AI actions, paginated with keyset pagination.

Stack

Frontend
Next.js 16 (App Router), React 19
Backend
FastAPI, SQLAlchemy 2, Pydantic v2
Realtime
Native WebSockets, Redis pub/sub, SSE
AI
OpenAI function calling, OpenAI embeddings
Auth
JWT sessions, email/password, Google OAuth
DevOps
Docker Compose, Postgres (SQLite for local dev)

Need something like this?

I can build a version of this for your product, your data and your stack.

Start a project