Our algorithm combines AI-powered query enhancement, hybrid search techniques, and intelligent reranking to understand user intent (also known as search intent) and return the most accurate results. Upstash Search processes every query through three key stages:
  1. Input Enrichment: Enhances the search query using AI to better understand user intent.
  2. Hybrid Vector Search: Combines semantic search and full-text search to find relevant documents.
  3. Reranking: Uses AI models to reorder results based on relevance.

1. Input Enrichment

The first stage enhances your search query using a Large Language Model (LLM). This process:
  • Expands the original query with related terms and context
  • Improves understanding of user intent
  • Handles typos and alternative phrasings
  • Adds semantic context that might be missing from the original query
While input enrichment introduces some latency, it significantly improves search quality. Input enrichment is enabled by default. You can disable this feature if you want to preserve the user query for full text-search or if you want to reduce latency.
const results = await index.search({
  query: "space opera",
  inputEnrichment: false // faster but less enhanced results
});
The second stage performs hybrid search by combining semantic search and full-text search:
  • Semantic Search: Uses vector embeddings to understand meaning and context
  • Full-Text Search: Performs traditional keyword matching
  • Result Combination: Merges results using configurable weights
By default, Upstash Search uses a 75% semantic weight and 25% full-text weight. You can adjust this balance based on your use case:
  • Higher semantic weight: Better for conceptual searches and finding related content
  • Lower semantic weight: Better for exact keyword matching and technical queries
const results = await index.search({
  query: "artificial intelligence concepts",
  semanticWeight: 0.9 // 90% semantic, 10% full-text
});

3. Reranking

The final stage reranks the hybrid search results using AI models. Upstash Search offers two reranking options: Advanced Reranking (reranking: true)
  • Uses a powerful, state-of-the-art reranking model
  • Provides the highest quality results
  • Costs $1 per 1K reranking operations
  • Recommended for applications where search quality is critical
Standard Reranking (reranking: false, default)
  • Uses a simpler, faster reranking model
  • Still provides significant improvements over raw hybrid results
  • No additional cost
const results = await index.search({
  query: "complex technical documentation",
  reranking: true // uses premium reranking model
});

Conclusion

This three-stage approach ensures that Upstash Search:
  • Understands Intent: Input enrichment helps the system understand what users are really looking for
  • Finds Relevant Content: Hybrid search captures both semantic meaning and exact keyword matches
  • Prioritizes Quality: Reranking ensures the most relevant results appear first
  • Stays Flexible: Each stage can be configured based on your specific needs
The result is a search system that works well across all kinds of content and domains, handling everything from precise technical queries to broad conceptual searches.