distributed systems · defi infrastructure · agentic ai

Systems that scale,
settle, and survive.

Senior architect shipping production-grade distributed backends, multi-chain DeFi infrastructure, and agentic AI pipelines. I design around CAP trade-offs — strong consistency where money moves on-chain, eventual where throughput demands it. Every service ships with saga orchestration, idempotency keys at every execution boundary, and outbox-pattern guaranteed delivery. When failures hit, compensating transactions roll back cleanly and reconciliation daemons self-heal state drift without waking anyone at 3am.

4+ years production-grade systems
p95 latency improvement
3 blockchain networks shipped (evm · sol · btc)
0 financial leakage across all sagas

Not slides. Live systems.

Three real patterns I ship in production, runnable in the browser. Run them, watch the state machine, watch the compensations fire. This is the discipline behind the bullet points below — not a marketing reel.

guest@ritesh-system: ~ — production logic
> curl -s https://api.ritesh.dev/status | jq .
{ "name": "Ritesh Khamitkar", "title": "Distributed Systems & Blockchain Architect", "experience": "4+ years · production-grade", "distributed_systems": { "patterns": ["Saga+Compensation", "CQRS", "Outbox", "Event Sourcing", "Circuit Breaker"], "consistency": "Strong where money moves. Eventual where throughput demands.", "delivery": "At-least-once + idempotency keys at every boundary", "resilience": "Circuit breakers · bulkheads · backpressure · DLQs" }, "blockchain": ["EVM / Base L2", "Solana", "Bitcoin PSBT", "Smart Contracts"], "backend": ["NestJS", "FastAPI", "Kafka", "PostgreSQL", "gRPC", "Redis"], "ai": ["Google ADK", "MCP", "Vertex AI Reasoning", "RAG Pipelines"], "infra": ["AWS (EC2/RDS/S3)", "GCP Cloud Run", "Docker", "k8s", "GH Actions"], "p95_improvement": "4× (asyncio + Firestore cache + connection pooling)", "status": "available_for_technical_evaluation" }
> node saga_engine.js --execute-swap

// Distributed multi-chain swap saga (NestJS logic, real recovery paths)

IDEMP_CHECK
INITIATED
ESCROWED
SOL_RPC_FAIL
ROLLED_BACK
// State machine idle. Click "run" to test the distributed transaction saga.
> python reconcile_daemon.py --detect-drift

// Self-healing ledger reconciliation & finality daemon (PostgreSQL + Base L2)

SCAN_POSTGRES
STUCK_DETECTED
QUERY_CHAIN_RPC
CONFIRMATIONS (0/12)
RECONCILED_SETTLED
// Daemon sleeping. Click "trigger" to simulate post-restart database recovery.

The systems DNA.

Six domains, end-to-end. Distributed-systems fundamentals first — the rest follows. Every item below has shipped to production, not just been read about.

Distributed Systems Fundamentals
  • CAP & PACELC trade-offs · consistency models (strong / eventual / causal)
  • Saga pattern · compensating transactions · 2PC when justified
  • CQRS · event sourcing · outbox pattern
  • Idempotency keys · exactly-once semantics · deduplication
  • Latency vs throughput reasoning · back-of-envelope cost estimation
  • Leader election · quorum · gossip protocols
Scaling & Reliability
  • Horizontal scaling · sharding · consistent hashing · read replicas
  • Circuit breakers · bulkheads · backpressure · rate limiting
  • Dead-letter queues · poison-message isolation · retry with jitter
  • Multi-region deployment · failover · zero-downtime deploys
  • Failure-mode analysis · graceful degradation · fallback chains
  • Blue-green · canary · expand-contract schema migrations
Observability & Operability
  • Metrics · structured logs · distributed tracing (OpenTelemetry)
  • SLI/SLO/SLA design · error budgets · alerting on user impact
  • Health checks · readiness/liveness probes · graceful shutdown on SIGTERM
  • Connection pooling tuning · cache TTL & invalidation strategy
  • CRON reconciliation · idempotent reprocessing daemons
  • Cost-per-request tracking · budget alerts · model routing
Blockchain & Smart Contracts
  • Solidity / Hardhat / Foundry · gas optimization
  • ERC-20 / ERC-721 · OpenZeppelin (ReentrancyGuard, Pausable, SafeERC20)
  • Base L2 · zkSync · CREATE2 deterministic deployment
  • keccak256 commit-reveal escrows · multi-chain USDC routing
  • EVM & Solana paymasters · gasless transactions end-to-end
  • Bitcoin PSBT construction · direct mempool broadcast
Agentic AI & RAG Infrastructure
  • Google ADK · Vertex AI Reasoning Engine · MCP servers
  • Multi-agent orchestration · tool calls · context window management
  • RAG pipelines: chunking → embedding → vector index → reranking
  • Vector DBs (Pinecone, pgvector) · hybrid search · evals
  • Mem0 vector memory · LlamaIndex · Neo4j knowledge graphs
  • Text-to-SQL refinement · prompt engineering · cost-per-query tuning
