01Systems
On AiChat, a B2B conversational AI platform at reAlpha, my work spans the multi-tenant backend, the RAG and LLM pipeline, the channel integrations, sign-in, and the analytics pipeline. The diagram shows how those parts fit together.
Web chatBrowser
Customers chat from the business's own website. These messages use the same pipeline as every other channel.
WhatsAppMeta Business
Messages arrive by webhook and are converted to the shared message format. Replies go out through WhatsApp-specific delivery code.
MessengerMeta Graph API
Works the same way as WhatsApp. Only the parsing of incoming messages and the delivery code are specific to Messenger.
InstagramMeta Graph API
Instagram DMs are processed the same way as WhatsApp and Messenger messages.
APINestJS · Prisma
Every request is tied to an organization, and its queries run against that organization's schema.
IdentityStytch B2B
Handles sign-in for each organization, including SAML and OIDC single sign-on and sessions.
Job queueBullMQ · Redis
Incoming work goes on a queue and is processed in the background instead of inside the request.
WorkersNode.js · ElastiCache
Runs background jobs for tenant-specific work.
RAGIndexing · retrieval
Each tenant configures its own knowledge base. Documents are indexed, and the relevant parts are retrieved as context for the model.
LLMOpenAI
Writes the reply from the conversation and the retrieved context.
IntegrationsHubSpot · Shopify · Meta
Connects conversations to HubSpot, Shopify, and Meta Business.
PostgresRDS · schema-per-tenant
Each organization has its own schema, and there are thousands of them. Connection pooling and migrations have to work across all of them.
ReplicationAWS DMS
Copies data from the production database to the warehouse.
WarehouseRedshift Serverless
Runs analytics and business reporting across all tenants.
A customer sends a business a message on WhatsApp.
API
The webhook reaches the API, which looks up the business's organization.
Job queue
The message goes on a queue for background processing.
Workers
A worker picks up the job.
Postgres
The worker loads the conversation from that organization's schema.
RAG
The relevant parts of the knowledge base are retrieved.
LLM
The LLM writes a reply.
The reply is sent back through WhatsApp.
Hover or tap a component to see what it does and what it connects to, and tap it again to clear. Select Trace a message to follow one WhatsApp message through the system.
Hover or tap a component to see what it does and what it connects to, and tap it again to clear. Select Trace a message to follow one WhatsApp message through the system.
02My contributions
- Prisma▸tenant_0001▸tenant_0002▸tenant_0003× thousands of schemas01
Schema-per-tenant Postgres
One schema per organization, kept reliable across thousands of them through connection pooling, query tuning, and migrations.
- DocsIndexRetrieveLLM02
RAG knowledge bases and flows
Configurable knowledge bases with document indexing and contextual retrieval, plus the flows that drive each conversation.
- RDSDMSRedshift03
Analytics on a separate warehouse
AWS DMS copies production data into Redshift Serverless, so reporting runs on the warehouse instead of the live database.
- WhatsAppMessengerInstagramHubSpotShopifyMeta Business04
Third-party integrations
Connected AiChat to Meta's messaging apps for conversations and to HubSpot and Shopify for business data.
- SAML / OIDCStytchSession05
Enterprise sign-in
Organization-level identity on Stytch B2B, with SAML and OIDC single sign-on and session management.
- SubscriptionStripeInvoice06
Subscriptions and invoicing
Integrated Stripe to handle subscription billing and invoices.
03Work
- years of professional experience
- 6+
- people I lead across engineering, design, and QA
- 10+
- Lead a team of 10+ engineers, designers, and QA, and work on the architecture and delivery of AiChat, a B2B conversational AI platform.
- Designed the multi-tenant backend in NestJS, PostgreSQL, and Prisma, with a separate schema for each of thousands of organizations.
- Built the LLM features, including configurable RAG knowledge bases, document indexing, and retrieval, plus integrations with HubSpot, Shopify, and Meta Business.
- Built messaging for web chat, WhatsApp, Messenger, and Instagram, with asynchronous processing and separate delivery for each channel.
- Designed the analytics setup, which uses AWS DMS to replicate data from RDS into Redshift Serverless for reporting across tenants.
- Implemented enterprise sign-in with Stytch B2B, including organization-level identity, SAML and OIDC single sign-on, and session management.
- Built background processing on AWS, Redis, and BullMQ for tenant-specific jobs.
- Made tenant database operations more reliable through connection-pool management, query optimization, and schema migrations across thousands of schemas.
- TypeScript
- NestJS
- Next.js
- Python
- PostgreSQL
- Prisma
- Redis
- BullMQ
- Redshift
- AWS DMS
- RDS
- S3
- SQS
- SES
- Stytch
- OpenAI
- Docker
04Stack
- Languages
- TypeScriptJavaScriptPython
- Frontend
- ReactNext.js
- Backend
- NestJSFastAPIExpressSocket.IOMCP
- AI
- LLMsRAGMCP servers & clients
- Data
- PostgreSQLMySQLRedshiftMongoDBRedisFirebase
- Infra
- AWSAzureGCPCloudflareDockerNginxLinux
05Contact
Email is the best way to reach me.