Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions content/develop/ai/redisvl/0.18.1/api/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ Async drop specific entries from the cache by ID or Redis key.
* **Return type:**
None

#### `NOTE`
{{< note >}}
At least one of ids or keys must be provided.
{{< /note >}}

* **Raises:**
**ValueError** – If neither ids nor keys is provided.
Expand All @@ -138,9 +139,10 @@ Asynchronously set or refresh the expiration time for a key in the cache.
* **Return type:**
None

#### `NOTE`
{{< note >}}
If neither the provided TTL nor the default TTL is set (both are None),
this method will have no effect.
{{< /note >}}

#### `async astore(prompt, response, vector=None, metadata=None, filters=None, ttl=None)`

Expand Down Expand Up @@ -269,8 +271,9 @@ Drop specific entries from the cache by ID or Redis key.
* **Return type:**
None

#### `NOTE`
{{< note >}}
At least one of ids or keys must be provided.
{{< /note >}}

* **Raises:**
**ValueError** – If neither ids nor keys is provided.
Expand All @@ -292,9 +295,10 @@ Set or refresh the expiration time for a key in the cache.
* **Return type:**
None

#### `NOTE`
{{< note >}}
If neither the provided TTL nor the default TTL is set (both are None),
this method will have no effect.
{{< /note >}}

#### `set_threshold(distance_threshold)`

Expand Down Expand Up @@ -538,9 +542,10 @@ Asynchronously set or refresh the expiration time for a key in the cache.
* **Return type:**
None

#### `NOTE`
{{< note >}}
If neither the provided TTL nor the default TTL is set (both are None),
this method will have no effect.
{{< /note >}}

#### `async astore(prompt, response, vector=None, metadata=None, filters=None, ttl=None)`

Expand Down Expand Up @@ -658,9 +663,10 @@ Set or refresh the expiration time for a key in the cache.
* **Return type:**
None

#### `NOTE`
{{< note >}}
If neither the provided TTL nor the default TTL is set (both are None),
this method will have no effect.
{{< /note >}}

#### `set_ttl(ttl=None)`

Expand Down Expand Up @@ -976,9 +982,10 @@ Asynchronously set or refresh the expiration time for a key in the cache.
* **Return type:**
None

#### `NOTE`
{{< note >}}
If neither the provided TTL nor the default TTL is set (both are None),
this method will have no effect.
{{< /note >}}

#### `async aget(content, model_name)`

Expand Down Expand Up @@ -1294,9 +1301,10 @@ Set or refresh the expiration time for a key in the cache.
* **Return type:**
None

#### `NOTE`
{{< note >}}
If neither the provided TTL nor the default TTL is set (both are None),
this method will have no effect.
{{< /note >}}

#### `get(content, model_name)`

Expand Down
3 changes: 2 additions & 1 deletion content/develop/ai/redisvl/0.18.1/api/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ v = VectorQuery(
)
```

#### `NOTE`
{{< note >}}
Filter expressions are typically not called directly. Instead they are
built by combining filter statements using the & and | operators.
{{< /note >}}

* **Parameters:**
* **\_filter** (*str* *|* *None*)
Expand Down
66 changes: 44 additions & 22 deletions content/develop/ai/redisvl/0.18.1/api/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ expression.
* **Raises:**
**TypeError** – If filter_expression is not of type redisvl.query.FilterExpression

#### `NOTE`
{{< note >}}
Learn more about vector queries in Redis: [https://redis.io/docs/latest/develop/ai/search-and-query/vectors/#knn-vector-search](https://redis.io/docs/latest/develop/ai/search-and-query/vectors/#knn-vector-search)
{{< /note >}}

#### `dialect(dialect)`

Expand Down Expand Up @@ -339,10 +340,11 @@ only the FIRST field is used for the Redis SORTBY clause.
>> query.sort_by([("price", "DESC"), ("rating", "ASC")])
```

#### `NOTE`
{{< note >}}
When multiple fields are specified, only the first field is used for sorting
in Redis. Future versions may support multi-field sorting through post-query
sorting in Python.
{{< /note >}}

#### `timeout(timeout)`

Expand Down Expand Up @@ -455,7 +457,7 @@ Return the USE_SEARCH_HISTORY parameter for the query.
* **Return type:**
Optional[str]

#### `NOTE`
{{< note >}}
**Runtime Parameters for Performance Tuning**

VectorQuery supports runtime parameters for HNSW and SVS-VAMANA indexes that can be adjusted at query time without rebuilding the index:
Expand Down Expand Up @@ -495,6 +497,7 @@ query = VectorQuery(
search_buffer_capacity=30
)
```
{{< /note >}}

## VectorRangeQuery

Expand Down Expand Up @@ -569,8 +572,9 @@ distance threshold.
* **Raises:**
**TypeError** – If filter_expression is not of type redisvl.query.FilterExpression

#### `NOTE`
{{< note >}}
Learn more about vector range queries: [https://redis.io/docs/interact/search-and-query/search/vectors/#range-query](https://redis.io/docs/interact/search-and-query/search/vectors/#range-query)
{{< /note >}}

#### `dialect(dialect)`

Expand Down Expand Up @@ -822,10 +826,11 @@ only the FIRST field is used for the Redis SORTBY clause.
>> query.sort_by([("price", "DESC"), ("rating", "ASC")])
```

