HYBRID SEARCH

Retrieval that understands intent and respects keywords

BeforeQuery combines semantic vector search with full-text ranking and fuses the results — so "rotate credentials" finds the page titled "regenerate API keys," and an exact error code still matches exactly.

How retrieval works

The pipeline behind every answer, search box, and bot

Meaning, not keywords

Semantic Search

  • OpenAI text-embedding-3-large embeddings
  • pgvector cosine similarity over every chunk
  • Matches paraphrases, synonyms, and vague phrasing
  • Cross-language matching for multilingual users
  • Heading-aware chunking preserves context
Precision when it counts

Full-Text Search

  • PostgreSQL full-text ranking (ts_rank)
  • Exact matches for error codes and identifiers
  • Product names and API terms rank correctly
  • No embedding fuzziness on literal queries
  • Runs in the same store as your vectors
Best of both, scoped right

Fusion & Scoping

  • Reciprocal rank fusion merges both result sets
  • Source-group filters scope retrieval by product or version
  • Document visibility rules applied at query time
  • Top-k control per request
  • Exposed via Search API, widget, bots, and MCP
One pipeline everywhere

The search behind everything

The same hybrid retrieval powers RAG answer grounding, the widget's search mode, the public Search API, MCP's search_docs, and the Ask portal. Improve your content once and every surface gets better — there is no separate search product to tune.

  • Grounding for every RAG answer and citation
  • Standalone search results with relevance scores
  • Scoped retrieval via source groups (product, version, region)
  • Restricted documents included only for authorized members
  • Search analytics feed the knowledge-gap report
POST /api/v1/public/knowledge-bases/:knowledgeBaseId/search
{
  "query": "rotate credentials",
  "top_k": 5
}

// → chunks ranked by fused score
{
  "results": [
    {
      "title": "Regenerate API keys",
      "url": "https://docs.example.com/api-keys",
      "score": 0.91,
      "excerpt": "To regenerate a key, open Settings..."
    }
  ]
}

Frequently Asked Questions

Common questions about Hybrid Search

Vector search excels at meaning but blurs exact identifiers; keyword search nails identifiers but misses paraphrases. Fusing both with reciprocal rank fusion means "pump won't prime" and "ERR_4012" both retrieve the right page.
Pages are normalized from HTML to markdown, then chunked heading-aware so each chunk carries coherent context, then embedded with OpenAI's text-embedding-3-large. Both the vector and a full-text index are stored per chunk in PostgreSQL with pgvector.
Yes. Source groups let you scope retrieval by product line, version, or region, and client keys can enforce allowed groups — narrowing what an integration can retrieve, never widening it.
Yes. Documents marked restricted are only retrievable by authorized workspace members; public-facing surfaces retrieve only from public documents.
Yes. The public Search API returns ranked chunks with scores and URLs — teams use it for docs search bars, related-articles surfaces, and custom UIs, independent of the RAG chat.

Search that finds what users mean

Index a source and try hybrid search on your own content in minutes.

Get Started Free