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.
- Available for opportunities
- 2026 BCA graduate
- Full-time or internship
- Punjab, India · open to remote
- github.com/harshlocham ↗
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.
- 01Conversation
- 02Suggestion
- 03Approval
- 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.
- 01Ingest
- 02Dense + full-text
- 03Fuse + rerank
- 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.
Architecture
How Semantask is put together.
Engineering notes on each component: why it exists, what it owns, the decision behind it, and what that decision costs.
- 01HTTPValidation, persistence and authorization. The only writer.
- 02WebSocketTransport, rooms and fan-out. Schema-free.
- 03RedisAdapter fan-out and ephemeral state, treated as two systems.
- 04OutboxDurable enqueue in the same transaction as the domain write.
- 05WorkerLeased, heartbeated, idempotent execution.
- 06DecisionsTen decisions, the alternatives rejected, and what each one costs.
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.