Skip to content
View sqlrec's full-sized avatar

Block or report sqlrec

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
sqlrec/README.md

SQLRec

English | 中文

License Stars Forks Last Commit

About SQLRec

SQLRec is an engine for building recommendation systems in SQL. Developers familiar with SQL can write recall, deduplication, ranking, and diversification logic, then publish the flow as an HTTP API. The engine handles data-source access, model training, and inference so users can focus on recommendation logic.

The current release is beta. Production use is not recommended, and interface compatibility is not guaranteed.

Why SQLRec

  • Develop in SQL: Write recall, ranking, and other recommendation logic, then publish it as an API.
  • Execute online flows: Run SQL with Calcite, with caching, parallel calls, timeouts, and fallbacks.
  • Reuse your big data ecosystem: Use existing HMS tables and data on HDFS directly.
  • Manage models through SQL: Train, deploy, and call models, or connect existing model services.
  • Deploy on Kubernetes: Manage training and inference with Kubernetes and provided deployment scripts.
  • Extend as needed: Add custom functions, data sources, and model backends.
  • Troubleshoot easily: Inspect flows and diagnose issues with the UI, metrics, and traces.

System Architecture

SQLRec system architecture

See Architecture for component responsibilities and execution details.

Try It

The Docker demo includes sample data, a recommendation flow, and an API solely for trying the features. It requires no external services. To integrate SQLRec into your application, define your own tables connected to business data, SQL recommendation flows, and APIs, then configure model services and deployment as needed.

Start the demo with Docker:

docker run --rm -d --name sqlrec-demo \
  -p 30000:30000 \
  -p 30001:30001 \
  sqlrec/sqlrec-demo:latest

Call the built-in recommendation API:

curl -X POST http://localhost:30001/api/v1/demo_rec \
  -H "Content-Type: application/json" \
  -d '{"data":{"user_info":[{"user_id":1000001}]}}'

The first call usually returns two items with fields such as item_id and rec_reason. Use user IDs 1000001 through 1000005. Repeated calls exclude previously recommended items; restart the container when the candidates are exhausted.

Open the SQLRec UI to inspect tables, functions, APIs, and execution DAGs.

Optional: Call It with SQL

docker exec -it sqlrec-demo /app/cli.sh
cache table quick_start_user as
select cast(1000001 as bigint) as user_id;

call demo_rec(quick_start_user);

End each statement with a semicolon and press Ctrl+D to exit. The CLI and HTTP service keep separate in-memory data; CLI changes do not affect the API.

Stop the container when finished; --rm removes it automatically:

docker stop sqlrec-demo

Build Your Own Recommendation Flow

See the SQLRec User Manual for more.

Popular repositories Loading

  1. sqlrec sqlrec Public

    A Recommendation Engine That Supports SQL Development

    Java 1

  2. juicefs juicefs Public

    Forked from juicedata/juicefs

    JuiceFS is a distributed POSIX file system built on top of Redis and S3.

    Go

  3. TorchEasyRec TorchEasyRec Public

    Forked from alibaba/TorchEasyRec

    An easy-to-use framework for large scale recommendation algorithms.

    Python

  4. sqlrec-arm-compat sqlrec-arm-compat Public

    Python