Research · FastAPI · Machine Learning April 2025

Full-Stack Math
Information Retrieval

Production-grade FastAPI system searching mathematical formulas across the 155GB NTCIR-12 academic dataset (8.3M files, 60M+ formulas). Combining vectorized Hamming distance clustering, private Backblaze B2 streaming, and a compiled Flutter interface with MathJax. MAP 0.7475 · 20ms query latency · 65x NumPy speedups.

155GB
NTCIR-12 Dataset Size
65.5x
Hamming Distance Speedup
20ms
Average Query Latency
0.7475
Mean Average Precision (MAP)
FastAPI Python 3 NumPy Vectorization SQLite Indexing Backblaze B2 MathML & LaTeX MiniBatchKMeans Flutter Web Android WebView MathJax Renderer

Mathematical Search is Structurally Different

Standard text search engines like Elasticsearch or Google rely on keyword tokenization. But mathematics has tree-like structures. Equations are operators, variables, functions, and spatial relationships that linear text search completely ignores. Searching for "x² + y²" should match Pythagorean theorem and Euclidean distance formulas, bypassing syntactic differences in writing notation. Doing this at the scale of millions of documents with sub-second latencies requires custom mathematical indexing and indexing vectorization.

🔢
Structural Search Complexity
Mathematical formulae have tree-like parse structures (operator trees). Traditional indexing is blind to math operator structures, requiring LaTeX → MathML conversion and tree encoding.
📦
155GB Dataset Scale
The NTCIR-12 dataset spans 8.3M academic files and 60M+ formulas. Computing similarities across this volume using traditional loops or standard databases causes major bottlenecks.
🔒
CORS and CDN Proxy Blocks
Production hosting on Hugging Face Spaces blocked external requests on non-root paths and generated CORS errors when attempting to load resources from Backblaze B2.
📱
Cross-Platform Render Bug
Ensuring sharp mathematical rendering of LaTeX equations in dynamically loaded pages on Android WebView and standard desktop browser iframes without introducing compilation errors.