Backend & Applied AI Engineer @ Drivetrain.ai

Shahbaz Hasan.
Raja

I spent my first three years building backends at LetsTransport and WeWork India: APIs, data pipelines and internal tools. In late 2025 I joined Drivetrain.ai and moved into applied AI, where I now build AI agents and MCP servers on its multi-tenant platform.

core stackPythonPostgreSQLFastAPIJavaMCPOAuth 2.0

leetcode1,519 solved · 2000 rating

01 / TRACK_RECORD

Where I've shipped.

Backend and AI work across fintech SaaS, proptech and logistics, on systems 100K+ people use every day.

  1. Drivetrain.ai

    Software Engineer - 2

    Oct 2025 – PresentRemote

    • Heimdall: MCP Gateway for Company Data

      Heimdall lets anyone at Drivetrain ask Claude about the company's own data: customer calls, support conversations, product usage, connector health and account details. I built it: an MCP server with 12 read-only tools, Okta OAuth sign-in with Dynamic Client Registration, access rules so people only see the customers they work with, safeguards so the AI can read data but never change it, and an audit log of who saw what. Nearly half the company uses it, with 100K+ tool calls since launch.

      MCPPythonFastAPIOAuth 2.0ClickHousePostgreSQL
    • Stringer: Call Intelligence for Sales and CS

      Built Stringer, the system behind Drivetrain's 8K+ recorded sales and customer calls from 700+ companies. It matches every call to its HubSpot customer, keeps transcripts in S3 with a ClickHouse index for lookups, and posts a deal report to Slack after each sales call using a template for its meeting type. Claude reaches it through Heimdall: keyword search and paged transcripts answer in under 0.2s, and Ask handles open-ended questions with a ReAct agent that finds the relevant calls by customer, date and meeting type, then reads only those transcripts. Ingestion runs as idempotent steps with a per-call log, and a nightly job re-ingests missed calls.

      PythonFastAPIClickHouseAWS S3LangChainn8n
    • Support Bot: AI Support for Every Customer Channel

      Drivetrain's support bot sits in every customer's Slack and Teams channel. Customers ask it questions and get answers straight from the product handbook, and anything it can't answer becomes a support ticket for the right person. I built it: the classifier that decides what each message needs (TypeSafe's Jev, a fast classification model, first, with Claude only for the hard cases), the handbook answers, and the ticketing behind them. It became the single way customer tickets get created: from Slack, Teams, the support@ inbox (where it also filters out spam and marketing) and in-app bug reports. It also watches customer conversations for anger and urgency, alerts the team to the worst ones, and tracks how fast they respond. Every decision is logged and reviewed into an eval set of real conversations, so changes are tested before they ship.

      PythonClaude APILLM EvalsPostgreSQLn8nSlack APIMicrosoft TeamsLinear API
    4 more at Drivetrain.ai
    • Drive AI: Data Access & User Memory

      Built the pieces that let Drivetrain's AI assistant work with real customer data safely. A read-only BigQuery endpoint lets the assistant run SQL it writes itself against a customer's own data, with a no-write account, a validator that allows only single SELECTs on that customer's dataset, and caps on cost and rows. I also built user memory end to end: saved preferences, like "answer in exactly 3 bullets", that the assistant applies in every chat, from the storage and API in the product to the prompt layer, hardened against prompt injection.

      JavaSpring BootBigQueryPythonClaude Agent SDKLaunchDarkly
    • MCP OAuth: Sign-in for Drivetrain's MCP Server

      Drivetrain's MCP server lets customers connect Claude, ChatGPT, Copilot and other AI clients straight to their planning data. I designed how they sign in and built it out: OAuth 2.0 with PKCE and Dynamic Client Registration, working for both SSO and non-SSO companies on a shared login host, plus refresh tokens, token revocation, an allowed-client list, and blocking inactive users.

      OAuth 2.0PKCEMCPOktaJavaSpring Security
    • Product Engineering: Compliance, Integrations & Workspace Provisioning

      Core product work on Drivetrain's financial planning platform, used by 500+ companies and 4K+ users. I built RBAC audit logging, a full history of who changed which permissions, with search, CSV export and a read-only Security Auditor role for compliance teams. I also built scheduled connector syncs, so customers pick their own cadence within their plan's limits. I added Microsoft Teams alongside Slack for notifications, on a shared notification layer, with admin-consent setup and automatic app install for each user. I built faster ways to build and maintain financial models, like reusing work across plan versions and editing many items at once, and the internal APIs that create customer workspaces, which Kickstart uses, including EU-region support.

      JavaSpring BootPostgreSQLMicrosoft TeamsSlack APILiquibase
    • Garage: Internal Tools Platform & Kickstart

      Built Garage, Drivetrain's internal tools platform: a React app and an async FastAPI service that run customer onboarding, consultant boards and the team's other internal tools, with company sign-in and per-module access. Its biggest module, Kickstart, takes a new customer from signed deal to working account: sales registers the deal, the customer fills a secure intake form, and Kickstart creates their workspace in the right US or EU region, sets up Linear, Slack, Monday, calendar invites and welcome email, and hands them to a consultant. Its 17 steps run through a transactional outbox onto SQS, so each one is retried safely and a failure never leaves a half-created customer. I also built North Star, a board that shows each consultant their customers' open tickets and flags SLA risk, stalled work, failing data pipelines and open sales-call action items.

      ReactTypeScriptPythonFastAPIAWS SQSPostgreSQL
  2. WeWork India

    Software Development Engineer - 2 (Backend)

    Apr 2024 – Aug 2025Bengaluru

    • SpaceOps

      Built and shipped SpaceOps, an internal space-operations tool that replaced a licensed product, saving INR 1 Cr/year, used by 300 internal users across 70+ centres. Cut a critical API's response time from 4s to 800ms with concurrent execution, DB indexing and in-memory lookups.

      NestJSPostgresPerformance
    • Locations & F&B Modules

      Designed the Locations module on Google Maps, PostgreSQL, Redis and OpenSearch, with write-through caching, serving 70+ centres and 100K+ users. Built a community-café ordering system with SSO and Server-Sent Events for real-time order tracking, used by 3K people a day.

      NestJSRedisOpenSearchSSEGoogle Maps
    • Help & Support Module

      Built an LLM ticket classifier on the OpenAI API that reached 85% accuracy and cut triage time by 40%. Added a BullMQ webhook pipeline that ingests 10K+ Salesforce updates a month.

      OpenAIBullMQSalesforce
  3. LetsTransport

    Software Development Engineer - 1 (Backend)

    Jul 2022 – Apr 2024Bengaluru

    • Trip Lifecycle & API Migration

      Owned the trip APIs (start, end, cancel), the core workflow for driver-partner operations. Refactored and migrated 8 endpoints across microservices with the Template Method pattern, halving response time, and added middleware validation so P0 APIs only return tenant-scoped data.

      Node.jsTypeScriptDesign Patterns
    • Bidding, Rate Card & Margin Config

      Built partner bidding with per-lane controlled rollouts, a Rate Card module that digitised commercial contracts, and Margin Config, which lets leadership set target gross margins per client, lane and vehicle to reduce revenue leakage.

      Node.jsPostgres
    • Infrastructure & Data Pipelines

      Built a WhatsApp chatbot on Meta webhooks for order tracking. Moved Redis to Sentinel for high availability and secrets to GCP Secret Manager, split the FE and BE pipelines to cut builds from 30 to 5 minutes, and built Airflow DAGs warehousing 20+ MongoDB collections into PostgreSQL for BI.

      AirflowRedis SentinelGCPMeta Webhooks

