Integrations
Menu search integrations for your search stack
You probably already run a search engine. These recipes show how to make it understand food by adding Latimal to the stack you have: Elasticsearch, OpenSearch, Algolia, Typesense, Postgres with pgvector, Qdrant or Pinecone.
Each page is a self-contained Python recipe. Your code calls the Latimal API and writes the results into your own engine, so you keep your existing infrastructure, ranking rules and front end.
Integration patterns
1. Vector retrieval with Latimal vectors in your own store
Embed every menu item once with /embed/batch, store the vectors next to the item, and embed each query with /embed at search time. Your vector store does the nearest-neighbor lookup. This is the pattern for large catalogs, because retrieval runs entirely inside your infrastructure and Latimal is only called once per query.
Read the vector size from the first response (len(vector)) and create your index or table from it. If you pass a dimension to /embed, use the same one for items and queries.
Used in: Elasticsearch and OpenSearch, Typesense, pgvector, Qdrant, Pinecone.
2. Hybrid keyword and semantic search
Keyword matching is still great at exact dish names and SKUs. Run it alongside vector retrieval and fuse the two rankings, and you get the best of both: an exact query for "Tacos al Pastor" gets a strong keyword match, while "pastor tacos", "taco al pastor" and "spicy pork tacos" can still find it on the vector side.
Used in: Elasticsearch and OpenSearch (BM25 plus kNN), Typesense (rank fusion), pgvector (full-text plus vector with reciprocal rank fusion).
3. Calling /search directly
/search takes a query and up to 512 menu items and returns them ranked, with weak tail matches filtered out. Use it two ways:
- Per-restaurant search. A single restaurant's menu fits in one call, so you can search it without storing vectors at all.
- Reranking. Retrieve 50 to 200 candidates from your engine, then let
/searchset the final order.
Used in: Algolia, Qdrant, Pinecone. See the Search integration guide for the standalone version.
4. Cuisine facets from /classify at index time
Call /classify when you index an item and store the cuisine label as a filterable field. Every engine in this section can then facet and filter on it, even when restaurants never tagged their own dishes. Beverages, bakery and desserts get their own labels, so the same field also separates drinks and sweets from mains.
curl -X POST https://dish-embed.latimal.com/classify \
-H "X-API-Key: $LATIMAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"items": ["Tom Yum Goong", "Tacos al Pastor", "Croissant", "Flat White"]}'Used in: every recipe.
5. Dish matching with /match
/match tells you whether two names are the same dish, across spellings and languages, and flags dietary and protein conflicts. In a search stack that's useful for generating synonym lists you can trust and for linking the same dish across restaurants for price comparison.
Used in: Algolia (synonym generation).
Recipes
- 01Elasticsearch and OpenSearchHybrid BM25 plus kNN with cuisine facets
- 02AlgoliaFood-aware reranking, cuisine facets and cross-language synonyms on top of your Algolia index
- 03TypesenseHybrid search with rank fusion and cuisine facets
- 04Postgres pgvector and SupabaseSemantic and hybrid search in SQL
- 05QdrantFiltered vector search, facet counts and reranking
- 06PineconeManaged vector search with metadata filters and reranking
Keeping things fresh
Every recipe uses the same sync approach. Store a hash of each item's name alongside it. When a menu changes, compare hashes: only new or renamed items go back through Latimal, price updates are plain partial updates, and removed dishes are deleted. One HTTP request counts as one API call no matter how many items it carries, so re-enriching a batch of 5,000 items costs one embedding call plus ten classification calls.