





















Yes, you heard that right. Query Redis with SQL. No LLMs needed.
Most data science teams already speak SQL fluently, and for many (including LLMs and agents), it’s still the most intuitive way to express queries. At the same time, teams often need the speed and flexibility of Redis at scale.
Luckily the Redis API already provides nearly all the primitives required to express rich, SQL-like queries against a single index, but translating between the two can be cumbersome.
To help close this gap, we released the sql-redis library to PyPi and added the SQLQuery class to redisvl so you can run SQL-like queries at Redis speed.
Install:
Setup index:
Query:
Output:
The SQLQuery class converts a sql-like statement such as:
into an equivalent Redis query.
Conveniently, you can preview the Redis query to be executed via the .redis_query_string() available on the SQLQuery class:
The SQLQuery class accomplishes this deterministically, without an LLM, with the help of sqlglot and the parser within sql-redis. Check out the source code for more details.
The core translation engine already handles aggregations, full-text search, geo queries, and async execution.
Natural language intent
SQL
Redis
Natural language intent
SQL
Redis
Natural language intent
SQL
Redis
Check out the redisvl user guide for a full demo of queries available.
sql-redis parses your SQL into an AST (Abstract Syntax Tree), checks it against your index schema, and emits the right FT.SEARCH or FT.AGGREGATE command.此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。