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

💡 Features

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.0.tar.gz (4.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.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: suggestify-0.1.0.tar.gz
  • Upload date:
  • Size: 4.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.0.tar.gz
Algorithm Hash digest
SHA256 a8c460db22e5e193e2f75479f03ee8344ce02768108019f017ae139cf60ef9f9
MD5 1bcbea5d657c3a6a8ee5631ad5ec62cc
BLAKE2b-256 9bb57e7b63248d45f4292f6cf8d8b5049abea685cc912c7feb62372d72c97bf7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: suggestify-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df45b24bde46e597003a50a4aaf045eac4e760a231c73966d6ed5be9c0693390
MD5 fea7d98c96a0c31caaabbc16b6e2fa43
BLAKE2b-256 528b4a0b2b02cbcd707424cc992fe3d038d4ac178439d9b4791a09d01fc44031

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