Giter VIP home page Giter VIP logo

culefilo's Introduction

Cule Filo - AI-powered restaurant search engine

Discover the top 3 restaurants serving your favorite food near you. Just enter your craving and location in our free AI-powered app, and start your culinary adventure today!. Our submittion to the Cloudflare AI Challenge.

Demo: https://cule-filo.pages.dev

Screen.Recording.2024-04-13.at.18.09.12.mov

Team: @sjdonado @gjhernandez @krthr

Features

  1. Search your favorite meal Screenshot 2024-04-13 at 17 23 33

  2. Real time search logs Screenshot 2024-04-13 at 17 11 58 Screenshot 2024-04-13 at 17 12 59

  3. See and share your results

Screenshot 2024-04-13 at 17 13 41

Design

graph TD
    A[Start] --> B{Job state?}
    B -->|Created| C[Update job state to Running]
    B -->|Running or Finished| D[Return encoded message]
    C --> E[Search for places with original query]
    E --> F{Number of places found?}
    F -->|Less than 3| G[Generate suggestions list - llama-2-13b-chat-awq]
    F -->|3 or more| H[Enhancing results]
    G --> I{Number of suggestions?}
    I -->|Greater than 0| J[Search for places with suggestions]
    I -->|0| K[Log error]
    J --> L{Number of places found?}
    L -->|Less than 3| G
    L -->|3 or more| H
    H --> M[Fetch place reviews]
    H --> N[Fetch place photos]
    M --> O[Summarizing reviews - bart-large-cnn]
    N --> P[Photos to text - uform-gen2-qwen-500m]
    P --> Q[Choose thumbnails - llama-2-13b-chat-awq]
    Q ---> R[Collecting results]
    O ---> R
    R --> S[Update job state to Success]
    S --> T[Return encoded message]
    K --> H

Functional requirements

  • Search Results Relevance: The application should return at least one result that is relevant to the user's search query.
  • Place Descriptions Based on Reviews: The application should generate descriptions for each place based on the available user reviews. These descriptions should provide a concise and informative summary of the place's characteristics and user experiences.
  • Contextually Relevant Image Selection: The application should select and display an image for each place that is contextually relevant to the user's search query. This image should accurately represent the place and enhance the user's understanding of the search results.
  • Search History: The application should maintain a history of the user's previous searches. This feature allows users to easily access and revisit their past searches, enhancing the overall user experience.

Non Functional requirements

  • Request Completion Time: The application should strive to complete search requests within an average time of 30 seconds or less. This ensures a smooth and responsive user experience, minimizing waiting times for search results.
  • Intuitive, Minimalist, and Responsive UI/UX: The user interface and user experience should be designed to be intuitive, minimalist, and responsive. The application should provide a clean and clutter-free interface that is easy to navigate and understand. It should also be responsive, adapting seamlessly to different screen sizes and devices.
  • Search History Storage in Key-Value Store: The application should store the user's search history in a key-value (KV) store. This allows for efficient retrieval and management of search history data, ensuring fast access to previous searches.

Local setup

  1. Configure secrets .dev.vars
PLACES_API_KEY={PLACES_API_KEY}
AUTOCOMPLETE_API_KEY={AUTOCOMPLETE_API_KEY}
  1. Install dependencies
npm install
  1. Build with Vite + run bindings with Wrangler:
npm run preview

Deployment

  1. Create a Cloudflare account
  2. Create an application under 'Workers & Pages'
  3. Checkout the master branch
  4. Create KV namespace binding: CULEFILO_KV
  5. Enable Workers AI Bindings: AI
  6. Run npm run deploy

culefilo's People

Contributors

sjdonado avatar gjhernandez avatar

Stargazers

Enrique Niebles avatar John Fontalvo avatar Alfonso Manuel avatar  avatar Wilson avatar

Watchers

Wilson avatar  avatar  avatar

culefilo's Issues

history page

get all records from context.cloudflare.env.CULEFILO_KV.list and iterate the list <PlaceCard />

show messages per state

tentative: refactor in_progress with running

state in_progress -> calls to google maps, e.g: looking for places with a similar plate, looking for ...

[Bug] Inconsistent info shown on saved searches - "Open now" when restaurant is already closed

image

Other inconsistencies that derive from this edge case:

  • Rating changed since the search (Maybe irrelevant, as this might not change drastically for most places).
  • Restaurant closed permanently since search.

Possible solutions:

  • Add a timestamp to the search result page and a note to the validity of the data.
  • Persist the actual opening times and compare against them to calculate openNow, instead of persisting openNow.
  • Refetch dynamic data for each of the results: OpenNow, Ratings, Check for permanently closed.

Other Ideas:

  • Add open /closed badges with color codes (green/red).
  • In case some of the top 3 results are closed or permanently closed, we could still persist 6 results and show some of the last 3 results in replacement of the top 3 that are not available. Those which are currently/permanently unavailable can be still shown, but grayed out/shown with lower opacity.

loading bar and toggle search logs button

send SSE messages in an special format $UNIX_TIME,$PERCENTAGE,$MESSAGE. for example
1712561929762,0.2,Looking for nearby places with...
1712561960576,0.4,Looking for suggestions...

this in order to show:

  • loading bar
  • button to toggle the search logs
  • store logs in the KV record

Roadmap

Design

  1. User input: name of your favorite meal (text), post code (text)

  2. Zip/Postal Code Lookup -> extract country, city/place name, latitude, longitude https://data.opendatasoft.com/explore/dataset/geonames-postal-code%40public/table/?q=080001

  3. [text-generation]: LLM prompts:

"Other names for {favorite meal} in {country}?"
"From where is originally {favorite meal}?"

---

"what's the cousine of {favorite meal}?"
"Is {favorite meal} vegetarian, vegan, gluten-free, lactose-free?"

first search: bandeja paisa + location bias -> 6 results ? OK
(no results above?) -> second search: "From where is originally {favorite meal}?" -> 6 results ? OK
third search: "what's the cousine of {favorite meal}?" -> 6 results ? OK
final search: "Is {favorite meal} vegetarian, vegan, gluten-free, lactose-free?" -> 6 results ? OK

Google places API text search with data from (3) https://developers.google.com/maps/documentation/places/web-service/text-search, locationBias with data from (2)

  1. From (3) from 6 results -> lookup reviews / overall rating. Ranking

  2. [summarization]: short description of the place based on the most relevant reviews

  3. Return Top 3 results from (5) and explanation message (6)

To be discussed

  1. which LLM performs best?

Tentative

v0.0.0

  • Happy path -> simple search (only text for now)
  • history search page
  • show search process messages
  • responsive design

v0.1.0

  • Results thumbnail
  • post code autocomplete

v1.0.0

  • search filters optional select field: filter by meal type (breakfast, lunch, dinner)
  • search filters currentOpeningHours, priceLevel
  • choose number of results (max 6)
  • sync history search (like duckduckgo, no account)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.