Backend & DevOps
  • NestJS · FastAPI · TypeScript · Python
  • Kafka streaming · Redis · gRPC inter-service
  • PostgreSQL · Prisma · connection pool sizing
  • Docker · Kubernetes · Helm · rolling deploys
  • GCP Cloud Run · AWS (EC2/RDS/S3) · GitHub Actions CI/CD
  • OAuth2 · HashiCorp Vault · Turnkey Policy Engine · RBAC

The fundamentals, enforced.

Patterns I audit my own code against before anything ships. Each one has caught a real bug in production — this is the difference between code that runs and code that survives.

01

Algorithmic complexity

Hunt O(n²) and redundant passes — filter().includes(), nested loops, sort-then-slice. Reach for Map/Set lookups, partial sorts, and single-pass reductions. Profiling the loop before optimizing it.

02

Concurrency & backpressure

Kill sequential awaits that should be Promise.all / asyncio.gather. Bound parallelism with semaphores and pools. Replace sync I/O in async contexts. Backpressure every queue before it back-floods the producer.

03

Caching & invalidation

Memoize expensive computations, TTL every cache entry, evict LRU. Multi-level read path: in-memory → Redis → DB. SWR on the client, Cache-Control + ETag on the wire. Never cache time- or session-scoped data.

04

Error resilience

Timeouts on every external call (AbortController / client timeouts). Exponential backoff + jitter on transient failures. Circuit breakers around every dependency. Empty catch is a bug; graceful degradation beats hard failure.

05

Database & queries

Eager-load to kill N+1, SELECT only the columns you need, index the columns you filter and join on. Bulk operations (bulkCreate, executemany) over per-row writes. Connection pools sized to concurrency, never per-request.

06

Observability

Structured JSON logs with a correlation ID propagated end-to-end. No console.log in hot paths. Pre-aggregated metrics in loops. Distributed traces on every request. The question is never "is it slow?" — it's "where, for whom, since when?"

Three founding roles. One discipline.

Built backend infrastructure from scratch at a US payments startup, agentic AI at a Singapore AI lab, and enterprise-scale ML at Jio. Same patterns, different scale.

case 01 · founding engineer (blockchain & backend) Avvio
Nov 2025 — Present · Remote (US)
  • Designed and built the entire backend architecture from scratch — modular NestJS Service–Handler pattern with bounded contexts per chain domain (EVM, Solana, Bitcoin); stateless microservices behind an API gateway, horizontally scalable with zero shared mutable state across service boundaries.
  • Engineered gasless transaction infrastructure across EVM and Solana (Turnkey Gas Station, paymasters, Alchemy RPC, ethers.js, LI.FI); implemented idempotency keys and retry-with-jitter on all RPC calls — eliminating duplicate broadcasts and ensuring at-least-once delivery with deduplication at the handler layer.
  • Developed, tested, and deployed AvvioPaymentLinkV2 Solidity smart contract on Base L2 — dual escrow flows (Request & Send Links), keccak256 commit-reveal claim secrets, CREATE2 deterministic deployment via Hardhat, with OpenZeppelin ReentrancyGuard, Pausable, and SafeERC20.
  • Built @username transfer router that auto-selects the lowest-fee chain (EVM vs. Solana) for multi-chain USDC — and native Bitcoin module: PSBT construction, Turnkey signing, direct mempool broadcast with no bridge dependencies; implemented push notification / email / SMS backend for iOS and Android.
  • Integrated Bridge.xyz fiat on/off-ramp (ACH, SEPA, CLABE, PIX across USD/EUR/MXN/BRL/GBP) and Sumsub KYC with partner-agnostic PII architecture; deployed Turnkey embedded business wallets with multi-user org RBAC and on-chain spending-limit policies via Turnkey Policy Engine.
  • Deployed on AWS (EC2, RDS PostgreSQL, S3, Secrets Manager, CloudTrail); established GitHub Actions CI/CD with multi-stage Dockerfile, health-check endpoint, SSH tunnel auth, and PM2 process management; enforced secret rotation and zero plaintext credentials in runtime environment.
case 02 · founding engineer (senior AI & web3 backend) Qurios AI
Jan 2025 — Oct 2025 · Remote (Singapore)
  • Architected production agentic AI backend: multi-agent orchestration with Google ADK, MCP server, and Mem0 vector memory; deployed Vertex AI Reasoning Engine agents on GCP Cloud Run with horizontal autoscaling and graceful shutdown on SIGTERM — no cold-start latency spikes.
  • Designed multi-stage RAG retrieval pipelines (LlamaIndex, Pydantic, async ThreadPoolExecutor) with parallel LLM calls; cut API p95 latency 4× via asyncio parallelization, Firestore read caching with TTL invalidation, and connection pool sizing tuned to concurrency profile.
  • Built high-throughput NestJS microservices with Kafka consumer groups ingesting multimodal streams (Twitter, Telegram, YouTube, Substack, PDFs, audio) for automated AI personality creation; dead-letter queues for poison messages; CRON-based ETL and gRPC (BloomRPC) inter-service communication.
  • Integrated X402 protocol with Coinbase CDP Facilitator for on-chain micropayments; deployed Base MiniApp end-to-end with LlamaPay subscription streaming, webhook listeners, and Privy wallet auth; built Neo4j knowledge graphs with Pinecone vector embeddings for contextual retrieval and Text-to-SQL refinement models.
