Skip to main content

Domain-agnostic semantic query suggestion engine

Project description

🚀 Suggestify — AI Query Suggestion Engine

Suggestify intelligently generates search query recommendations using NLP. Works with or without a database — fully plug & play. It can be used for any domain—technology, food, healthcare, geography, science, entertainment, and more.


🔥 Features

Feature Supported
Semantic AI suggestions
Works without DB
Fuzzy matching
Django + FastAPI + Flask adapters
SQL / CSV history intake

AI-Only Mode: Generate realistic query suggestions without any dataset.

Dataset Mode: Works with CSV, SQLite, or Python lists for enriched semantic + fuzzy search.

Semantic + Fuzzy Matching: Powered by sentence-transformers and rapidfuzz.

Dynamic Query Generation: Produces natural queries instead of simple completions.

Domain-Agnostic: Works with any topic or dataset.

Entity Extraction (spaCy): For even richer, contextual suggestions.

🚀 Installation

pip install suggestify

python -m spacy download en_core_web_sm

🔗 Backend Integration

FastAPI

from fastapi import FastAPI
from suggestify import QuerySuggester

app = FastAPI()
suggester = QuerySuggester()
# or
suggester = QuerySuggester(data_source=your data_source)

@app.get("/suggest/")
def suggest(query: str):
    return {"suggestions": suggester.suggest(query, top_k=5)} # top_k - the number of suggestions you want to return.

Django REST Framework

views.py

from rest_framework.decorators import api_view
from rest_framework.response import Response
from suggestify import QuerySuggester

suggester = QuerySuggester()
# or
suggester = QuerySuggester(data_source=your data_source)

@api_view(['GET'])
def suggest_query(request):
    query = request.GET.get('query', '')
    return Response({"suggestions": suggester.suggest(query, top_k=5)}) # top_k - the number of suggestions you want to return.

urls.py

from django.urls import path
from .views import suggest_query

urlpatterns = [
    path("suggest/", suggest_query),
]

⚛ Frontend Example (React)

import { useState } from "react";

export default function SuggestionApp() {
  const [query, setQuery] = useState("");
  const [suggestions, setSuggestions] = useState([]);

  async function fetchSuggestions() {
    const res = await fetch(`/suggest/?query=${query}`);
    const data = await res.json();
    setSuggestions(data.suggestions);
  }

  return (
    <div>
      <input
        type="text"
        value={query}
        onChange={(e) => setQuery(e.target.value)}
        placeholder="Type your query..."
      />
      <button onClick={fetchSuggestions}>Get Suggestions</button>
      <ul>
        {suggestions.map((s, i) => (
          <li key={i}>{s}</li>
        ))}
      </ul>
    </div>
  );
}

📊 How It Works

AI-only mode: Generates suggestions using NLP patterns, entity extraction, and dynamic templates.

Dataset mode:

Encodes dataset entries using sentence-transformers

Performs semantic search

Adds fuzzy matching for typos

Blends results into natural-language queries

Dynamic query generation: Uses entity extraction + flexible template generation to craft realistic, domain-appropriate suggestions.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

suggestify-0.1.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

suggestify-0.1.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file suggestify-0.1.1.tar.gz.

File metadata

  • Download URL: suggestify-0.1.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for suggestify-0.1.1.tar.gz
Algorithm Hash digest
SHA256 167314583ae12b54995b70775b56eccf86a2115342b7ba35c0c277b0cbbf3d0a
MD5 c08bb4309cac238ee98eb9e807af71a3
BLAKE2b-256 77f01eb73043d27e1e2cd9db1206b01100e8da790458032c356e4ecbb37c6232

See more details on using hashes here.

File details

Details for the file suggestify-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: suggestify-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for suggestify-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d6466c2a5ce3cc6eda84fadb5fd7bd38639aeb10d67684c7e984eafaba02dd5
MD5 0f6e5631c7803565b951aab8ccf68a4a
BLAKE2b-256 ebba358246f48518ab6d91bada141ebb5980b629b721150dcafd1d74bb1e0f84

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page