
RoboRoot (roboroot.in) is an electronics component marketplace. I shipped a production-ready AI Chat engine that goes beyond simple conversation to execute complex commercial actions. Users can now compile custom Bills of Materials (BOM), view live price-comparison tables, track shipments, and execute full checkouts directly from the chat interface.
Security Vulnerabilities: Allowing AI agents to trigger transactions, retrieve AWBs, and parse bulk uploads introduced severe vectors — prompt injection, cross-user data exposure, and spreadsheet formula injection.
Performance Bottlenecks: Resolving live catalog prices and stock states inside the RAG loop caused massive database query overhead.
Double Billing: Network latencies or rapid checkout button clicks in the chat window risked duplicate orders.
Built a pre-retrieval classifier that separates transactional actions from informational queries.
Wired strict prerequisites directly into the routing layer — verifying session authenticity, active tokens, and non-empty carts before initiating checkout flows.
Configured a centralized interceptor inside the tool dispatcher to automatically secure all downstream tool executions.
Refactored the context builder to query live database prices and stock counts dynamically at runtime.
Consolidated what were previously individual database reads into single, batched queries via Prisma, neutralizing the N+1 query problem.
Optimized the RAG retrieval pipeline using batched database lookups, completely eliminating N+1 bottlenecks to query stock and pricing details in real-time.
Developed a time-bucketed Redis locking mechanism using a SHA-256 hash of the userId and cartItems (5-minute window) to completely block duplicate orders.
Standardized state transitions for pending and failed checkouts, dynamically determining expirations (UNCONFIRMED_TIMEOUT) after 15 minutes have elapsed.
Integrated the checkout state machine with the platform's HMAC-SHA256 Razorpay webhook parser.
Built a raw value-only string parser that screens bulk CSV uploads, explicitly rejecting cell values prefixed with formula headers (=, +, -, @) or command commands.
Secured order tracking by masking AWBs and customer PII, enforcing strict ownership checks to deny cross-user lookup attempts.
Integrated Winston-based logging to audit state-changing tools while fully redacting card credentials and payment secrets.
Backend: Node.js, Express, TypeScript, Prisma ORM, PostgreSQL, Redis, Winston
Frontend: React, Next.js (App Router, Turbopack), Tailwind CSS, Framer Motion
Integrations: Zod Validation, Razorpay Payment Gateway, OpenAI GPT Tool Call APIs
Zero Double Billing: Time-bucketed Redis transaction locking eliminated duplicate checkout execution.
100% Secure File Uploads: Custom raw string parsing successfully blocked spreadsheet formula injections.
High Performance RAG: Consolidated database lookups minimized retrieval latency to flat constant-time query complexity.
Frictionless UX: Reduced checkout completion times from minutes to a 5-second in-chat checkout flow.
Interested in working together on a similar project?
Get in touchDesign & Developed by aspirant op
© 2026. All rights reserved.