#### `NOTE`
{{< note >}}
When multiple fields are specified, only the first field is used for sorting
in Redis. Future versions may support multi-field sorting through post-query
sorting in Python.
{{< /note >}}

#### `timeout(timeout)`

Expand Down Expand Up @@ -938,7 +943,7 @@ Return the USE_SEARCH_HISTORY parameter for the query.
* **Return type:**
Optional[str]

#### `NOTE`
{{< note >}}
**Runtime Parameters for Range Queries**

VectorRangeQuery supports runtime parameters for controlling range search behavior:
Expand Down Expand Up @@ -967,6 +972,7 @@ query = VectorRangeQuery(
use_search_history='AUTO' # SVS-VAMANA only
)
```
{{< /note >}}

## AggregateHybridQuery

Expand Down Expand Up @@ -1035,10 +1041,11 @@ Instantiates a AggregateHybridQuery object.
within the query text. Defaults to None, as no modifications will be made to the
text_scorer score.

#### `NOTE`
{{< note >}}
AggregateHybridQuery uses FT.AGGREGATE commands which do NOT support runtime
parameters. For runtime parameter support (ef_runtime, search_window_size, etc.),
use VectorQuery or VectorRangeQuery which use FT.SEARCH commands.
{{< /note >}}

* **Raises:**
* **ValueError** – If the text string is empty, or if the text string becomes empty after
Expand Down Expand Up @@ -1260,15 +1267,17 @@ Get the text weights.
* **Return type:**
Dictionary of word

#### `NOTE`
{{< note >}}
The `stopwords` parameter in [AggregateHybridQuery](#aggregatehybridquery) (and `HybridQuery`) controls query-time stopword filtering (client-side).
For index-level stopwords configuration (server-side), see `redisvl.schema.IndexInfo.stopwords`.
Using query-time stopwords with index-level `STOPWORDS 0` is counterproductive.
{{< /note >}}

#### `NOTE`
{{< note >}}
`HybridQuery` and [AggregateHybridQuery](#aggregatehybridquery) apply linear combination inconsistently. `HybridQuery` uses `linear_alpha` to weight the text score, while [AggregateHybridQuery](#aggregatehybridquery) uses `alpha` to weight the vector score. When switching between the two classes, take care to revise your `alpha` setting.
{{< /note >}}

#### `NOTE`
{{< note >}}
**Runtime Parameters for Hybrid Queries**

**Important:** AggregateHybridQuery uses FT.AGGREGATE commands which do NOT support runtime parameters.
Expand All @@ -1293,6 +1302,7 @@ query = HybridQuery(
num_results=10,
)
```
{{< /note >}}

## HybridQuery

