> ## Documentation Index
> Fetch the complete documentation index at: https://noorle.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Vector Search

> Semantic search using vector embeddings. How vector search works.

Vector search understands meaning, not just keywords.

## How Vector Search Works

1. **Document → Vector** - Each doc converted to math vector
2. **Query → Vector** - User query converted to vector
3. **Similarity** - Find vectors closest to query vector
4. **Return** - Top matches returned as results

All using cosine similarity (0.0 = different, 1.0 = identical).

## Semantic vs Keyword

### Keyword Search

```
Query: "reset password"
Matches: Pages containing "reset" or "password"
Includes: "reset appointment" (false positive)
```

### Semantic (Vector) Search

```
Query: "reset password"
Matches: Authentication, account access, security
Excludes: Reset appointment (different meaning)
```

## Embedding Models

Models determine vector quality:

| Model  | Dimensions | Speed  |
| ------ | ---------- | ------ |
| Small  | 1536       | Fast   |
| Large  | 3072       | Slower |
| Custom | Variable   | Custom |

Choose based on:

* Accuracy needed
* Speed requirements

## Search Parameters

### Top K

Number of results to return (default: 5).

* Lower: Faster, less context
* Higher: More context, slower

### Similarity Threshold

Minimum relevance score (default: 0.7).

* Lower (0.5): More permissive
* Higher (0.9): More strict

### Reranking

LLM refines results (optional, +cost).

## Search Quality

Good search results depend on:

1. **Document quality** - Clear, well-formatted docs
2. **Embedding model** - Better model = better vectors
3. **Query specificity** - More specific = better matches
4. **Threshold tuning** - Set appropriate threshold

## Improving Search

### Better Documents

* Use clear headers
* Consistent formatting
* Complete sentences
* Relevant content

### Better Queries

* Be specific
* Use complete sentences
* Include context
* Ask about meaning, not keywords

### Tune Parameters

* Increase top\_k if missing results
* Lower threshold if too strict
* Enable reranking for refinement

## Search Examples

### Good Queries

✓ "How do I reset my password?"
✓ "What's our refund policy for software?"
✓ "Which API endpoint for user authentication?"

### Bad Queries

✗ "password"
✗ "refund"
✗ "API"

## Batch Search

Search multiple queries:

```json theme={null}
[
  "How do I login?",
  "Where's the pricing?",
  "Do you offer support?"
]
```

Each query returns top K results.

## Search Monitoring

Track search performance:

1. **Knowledge** > Select KB
2. **Analytics** tab
3. See:
   * Query count
   * Average results
   * Performance metrics

## Next Steps

* [Reranking](/docs/run/knowledge/reranking)
* [Knowledge Overview](/docs/run/knowledge/overview)
* [Uploading Documents](/docs/run/knowledge/uploading-documents)
