Q4 Inc. builds a RAG and SQL generation Q&A chatbot on Amazon Bedrock for investor relations data
Investor Relations Officers at Q4's customers needed an intuitive, fast way to query diverse financial datasets including CRM, ownership records, and stock market data via natural language, but standard LLM approaches — pre-training, fine-tuning, and RAG with embeddings — all produced suboptimal or prohibitively expensive results for numerical and structured financial data.
The SQL generation approach satisfied all functional and non-functional requirements: Q4 was satisfied with the SQL quality for both simple and complex queries, and the end-to-end latency came within the acceptable range of single-digit seconds.
Pre-training was resource-intensive and cost-prohibitive, requiring continuous incremental training as new time-series data arrived. Fine-tuning showed initial success but suffered from model hallucination on nuanced queries. RAG with semantic search and embeddings was suboptimal for numerical data because embeddings from numbers struggled with similarity ranking and returned incorrect information.