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.2.tar.gz (9.2 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.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: suggestify-0.1.2.tar.gz
  • Upload date:
  • Size: 9.2 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.2.tar.gz
Algorithm Hash digest
SHA256 4547a6b80b053ae54e797fd6f45ed6a99c9c8c4307c6fe75905f9f2569c0fbf1
MD5 1ff14ef90af2ae1602b9d5ace79ba582
BLAKE2b-256 aa0aea8fd8cc487910ad9ee37b165f69963ff9a086e12f14229da174c52587ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: suggestify-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ede10dc02183c1bad8445dc5f80a901686ac157db12b893b84f057c364e6c1e9
MD5 2feb18fd32df49dbdb0e02d498a17287
BLAKE2b-256 0bae68487507546f33b90d396cfe65c8563ebc8698e436fa6b4490360b0576db

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