During the frenzy of this year’s World Cup, software developer and entrepreneur Vijey set out to build a real-time sports analytics chatbot named Rune Score. From the perspective of an everyday user interacting with the interface, Rune Score appears to be a straightforward conversational agent designed to deliver match statistics, updates, and tactical breakdowns on demand. Beneath the user-facing simplicity, however, lies a complex distributed system engineered to tackle the rigorous operational hurdles of modern artificial intelligence deployment.
The application must seamlessly manage the perpetual freshness of fast-moving sports data, process unpredictable user rephrasing, recover gracefully from data extraction failures, control soaring large language model (LLM) API costs, support streaming responses, maintain conversation memory, execute fallback protocols, and secure the underlying architecture. According to the developer, the hard-earned lessons encountered while architecting Rune Score extend far beyond sports analytics, offering a blueprint for nearly any AI product striving to remain fast, cost-effective, and accurate simultaneously.
Before diving deeper into the architectural evolution of the system, it is helpful to examine two core technologies that drove the project’s infrastructure: Redis and Retrieval-Augmented Generation, commonly known as RAG. While neither tool is a universal household name, both play foundational roles in modern AI engineering stacks. Redis is widely recognized as an open-source, in-memory data structure store functioning variously as a database, cache, message broker, and streaming engine. In the context of AI applications, Redis is most frequently deployed as a lightning-fast caching layer designed to store one exact answer under one exact label.
On the other side of the architectural spectrum, Retrieval-Augmented Generation—defined by Amazon Web Services as a technique used to augment a large language model with external data such as corporate internal documents—operates on a fundamentally different principle. Instead of attempting to match an exact label or string of characters, RAG searches through a broader knowledge base by evaluating semantic meaning rather than relying on exact wording. In practical terms, Redis is exceptionally precise and inexpensive to operate, but it remains rigid in its requirements. RAG, meanwhile, offers superior flexibility and durability, though it typically demands higher computational resources and operating costs to run efficiently.
Why the Project Didn’t Start with RAG
When the development of Rune Score began, the immediate priority was not implementing a sophisticated vector database or an advanced RAG pipeline. Instead, the first architectural move was deploying a simple Redis cache structured around a strict labeling rule: identical user requests were mapped to an identical key, such as a specific football fixture like Argentina versus Spain.
The financial and computational savings delivered by this straightforward approach were immediate and substantial. As documented in a technical retrospective shared on LinkedIn regarding Rune Score, the performance differential was staggering. Without an active cache in place, a fresh data extraction followed by an LLM analysis could easily consume up to 23,000 input tokens, encompassing scraped content, contextual background, and conversation history. By introducing a cache capable of handling identical key hits, that token count plummeted to approximately 5,000 tokens. This represented a dramatic 4.5-fold reduction in consumption across the single most expensive component of the entire processing pipeline.
In the broader economics of software development, artificial intelligence costs are typically driven by redundant processing. When multiple users submit the exact same query within a reasonable time window, rerunning a full, resource-intensive pipeline for every single inquiry represents an unnecessary expenditure of capital. Caching exact matches provides an immediate financial buffer, protecting developers from runaway API bills during high-traffic events.
Where Redis Breaks Down in Production
Despite its efficiency with identical queries, Redis encounters severe limitations when exposed to real-world human behavior. People rarely communicate using rigid, standardized labels. A sports fan might ask about a match using the formal pairing "FC Barcelona vs Real Madrid," or they might phrase the exact same inquiry casually as "Barça – Madrid," or simply ask about the Spanish clásico.
A strict Redis cache treats each of these linguistic variants as an entirely unique and unrelated request. Consequently, the system suffers from duplicated computational work, misses pre-existing answers that are already stored in the system, and is forced to needlessly rerun the entire expensive processing pipeline simply because the user’s phrasing failed to yield an exact string match.
This inherent limitation is precisely where Retrieval-Augmented Generation earns its place in a production architecture, largely driven by a mathematical concept known as embeddings. According to documentation provided by Google Cloud, the closer objects are positioned within an embedding space, the greater their semantic similarity, while wider distances indicate greater semantic dissimilarity.
Expressed in plain language, a knowledge base constructed using vector embeddings can successfully retrieve a historical answer even when a user submits a query worded completely differently from the original prompt. By searching based on conceptual meaning rather than rigid keyword matching, RAG bridges the gap between unpredictable human communication and structured data retrieval.
The Bottleneck That Breaks Output Quality
Regardless of whether a developer implements basic caching or advanced vector retrieval, a foundational engineering lesson emerged from the development of Rune Score: the single biggest quality bottleneck in an information retrieval pipeline is rarely the retrieval technology itself. Instead, it is determined entirely by the quality of the information fed into the system.
This dynamic reflects the classic computer science principle known as "garbage in, garbage out," or GIGO, which posits that the quality of any system’s output is fundamentally dictated by the quality of its input. Throughout the construction of the Rune Score pipeline, every instance where shortcuts were taken during the content extraction phase resulted in a visibly degraded analysis downstream.
The same underlying logic applies directly to how relevance is evaluated and ranked. Relying on a single relevance score or retrieval signal is inherently fragile in a production environment. Highlighting this reality, engineering documentation from Redis notes that combining multiple distinct retrievers consistently surfaces more relevant results in top search positions than relying on any single method in isolation. By combining exact keyword matches, meaning-based vector searches, and temporal freshness signals into a unified ranking system, developers can achieve significantly better accuracy than any single-signal approach can provide.
Balancing RAG Costs and Long-Term Value
During ongoing experimentation with Rune Score, integrating a RAG-based retrieval hit successfully brought down request token consumption from 20,000 down to 8,000 tokens—representing a 60 percent reduction. While this efficiency gain falls short of the 80 percent reduction achieved by an exact Redis cache hit, rendering it slightly more expensive and marginally slower, that performance gap does not diminish the strategic value of RAG.
What RAG purchases in exchange for its higher operational cost is robust tolerance for the natural variability of human speech, persistent memory that outlives the strict expiration windows of a traditional cache, and an extensible architecture capable of serving use cases far beyond the scope of a single application. Redis and RAG should not be viewed as mutually exclusive, competing choices, but rather as sequential tools in a modern AI engineering toolkit. The most effective architectural refactor is not necessarily the most theoretically complex one, but rather the approach that allows engineers to validate performance against real-world metrics and roll back changes swiftly if expectations are not met. Building a fast, inexpensive cache first helps developers learn what users actually demand, paving the way for targeted investments in retrieval systems only where rigid caches fall short.
