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.
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.
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.
Frequently asked questions
What did this team achieve with this AI workflow?
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 ra…
What tools did this team use?
Amazon Bedrock, LangChain, SQLDatabaseChain, Claude V2, Claude Instant, Titan Text Express.
What results were reported?
End-to-end query response latency: single-digit seconds (source-reported, not independently verified).
What failed first in this deployment?
Pre-training was resource-intensive and cost-prohibitive, requiring continuous incremental training as new time-series data arrived.
How is this finance ops AI workflow structured?
User question received → SQL generation via LLM → SQL query run against database → LLM summarization of results → Answer delivered to user.