DEV Community

Cover image for Dask : Search through 2943 DSA problem using natural language
Rajnish Raj
Rajnish Raj

Posted on

Dask : Search through 2943 DSA problem using natural language

Algolia MCP Server Challenge: Ultimate user Experience

This is a submission for the Algolia MCP Server Challenge

What I Built

I built an AI-powered search engine that search through a database of about 3,000 DSA problems using natural language queries. Used Gemini API for AI responses and Algolia JavaScript API for fast, relevant search results.

Features

  • Search with a natural language query, not keywords
  • automatic filter selection from query.

Demo

Live - https://dask-omega.vercel.app/
Github - https://github.com/Rajnish8292/dask

How I Utilized the Algolia MCP Server

Algolia helps to filter search results based on facets and facetFilter and provide fast result.

Key Takeaways

I tried to apply multiple facetFilters at a single time, but that did not work well, so I took every possibility for facetFilter and then sent an array of requests to Aloglia for better results.
E.g

// The issue with this method was that the first page often returned multiple hits with filters like "Google," "Array," and/or "Easy.
facetFilters = [['google', 'zomato'], ['array', 'graph'], ['easy', hard]]

// To overcome this problem, I break a single request into multiple requests
facetFilterArray = [
   [['google'], ['array'], ['easy']],
   [['google'], ['graph'], ['easy']],
   [['google'], ['array'], ['hard']],
   [['google'], ['graph'], ['hard']],
   [['Zomato'], ['array'], ['easy']],
   [['Zomato'], ['graph'], ['easy']],
   [['Zomato'], ['array'], ['hard']],
   [['Zomato'], ['graph'], ['hard']],
]

Enter fullscreen mode Exit fullscreen mode

Top comments (0)