A GenAI supply chain query assistant gives teams natural-language access to validated traceability data with safe SQL guardrails on AWS.

In short
Executive Summary
A food traceability platform held rich product, inventory, location and event data behind GraphQL APIs that business users could not query without technical support. Rapyder built a GenAI supply chain query assistant on AWS that converts natural-language questions into GraphQL, stores validated results for follow-up analysis and restricts generated SQL to safe SELECT statements. The business transformation gave operations teams direct, conversational access to traceability intelligence while reducing repeated API calls and technical-team dependency.
About Customer
The customer is an AI-powered Traceability-as-a-Service platform that helps food businesses follow products across the supply chain. Its technology combines AI, QR-code tracking and immutable data to support authenticity, regulatory compliance and sustainability.
Problem Statement
Product, location, inventory and traceability data was available through GraphQL APIs, but business users depended on technical teams to retrieve it. They needed a safe way to ask natural-language questions, explore follow-up queries and receive grounded answers without exposing the platform to unsafe generated operations.
Business Challenges
The customer managed large volumes of supply chain data across products, locations, inventory transactions, event definitions, and traceability records, but retrieving insights manually from GraphQL APIs was time-consuming and required technical knowledge.
Operational business users had no way to ask questions in natural language and get answers without depending on technical teams to write and run queries.
The system needed to understand business questions, generate valid GraphQL queries, retrieve accurate supply chain data, and support follow-up questions – not just single one-off lookups.
Summarizing large supply chain datasets carried a risk of AI hallucination if results were passed directly to the language model without validation.
Solution Implemented
Built a serverless AWS-based generative AI query platform where customer application requests are routed through Amazon API Gateway’s /query endpoint, receiving natural language queries along with session information, authorization details, owning GLN, and optional date filters.
Used AWS Lambda as the central orchestration layer to validate requests, resolve date ranges, identify session context, invoke Bedrock, execute GraphQL queries, store results in RDS, and return the final response.
Used Amazon Bedrock’s Claude Sonnet model to analyze each user query and generate the appropriate GraphQL operation, endpoint target, filters, arguments, and query body based on the customer’s supply chain schema.
Executed the generated GraphQL queries against the customer’s GraphQL or AppSync endpoint to retrieve product master data, locations, event definitions, traceability events, inventory transactions, stock quantities, and dashboard metrics.
Flattened and stored retrieved GraphQL responses in Amazon RDS tables, enabling follow-up questions to be answered using validated SQL over stored session data, reducing repeated API calls and token usage.
Secured database credentials with AWS Secrets Manager, and used Amazon CloudWatch to capture Lambda and API logs, with CloudTrail providing audit visibility across AWS service activities.
Applied guardrails restricting model-generated SQL for follow-up queries to validated SELECT statements only, blocking unsafe SQL operations before execution.

Technology Stack
- Amazon API Gateway
- AWS Lambda
- Amazon RDS
- Amazon Bedrock (Claude Sonnet)
- Amazon CloudWatch
- AWS CloudTrail
- AWS Secrets Manager
Business Benefits
- Faster supply chain insights – The chatbot lets users retrieve product, location, inventory, and traceability information using natural language, reducing manual effort and dependency on technical teams.
- Improved operational decision-making – AI-generated summaries help business users quickly understand product journeys, stock availability, transaction patterns, and event-level details.
- Context-aware follow-up responses – RDS-based session storage lets the system answer follow-up questions from previously retrieved data, improving response speed and consistency.
- Scalable and secure serverless architecture – API Gateway, Lambda, Bedrock, RDS, and Secrets Manager together provide a scalable, secure, and maintainable architecture with centralized logging and monitoring.
Key Takeaways
Ready to turn supply-chain data into decisions your operations team can access directly?
about transforming traceability data into safe, conversational intelligence on AWS.
Frequently Asked Questions
Retrieving insights from GraphQL APIs across products, locations, inventory, and traceability records was time-consuming and required technical knowledge, so operational business users needed a way to ask questions in natural language instead.
A user's question is routed through Amazon API Gateway to a Lambda orchestrator, which invokes Amazon Bedrock's Claude Sonnet model to translate the question into a valid GraphQL query, executes it against the supply chain data, and returns a business-friendly summary.
GraphQL responses are flattened and stored in Amazon RDS, allowing follow-up questions to be answered using validated SQL over the stored session data instead of repeating large API calls or re-sending data to the language model.
Rather than summarizing raw, unvalidated data directly, results are flattened into RDS and processed through SQL-based follow-up queries wherever applicable, and only validated SELECT statements are permitted for any model-generated SQL.
AWS Secrets Manager securely manages database credentials, Amazon CloudWatch captures Lambda and API logs, and AWS CloudTrail provides audit visibility across all AWS service activity.