Skip to content

Commit f9b66f1

Browse files
authored
Merge pull request #11 from FoxNoseTech/feat/add-vector-fields-support
feat: vector search support for Flux API (v0.5.0)
2 parents cb8c446 + f468d3a commit f9b66f1

15 files changed

Lines changed: 1718 additions & 7 deletions

docs/api-reference.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,44 @@ Complete API reference for the FoxNose Python SDK.
3434
heading_level: 3
3535
members_order: source
3636

37+
## Vector Search Models
38+
39+
::: foxnose_sdk.flux.models.SearchMode
40+
options:
41+
show_source: false
42+
heading_level: 3
43+
members: false
44+
45+
::: foxnose_sdk.flux.models.VectorSearch
46+
options:
47+
show_source: false
48+
heading_level: 3
49+
members: false
50+
51+
::: foxnose_sdk.flux.models.VectorFieldSearch
52+
options:
53+
show_source: false
54+
heading_level: 3
55+
members: false
56+
57+
::: foxnose_sdk.flux.models.VectorBoostConfig
58+
options:
59+
show_source: false
60+
heading_level: 3
61+
members: false
62+
63+
::: foxnose_sdk.flux.models.HybridConfig
64+
options:
65+
show_source: false
66+
heading_level: 3
67+
members: false
68+
69+
::: foxnose_sdk.flux.models.SearchRequest
70+
options:
71+
show_source: false
72+
heading_level: 3
73+
members: false
74+
3775
## Authentication
3876

3977
### JWTAuth

docs/changelog.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.5.0] - 2026-03-19
11+
12+
### Added
13+
14+
- **Vector search models** in `foxnose_sdk.flux.models`:
15+
- `SearchMode` enum (`text`, `vector`, `vector_boosted`, `hybrid`)
16+
- `VectorSearch` — auto-generated embedding search configuration
17+
- `VectorFieldSearch` — custom pre-computed embedding search configuration
18+
- `VectorBoostConfig` — boost configuration for `vector_boosted` mode
19+
- `HybridConfig` — weight configuration for `hybrid` mode
20+
- `SearchRequest` — typed search payload with cross-field validation
21+
- **Convenience methods** on `FluxClient` and `AsyncFluxClient`:
22+
- `vector_search()` — semantic search with auto-generated embeddings
23+
- `vector_field_search()` — search with custom embedding vectors
24+
- `hybrid_search()` — blended text + vector search
25+
- `boosted_search()` — keyword search boosted by vector similarity
26+
- **Vector Search documentation** — dedicated guide covering all search modes
27+
- All convenience methods support `offset` and `**extra_body` pass-through for additional API parameters (`where`, `sort`, etc.)
28+
29+
### Fixed
30+
31+
- `examples/flux_client.py` search example now uses correct API keys (`find_text` and `results`)
32+
1033
## [0.4.2] - 2026-03-10
1134

1235
### Fixed
@@ -99,7 +122,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99122
- Error handling guide
100123
- Code examples
101124

102-
[Unreleased]: https://github.com/foxnose/python-sdk/compare/v0.4.2...HEAD
125+
[Unreleased]: https://github.com/FoxNoseTech/foxnose-python/compare/v0.5.0...HEAD
126+
[0.5.0]: https://github.com/FoxNoseTech/foxnose-python/compare/v0.4.2...v0.5.0
103127
[0.4.2]: https://github.com/FoxNoseTech/foxnose-python/compare/v0.4.1...v0.4.2
104128
[0.4.1]: https://github.com/FoxNoseTech/foxnose-python/compare/v0.4.0...v0.4.1
105129
[0.4.0]: https://github.com/FoxNoseTech/foxnose-python/compare/v0.3.0...v0.4.0

docs/examples.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,33 @@ print(resource["data"]["title"])
261261
results = client.search("blog-posts", body={"find_text": {"query": "python"}})
262262
```
263263

264+
### Vector Search
265+
266+
**File:** `examples/vector_search.py`
267+
268+
Vector search modes and configuration:
269+
270+
- Semantic search with auto-generated embeddings
271+
- Custom embedding search
272+
- Hybrid text + vector search
273+
- Boosted search with vector similarity
274+
275+
```python
276+
from foxnose_sdk.flux import FluxClient
277+
278+
# Semantic search
279+
results = client.vector_search("blog-posts", query="machine learning")
280+
281+
# Hybrid search
282+
results = client.hybrid_search(
283+
"blog-posts",
284+
query="ML applications",
285+
find_text={"query": "machine learning"},
286+
vector_weight=0.7,
287+
text_weight=0.3,
288+
)
289+
```
290+
264291
## Running Examples
265292

266293
1. Clone the repository:

docs/flux-client.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,49 @@ for item in results["results"]:
8989
print(item["data"]["title"])
9090
```
9191

92+
## Vector Search
93+
94+
The Flux API supports multiple vector search modes. See the [Vector Search guide](vector-search.md) for full documentation.
95+
96+
### Quick Examples
97+
98+
```python
99+
# Semantic search with auto-generated embeddings
100+
results = client.vector_search(
101+
"blog-posts",
102+
query="machine learning in healthcare",
103+
top_k=10,
104+
)
105+
106+
# Search with custom embeddings
107+
results = client.vector_field_search(
108+
"speakers",
109+
field="speaker_embedding",
110+
query_vector=[0.012, -0.034, 0.056, ...],
111+
)
112+
113+
# Hybrid text + vector search
114+
results = client.hybrid_search(
115+
"blog-posts",
116+
query="ML applications",
117+
find_text={"query": "machine learning"},
118+
vector_weight=0.7,
119+
text_weight=0.3,
120+
)
121+
122+
# Text search boosted by vector similarity
123+
results = client.boosted_search(
124+
"blog-posts",
125+
find_text={"query": "python tutorial"},
126+
query="beginner programming guide",
127+
boost_factor=1.5,
128+
)
129+
```
130+
131+
All vector search methods support `offset`, `limit`, and `**extra_body` for additional parameters like `where` and `sort`.
132+
133+
The raw `search()` method continues to work with plain dicts for backward compatibility.
134+
92135
## Introspection Endpoints
93136

94137
Use Flux introspection to discover available routes and live schema metadata at runtime.

0 commit comments

Comments
 (0)