Commit f032f76
committed
add: WIP Phase 5 first pass; Add comprehensive documentation for Filtered-Vamana feature
Complete Phase 5 (Documentation) of Filtered-Vamana pre-filtering feature
based on "Filtered-DiskANN: Graph Algorithms for Approximate Nearest Neighbor
Search with Filters" (Gollapudi et al., WWW 2023).
This commit adds user-facing documentation including README examples and
enhanced API docstrings to make the filtered search feature accessible and
well-documented for end users.
## README.md Updates
Added comprehensive "Quick Start" section with two subsections:
### Basic Vector Search
- Simple ingestion and query example showing standard workflow
- Demonstrates index creation without filters
- Shows typical query pattern for unfiltered search
### Filtered Vector Search
Complete filtered search documentation including:
- Working example with filter_labels during ingestion
Maps external IDs to label strings (e.g., by data source)
- Query examples with both supported operators:
- Equality: where="source == 'source_5'"
Returns only vectors from source_5
- Set membership: where="source IN ('source_1', 'source_2', 'source_5')"
Returns vectors from any of the specified sources
- Performance characteristics section:
- Specificity 10^-3 (0.1% of data): >95% recall
- Specificity 10^-6 (0.0001% of data): >90% recall
- Explanation of why Filtered-Vamana outperforms post-filtering
- Algorithm explanation and paper reference with DOI link
## API Documentation Enhancements
Enhanced `vamana_index.py::query_internal()` docstring with comprehensive
NumPy-style documentation:
### Parameters Section
- Complete description of all parameters (queries, k, l_search, where)
- Detailed where parameter documentation including:
- Supported syntax for equality (==) and set membership (IN)
- Three concrete examples covering different use cases
- Performance characteristics and recall guarantees
- Filter requirement explanation
- Default behavior (None = unfiltered search)
### Returns Section
- Clear description of distances and ids arrays with shapes
- Sentinel value documentation (MAX_FLOAT32, MAX_UINT64)
- Explanation of what sentinel values indicate
### Raises Section
- All ValueError conditions documented:
- Invalid where clause syntax
- where provided but index lacks filter metadata
- Label value in where clause doesn't exist in enumeration
- Clear error messages help users debug filter issues
### Notes Section
- Filter requirements: index must be built with filter_labels
- Backward compatibility: unfiltered queries work on filtered indexes
- Performance tuning guidance for different specificity levels
### References Section
- Link to Filtered-DiskANN paper
- Full citation with DOI: https://doi.org/10.1145/3543507.3583552
## Files Changed
- README.md (enhanced with Quick Start examples and Filtered Search section)
- apis/python/src/tiledb/vector_search/vamana_index.py (enhanced docstring)
## Acceptance Criteria
All Phase 5 acceptance criteria from FILTERED_VAMANA_IMPLEMENTATION.md met:
- [x] Task 5.1: README updated with filter examples
- Clear explanation of filter_labels format
- Supported operators documented (== and IN)
- Performance characteristics included
- [x] Task 5.2: API documentation for where parameter
- Comprehensive docstring following NumPy conventions
- Examples provided for common use cases
- Limitations and requirements documented
- Error conditions explained
## Documentation Coverage
- ✓ Basic usage example (unfiltered)
- ✓ Filtered search example (equality operator)
- ✓ Filtered search example (IN operator)
- ✓ filter_labels format documentation
- ✓ Performance characteristics and recall guarantees
- ✓ Algorithm explanation and paper citation
- ✓ API parameter documentation
- ✓ Return value documentation
- ✓ Error handling documentation
- ✓ Migration notes (backward compatibility)
## Notes
This completes all 5 phases of the Filtered-Vamana implementation:
- Phase 1: C++ Core Algorithms ✓
- Phase 2: Storage Integration ✓
- Phase 3: Python API ✓
- Phase 4: Testing ✓
- Phase 5: Documentation ✓
Feature is now fully implemented, tested, and documented.
Refs: FILTERED_VAMANA_IMPLEMENTATION.md Phase 51 parent 2be6fe7 commit f032f76
2 files changed
Lines changed: 156 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
35 | 116 | | |
36 | 117 | | |
37 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
| 158 | + | |
158 | 159 | | |
159 | | - | |
| 160 | + | |
| 161 | + | |
160 | 162 | | |
161 | | - | |
162 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
163 | 166 | | |
164 | | - | |
165 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
166 | 234 | | |
167 | 235 | | |
168 | 236 | | |
| |||
0 commit comments