02 / SHIPPED

Stuff I've built for fun.

Things I've built outside of work, mostly to learn something new or scratch an itch.

Personal Developer Platform

Self-hosted platform behind this site: portfolio and CMS, Forge (a life-tracking app), and aleph, an MCP server that lets Claude read and edit both.

  • ▸ MCP server (aleph) with typed tools so Claude can read and edit portfolio and Forge data
  • ▸ FastAPI LLM service with Groq and Gemini fallback chains and pydantic-typed tool inputs and outputs
  • ▸ Custom OAuth 2.0 authorization server built from the RFCs (DCR, PKCE S256, revocation, discovery), later retired for Clerk
NestJSTypeScriptPythonFastAPINext.jsPostgreSQLRedisBullMQ

Ask about Shahbaz

An AI agent on this site that answers visitors' questions about my work, straight from the portfolio.

  • ▸ Agent explores the portfolio as a read-only filesystem with ls, cat, grep, search and history
  • ▸ Hybrid search: full-text (GIN on tsvector) and pgvector (HNSW) fused with RRF in one SQL statement
  • ▸ Fallback chain (Groq gpt-oss-120b → gpt-oss-20b → Gemini) that skips rate-limited or slow models at once
PythonPydanticAIFastAPINestJSTypeScriptPostgreSQLpgvectorRedis

YouTube.ai

Video-intelligence backend: map-reduce summarization, distributed Whisper transcription, HLS streaming.

  • ▸ Outbox Pattern for exactly-once Kafka publishing
  • ▸ Map-reduce summarization of long transcripts
  • ▸ Bloom Filters for transcript dedup