Expand Down Expand Up @@ -1327,8 +1337,9 @@ query = HybridQuery(
results = index.query(query)
```

#### `SEE ALSO`
{{< note >}}
- [FT.HYBRID command documentation](https://redis.io/docs/latest/commands/ft.hybrid)
{{< /note >}}
- [redis-py hybrid_search documentation](https://redis.readthedocs.io/en/stable/redismodules.html#redis.commands.search.commands.SearchCommands.hybrid_search)

Instantiates a HybridQuery object.
Expand Down Expand Up @@ -1387,13 +1398,15 @@ Instantiates a HybridQuery object.
* **ValueError** – If vector_search_method is "KNN" and knn_k is not provided.
* **ValueError** – If vector_search_method is "RANGE" and range_radius is not provided.

#### `NOTE`
{{< note >}}
The `stopwords` parameter in [HybridQuery](#hybridquery) (and `AggregateHybridQuery`) controls query-time stopword filtering (client-side).
For index-level stopwords configuration (server-side), see `redisvl.schema.IndexInfo.stopwords`.
Using query-time stopwords with index-level `STOPWORDS 0` is counterproductive.
{{< /note >}}

#### `NOTE`
{{< note >}}
[HybridQuery](#hybridquery) and `AggregateHybridQuery` apply linear combination inconsistently. [HybridQuery](#hybridquery) uses `linear_alpha` to weight the text score, while `AggregateHybridQuery` uses `alpha` to weight the vector score. When switching between the two classes, take care to revise your `alpha` setting.
{{< /note >}}

## TextQuery

Expand Down Expand Up @@ -1663,10 +1676,11 @@ only the FIRST field is used for the Redis SORTBY clause.
>> query.sort_by([("price", "DESC"), ("rating", "ASC")])
```

#### `NOTE`
{{< note >}}
When multiple fields are specified, only the first field is used for sorting
in Redis. Future versions may support multi-field sorting through post-query
sorting in Python.
{{< /note >}}

#### `timeout(timeout)`

Expand Down Expand Up @@ -1735,10 +1749,11 @@ Get the text weights.
* **Return type:**
Dictionary of word

#### `NOTE`
{{< note >}}
The `stopwords` parameter in [TextQuery](#textquery) controls query-time stopword filtering (client-side).
For index-level stopwords configuration (server-side), see `redisvl.schema.IndexInfo.stopwords`.
Using query-time stopwords with index-level `STOPWORDS 0` is counterproductive.
{{< /note >}}

## FilterQuery

Expand Down Expand Up @@ -1943,10 +1958,11 @@ only the FIRST field is used for the Redis SORTBY clause.
>> query.sort_by([("price", "DESC"), ("rating", "ASC")])
```

#### `NOTE`
{{< note >}}
When multiple fields are specified, only the first field is used for sorting
in Redis. Future versions may support multi-field sorting through post-query
sorting in Python.
{{< /note >}}

#### `timeout(timeout)`

Expand Down Expand Up @@ -2194,10 +2210,11 @@ only the FIRST field is used for the Redis SORTBY clause.
>> query.sort_by([("price", "DESC"), ("rating", "ASC")])
```

#### `NOTE`
{{< note >}}
When multiple fields are specified, only the first field is used for sorting
in Redis. Future versions may support multi-field sorting through post-query
sorting in Python.
{{< /note >}}

#### `timeout(timeout)`

Expand Down Expand Up @@ -2514,9 +2531,10 @@ sql_query = SQLQuery('''
results = index.query(sql_query)
```

#### `NOTE`
{{< note >}}
Requires the optional sql-redis package. Install with:
`pip install redisvl[sql-redis]`
{{< /note >}}

Initialize a SQLQuery.

Expand All @@ -2533,11 +2551,12 @@ Initialize a SQLQuery.
all schemas up front. These options exist to balance startup
cost vs repeated-query performance across many indexes.

#### `NOTE`
{{< note >}}
`sql-redis >= 0.4.0` uses explicit TEXT search operators.
Use `=` for exact phrase matching, `LIKE` for wildcard
matching, `fuzzy()` for typo-tolerant matching, and
`fulltext()` for tokenized search.
{{< /note >}}

#### `redis_query_string(redis_client=None, redis_url='redis://localhost:6379')`

Expand Down Expand Up @@ -2577,16 +2596,18 @@ print(redis_cmd)
# Output: FT.SEARCH products "@category:{electronics}"
```

#### `NOTE`
{{< note >}}
SQLQuery requires the optional `sql-redis` package. Install with:
`pip install redisvl[sql-redis]`
{{< /note >}}

#### `NOTE`
{{< note >}}
SQLQuery translates SQL SELECT statements into Redis FT.SEARCH or FT.AGGREGATE commands.
The SQL syntax supports WHERE clauses, field selection, ordering, and parameterized queries
for vector similarity searches.
{{< /note >}}

#### `NOTE`
{{< note >}}
SQLQuery accepts a `sql_redis_options` dictionary that is passed through to
`sql-redis` executor creation. The most common option is
`schema_cache_strategy`:
Expand All @@ -2595,3 +2616,4 @@ SQLQuery accepts a `sql_redis_options` dictionary that is passed through to
narrow queries cheaper.
- `"load_all"` eagerly loads all schemas up front, which can help when
running many SQL queries across many indexes.
{{< /note >}}
6 changes: 4 additions & 2 deletions content/develop/ai/redisvl/0.18.1/api/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ schema = IndexSchema.from_dict({
})
```

#### `NOTE`
{{< note >}}
The fields attribute in the schema must contain unique field names to ensure
correct and unambiguous field references.
{{< /note >}}

Create a new model by parsing and validating input data from keyword arguments.

Expand Down Expand Up @@ -725,8 +726,9 @@ Configuration for the model, should be a dictionary conforming to [ConfigDict][p
- hnsw: Graph-based approximate search. Fast with high recall (95-99%). Best for general use.
- svs-vamana: SVS-VAMANA (Scalable Vector Search with VAMANA graph algorithm) provides fast approximate nearest neighbor search with optional compression support. This algorithm is optimized for Intel hardware and offers reduced memory usage through vector compression.

#### NOTE
{{< note >}}
For detailed algorithm comparison and selection guidance, see [Vector Algorithm Comparison](#vector-algorithm-comparison).
{{< /note >}}
- datatype: Float precision (bfloat16, float16, float32, float64). Note: SVS-VAMANA only supports float16 and float32.
- distance_metric: Similarity metric (COSINE, L2, IP).
- initial_cap: Initial capacity hint for memory allocation (optional).
Expand Down
Loading
Loading