<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/increase-recommendation-systems-precision-with-llms-using-python-6ycam6qjc" -->

---
title: Increase Recommendation Systems’ Precision with LLMs,...
description: A two-stage recommendation system design that combines a cheap rule-based candidate filter with LLM-powered reranking. Stage 1 uses geographic distance...
canonical: https://daily.dev/posts/increase-recommendation-systems-precision-with-llms-using-python-6ycam6qjc
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Increase Recommendation Systems’ Precision with LLMs, Using Python | daily.dev
og:description: A two-stage recommendation system design that combines a cheap rule-based candidate filter with LLM-powered reranking. Stage 1 uses geographic distance...
og:url: https://daily.dev/posts/increase-recommendation-systems-precision-with-llms-using-python-6ycam6qjc
og:image: https://api.daily.dev/og/posts/6ycAm6QJC.png
og:image:alt: Increase Recommendation Systems’ Precision with LLMs, Using Python
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Increase Recommendation Systems’ Precision with LLMs, Using Python

**[Towards Data Science](https://daily.dev/sources/tds)** · 10 min read · 0 upvotes · 0 comments

## Summary

A two-stage recommendation system design that combines a cheap rule-based candidate filter with LLM-powered reranking. Stage 1 uses geographic distance filtering to narrow 10,000 restaurants down to 50 nearby candidates without any API calls. Stage 2 feeds those 50 candidates to an OpenAI LLM that reranks them based on the user's natural language query, returning the best 5–10 matches with fit scores and explanations. Structured outputs are enforced via Pydantic. The approach balances cost and intelligence by limiting LLM usage to a small, pre-filtered candidate set.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://towardsdatascience.com/increase-recommendation-systems-precision-with-llm-using-python>

## Similar posts on daily.dev

- [Our Early Journey to Transform Instacart’s Discovery Recommendations with LLMs](https://daily.dev/posts/our-early-journey-to-transform-instacart-s-discovery-recommendations-with-llms-wpv1ryxzx) · Instacart · 1 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#llm](https://daily.dev/tags/llm), [#openai](https://daily.dev/tags/openai), [#recommendation-systems](https://daily.dev/tags/recommendation-systems), [#pydantic](https://daily.dev/tags/pydantic)

[View this post on daily.dev](https://daily.dev/posts/increase-recommendation-systems-precision-with-llms-using-python-6ycam6qjc)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Increase Recommendation Systems’ Precision with LLMs, Using Python","url":"https://daily.dev/posts/increase-recommendation-systems-precision-with-llms-using-python-6ycam6qjc","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/increase-recommendation-systems-precision-with-llms-using-python-6ycam6qjc"},"datePublished":"2026-06-08T19:04:04.010Z","dateModified":"2026-06-08T19:23:52.369Z","description":"A two-stage recommendation system design that combines a cheap rule-based candidate filter with LLM-powered reranking. Stage 1 uses geographic distance...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e437dcd9624247e5d008204c04f99797?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e437dcd9624247e5d008204c04f99797?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Towards Data Science","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Towards Data Science","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/tds","url":"https://daily.dev/sources/tds"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/increase-recommendation-systems-precision-with-llms-using-python-6ycam6qjc","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,llm,openai,recommendation-systems,pydantic","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Towards Data Science","item":"https://daily.dev/sources/tds"},{"@type":"ListItem","position":3,"name":"Increase Recommendation Systems’ Precision with LLMs, Using Python"}]}
```