NestJSFastAPIKafkaPostgreSQLRedisOpenAIOpenSearchCelery

What the work actually looks like.

Four slices from real code: hybrid search in one query, an LLM agent over a virtual filesystem, the transactional outbox, and race-free Redis counters.

Keyword + vector search, fused in one SQL statement

typescript

Search behind the Ask agent. Postgres full-text search (a GIN index on tsvector) and pgvector cosine similarity (an HNSW index) each pick their top results, then reciprocal rank fusion merges them, all in one query. Keyword matches catch exact terms, vectors catch meaning, and RRF needs no score tuning.

  /**
   * Hybrid search in one statement: lexical top-N (full-text) + vector top-N (cosine),
   * fused with Reciprocal Rank Fusion — score = Σ 1 / (k + rank) over the legs a chunk is in.
   */
  async search(query: string, embedding: number[], k: number): Promise<ChunkHit[]> {
    const t = this.chunkTable;
    // Each leg picks its top N in an inner query, then numbers them 1..N. The vector leg orders by
    // `embedding <=> $2` itself (not a CTE column), so the planner can use the HNSW index.
    const rows: ChunkHit[] = await this.ds.query(
      `WITH q AS (
         SELECT websearch_to_tsquery('english', $1) AS tsq
       ),
       lex AS (
         SELECT id, row_number() OVER (ORDER BY rank DESC) AS r
         FROM (SELECT c.id, ts_rank_cd(c.tsv, q.tsq) AS rank
               FROM ${t} c, q WHERE c.tsv @@ q.tsq
               ORDER BY rank DESC LIMIT $4) l
       ),
       vec AS (
         SELECT id, row_number() OVER (ORDER BY dist) AS r
         FROM (SELECT c.id, c.embedding <=> $2::vector AS dist
               FROM ${t} c
               ORDER BY c.embedding <=> $2::vector LIMIT $4) v
       ),
       fused AS (
         SELECT id, SUM(1.0 / ($5 + r)) AS score
         FROM (SELECT id, r FROM lex UNION ALL SELECT id, r FROM vec) u
         GROUP BY id
       )
       SELECT c.id AS chunk_id, c.path, left(c.text, $6) AS text, c.location
       FROM fused f JOIN ${t} c ON c.id = f.id
       ORDER BY f.score DESC, c.id
       LIMIT $3`,
      [query, toVector(embedding), k, RAG_LEG_LIMIT, RAG_RRF_K, RAG_SNIPPET_CHARS],
    );
    return rows;
  }

apps/portfolio-be/src/modules/ai/services/rag.service.ts

Tools of the trade.

What I reach for day to day: not everything, just what I've actually shipped with.

Languages

  • Java
  • Python
  • C++
  • TypeScript
  • JavaScript

Frameworks & Libraries

  • Spring Boot
  • JPA / Hibernate
  • NestJS
  • FastAPI
  • Flask
  • Node.js

GenAI & AI Tooling

  • Claude Agent SDK
  • MCP
  • Claude API
  • LLM Evals
  • LangChain / LangGraph
  • OpenAI API
  • Prompt Engineering
  • RAG

Databases & Search

  • PostgreSQL
  • MongoDB
  • Redis
  • OpenSearch
  • ClickHouse
  • Firebase

Infrastructure & Cloud

  • AWS
  • GCP
  • Apache Airflow
  • Docker

Messaging & Eventing

  • Kafka
  • BullMQ
  • AWS SQS
  • Server-Sent Events

Design & Architecture

  • System Design
  • Microservices
  • Event-driven Architecture
  • API Design
  • DB Schema Design
  • OAuth 2.0 / OIDC
  • OOP

Where I studied.

Jul 2018 – Jun 2022 · Bhubaneswar, India

Kalinga Institute of Industrial Technology.

Bachelor of Technology·Electronics & Computer Science·GPA 9.15 / 10

  • Ranked #1 in university on GeeksforGeeks

Some things I'm proud of.

  • WeWork India

    Moonshot Award: WeWork Annual Awards

    Recognized for technical innovation in SpaceOps development.

  • WeWork India

    Most Innovative Engineer

    Named Most Innovative Engineer by the Head of Engineering at WeWork India.

  • LeetCode

    LeetCode Knight: 2000+ Rating

    Top 2% globally on LeetCode. 114 contests, ranked top 2.53% of 869K+ participants.

  • GeeksforGeeks

    #1 in University on GeeksforGeeks

    Ranked first at Kalinga Institute of Industrial Technology on GFG problem-solving.