You're talking about WURFL and Luca Passani. I recall working with it for a project 15 years ago.
I can't speak to how good the actual product is today (or even when it launched, but that's a whole 'nother story), but during development it was capable of processing 100K RPS in a footprint of ~30MB RAM with ~98% accuracy compared to WURFL as a baseline.
Those were not the good ol' days.
The key to WURFL was a massive XML file. That was constantly updated with the latest gizmos, and whatnot.