Skip to content
Harshdeep Singh

Harshdeep Singh — Backend Engineer

I build backend systems where real‑time software meets AI.

I work in TypeScript and Node.js on the parts that have to keep working: real-time transport with Socket.IO and Redis, asynchronous processing through transactional outboxes and leased workers, AI-powered workflows that keep a human in the loop, and retrieval that cites its sources.

Selected work

01Flagship

Semantask

Real-time work coordination

An open-source work-coordination platform. Teams talk in chat, conversation becomes reviewable suggestions, managers approve, and tool-running autonomy stays optional and policy-gated.

Transport-only Socket.IO
HTTP persists first. The socket server authorizes and fans out, and never writes to MongoDB.
Transactional outbox
The domain write and the worker trigger commit in the same Mongo transaction.
Leased workers
One worker per task through a DB lease with heartbeat. A failed heartbeat aborts the in-flight LLM call.
Layered idempotency
Event, action and tool keys make at-least-once delivery safe to retry.
  1. 01Conversation
  2. 02Suggestion
  3. 03Approval
  4. 04Execution

Execution is optional. Tools run only when org policy allows; the default mode is suggest_only.

02Retrieval

Knowledge Workbench

Research with hybrid retrieval and citation-grounded answers

A NotebookLM-style research assistant. Notebooks hold PDFs, articles, YouTube videos and VTT transcripts; answers stream with citations that jump back into the source viewer.

  1. 01Ingest
  2. 02Dense + full-text
  3. 03Fuse + rerank
  4. 04Cited answer
  • Bun
  • TanStack Start
  • PostgreSQL
  • Qdrant
  • OpenAI
  • Clerk

03Open source

TanStack AI and other contributions

Merged pull requests to TanStack AI, a TypeScript AI SDK, plus an open typing pull request to Rocket.Chat.

  • Provider integrations
  • Streaming and error handling
  • Runtime type safety
  • Tests and in progress

Engineering

I care about what happens after the demo works.

A demo proves the happy path. These are the other paths, and what Semantask does on each one.

A worker dies mid-task.

Its lease stops renewing, and any worker can take an expired lease; the old owner's release becomes a no-op. If a heartbeat fails, the in-flight LLM call and tool fetch are aborted.

The same event arrives twice.

Delivery is at-least-once, so idempotency does the work at three layers: event, action and tool. The tool key hashes task, step, tool and params, so a retried run cannot repeat a side effect.

The write commits, but the worker is never told.

The domain change and the outbox event are written in the same Mongo transaction, so both commit or both roll back. Stale claims older than five minutes become re-claimable.

A socket server is killed.

It holds no durable state. Rooms coordinate through the Redis adapter, and the presence sweeper expires stale users within about 65 seconds even when no disconnect fires.

A banned user still holds a valid token.

Identity is re-validated against MongoDB on connect over an internal HTTP bridge, never from JWT claims alone.

The model wants to run a tool.

Suggest-first: it proposes, a person approves, and tools run only when organization policy allows. The default mode is suggest_only.

Curious about the work?

The portfolio assistant answers questions about the projects, design decisions and how to get in touch — from the notes on this site, with links to the page that covers it.