case 03 · devops & AI/ML engineer Jio Platforms Limited
May 2023 — Dec 2024 · Navi Mumbai, India
  • Architected production AI backend for Jio Brain — multi-agent orchestration with FastAPI, RAG pipelines (Pinecone vector memory + Neo4j knowledge graphs), and distributed anomaly detection at enterprise telecom scale; designed for horizontal scaling with stateless Cloud Run services and Kafka-backed event ingestion.
  • Built high-throughput Kafka ingestion microservices with consumer group offset management, CRON-based ETL pipelines, async Cloud Run batch jobs, and gRPC inter-service communication; implemented dead-letter queues for poison-message isolation and CRON reconciliation for idempotent re-processing.
  • Developed production RESTful APIs with OAuth2 authentication and HashiCorp Vault secret management; automated MLOps using Jenkins, Helm, and Kubernetes (rolling deployments, liveness/readiness probes, zero-downtime updates) for continuous model deployment pipelines.
  • Implemented distributed model training on GCP with TensorFlow Extended (TFX) and Kubeflow; applied Bayesian Optimization and Grid Search hyperparameter tuning; reduced API p95 latency 4× through async parallelization, Firestore caching, and targeted connection pool configuration.

Anatomy of a 36-module payments backend.

What founding-engineer work actually looks like under the hood. Four production systems where the design choice — not the code volume — is what carried the risk. Each tile names the constraint that drove it.

security boundary

Server-side wallet derivation

On-ramp destination addresses are always resolved from the internal Wallet table — never accepted from the client. Coinbase's own security guidance, enforced as a hard invariant across the onramp-aggregator and payment-links flows. Eliminates an entire class of "send-my-deposit-somewhere-else" attacks at the architecture level.

  • Wallet addresses read server-side from User → Wallet
  • Client never sends destination for any deposit flow
  • EVM / Solana / Bitcoin addresses derived from Turnkey sub-org accounts
on-chain safety

Paymaster: fee-payer only

The Solana gas sponsor signs transactions only after passing a paranoid validator: paymaster must sit at account index 0, no address lookup tables (they hide accounts), and no instruction may reference the paymaster key. Blocks every drain vector — SystemProgram.transfer, createAccount, SPL, CPI — without an instruction blocklist.

  • Fee-payer locked to account index 0
  • ALTs rejected (hidden account resolution)
  • Blocklist-free drain prevention via index invariant
resilience pattern

Fail-open aggregation

Multi-provider on-ramp quotes (Coinbase, MoonPay, Swapped) fetch in parallel, drop nulls silently, sort by feePct — cheapest wins. A provider that errors or is unsupported in the user's country is excluded, not fatal. Stablecoin fallback (USDC → USDT) when MoonPay can't sell the asset. Minimum-amount UX surfaces the floor instead of "not supported".

  • Parallel Promise.all across N providers
  • Fail-open: errors drop the provider, not the request
  • Commit-time token minting (5-min session never expires mid-quote)
distributed state

Self-healing reconciliation

Multi-chain USDC transfers fan out parallel Relay quotes per recipient chain, pick the cheapest, delete the losing row. A cron-driven TransferReconcilerService catches transfers the client stopped polling, queries chain RPC for finality, and converges state — exactly the pattern simulated live in the terminal above. Consolidation bridges fragmented balances across chains before the send, with a 1% partial-consolidation clamp.

  • Parallel quotes, cheapest-wins, losing rows deleted
  • Background reconciler cron for abandoned transfers
  • Fragmented-balance consolidation before high-value sends
36 NestJS modules shipped
3 chains · evm · solana · bitcoin
7 fiat rails · 5 currencies
335 unit tests · green build

Independent research & live deployments.

Side deployments

DEX Automation & Layer 2 Trading Systems

python · fastapi · hyperliquid · paradex

Engineered production DEX automation bots executing multi-wallet trading strategies, yield farming, and cross-chain arbitrage on Layer 2 with real-time price feeds, slippage protection, mempool monitoring, and MEV protection.

Agents.surf — AI Agent Discovery Platform

gcp cloud run · docker · full-stack

Architected and deployed an AI agent discovery platform with intelligent search indexing, agent categorization taxonomy, and real-time product feed ingestion; currently serving 60+ daily active users.

Education

M.S. Artificial Intelligence BITS Pilani Apr 2023 — Mar 2025 · India
B.E. Information Technology Pune University Jun 2019 — May 2023 · India

Open channels.

Available for technical evaluation, founding roles, and architecture reviews. Email is fastest; LinkedIn for the long-form context.

pre-engagement technical evaluation

No-risk technical trial.

Available to architect and ship one production-grade service, smart contract, or AI agent integration as a no-risk technical evaluation (1–2 weeks) before any formal commitment — zero obligation for the founding team. Live demonstration of execution speed and code quality on a real feature from your backlog, with production-grade system design end to end.

book a call →