Giampaolo Casolla, Steven Mi - From Query to Discovery: An AI Agent for Search @PyDataTV
Giampaolo Casolla, Steven Mi - From Query to Discovery: An AI Agent for Search  @PyDataTV
Uploaded November 2026 | Updated December 2026, 4 days ago
This talk presents battle-tested patterns from building and shipping an LLM-powered discovery system to production. The focus is on three practical problems every team faces when moving LLM features from prototype to production: managing latency and cost at scale, building evaluation infrastructure you can trust, and designing for graceful failure.

**Target audience**: ML/AI Engineers and Data Scientists shipping LLM-powered features to production. Intermediate level, familiarity with LLMs and Python assumed.

**Prior knowledge**: Basic understanding of LLM APIs, Python, and pytest.

**Key takeaways**:
- How to implement a dual-LLM tier strategy to balance cost, latency, and quality
- A deterministic evaluation approach (pass@k with pytest) that avoids LLM-as-judge flakiness
- Production hardening patterns: scope gating, graceful degradation, every stage optional

**Outline (30 min)**:

1. The problem: why natural language breaks traditional search (3 min)
- Live example: "sunset tours in Barcelona for a couple under 50 euros"
- Why keyword/semantic search can't handle filters, preferences, exclusions, and serendipity
- What's missing: reasoning, orchestration, conversational context

2. Architecture overview (5 min)
- Multi-stage LangGraph pipeline: ContextResolver, Interpreter, Parallel Retrieval, NanoFilter, Grading, Synthesizer
- Intent interpretation: concrete example of parsing natural language into structured intent
- Routing logic: SIMPLE/DEEP/FILTERED paths based on query complexity

3. Dual-LLM tier strategy (5 min)
- The problem: one model doesn't fit all stages
- Tier mapping: which model for which stage and why
- Results: 60% latency reduction, 4x cost savings, nano-tier recall 0.9 / precision 0.7

4. Production hardening (3 min)
- Scope gating: reject non-travel queries early
- Graceful degradation: partial results are better than no results
- Every stage is optional: the pipeline adapts when components fail

5. Evaluation infrastructure (10 min)
- Why not LLM-as-judge: non-deterministic evals in CI produce flaky tests, flaky tests kill trust
- pass@k approach: run each test case k=3 times via pytest-rerunfailures, pass if any succeeds
- 816 tests, 21 custom metrics, 4 datasets, 32 parallel workers, 0 LLM-as-judge calls in CI
- Real regression story: date inference change broke text extraction, caught before shipping

6. Key lessons and Q&A (4 min)
- Right model per stage, deterministic evals over LLM-as-judge, graceful degradation by design, invest in eval infrastructure early.

pydata.org

PyData is an educational program of NumFOCUS, a 501(c)3 non-profit organization in the United States. PyData provides a forum for the international community of users and developers of data analysis tools to share ideas and learn from each other. The global PyData network promotes discussion of best practices, new approaches, and emerging technologies for data management, processing, analytics, and visualization. PyData communities approach data science using many languages, including (but not limited to) Python, Julia, and R.

PyData conferences aim to be accessible and community-driven, with novice to advanced level presentations. PyData tutorials and talks bring attendees the latest project features along with cutting-edge use cases.

00:00 Welcome!
00:10 Help us add time stamps or captions to this video! See the description for details.

Want to help add timestamps to our YouTube videos to help with discoverability? Find out more here: github.com/numfocus/YouTubeVideoTimestamps
Giampaolo Casolla, Steven Mi - From Query to Discovery: An AI Agent for SearchStart Small - Katrina Riehls advice to new members of the community | Give Me 5 S3E4Opening Day 1 - PyData & PyCon Yerevan 2026Pauline van Nies - LLMs and Puzzle Agents Solving Cryptic CrosswordsComing tomorrow: Episode 4 of Give Me 5 Season 3, featuring Katrina Riehl!From Struggling to Mastery: A Practical Guide to Data Pipeline Operations [PyCon DE & PyData 2026]PyTorch and CPU-GPU Synchronizations [PyCon DE & PyData 2026]Airflow for Geospatial Pipelines | Kevin LaiBuilding an AI Delivery Robot in PythonLin Jia & Kexin Fei - The A_B Testing Blind Spot_ Solving the Opt-In Paradox with Causal InferenceKumar, Mustafina, & Vriends Systems for Scale: Architecting a Nationwide Energy Forecasting PlatformEverything That Happens to Data Before Model Input During Training
PyData |

Giampaolo Casolla, Steven Mi - From Query to Discovery: An AI Agent for Search

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER