How It Works
- Query embedding: Your search query is converted to a vector (list of numbers capturing meaning)
- Similarity matching: The system finds stored vectors closest to the query vector
- Ranking: Results are ordered by cosine similarity (how close the meanings are)
text-embedding-3-small work well for most content.
When to Use Vector Search
| Scenario | Why Vector Search Works |
|---|---|
| Conceptual questions | Matches meaning, not just words |
| Users phrase things differently | Finds relevant content regardless of terminology |
| Natural language queries | Understands intent behind questions |
| Content with varied vocabulary | Connects synonyms and related concepts |
Configuration
Basic Setup
With Reranking
Add a reranker to improve result ordering:Example
vector_search.py