VelesDB Mini Recommender

July 15, 2026 ยท View on GitHub

Difficulty: Beginner | Showcases: Collection creation, vector upsert, similarity search, filtered queries, VelesQL parsing, catalog analytics

A self-contained product recommendation engine that demonstrates the core VelesDB workflow end-to-end in under 250 lines of Rust.

What It Does

  1. Creates a products collection (128-dim, cosine)
  2. Ingests 8 products with embeddings and metadata (title, category, price)
  3. Finds products similar to a given product (vector similarity)
  4. Recommends products filtered by category and price ceiling
  5. Parses several VelesQL queries to show the SQL-like syntax
  6. Prints catalog analytics grouped by category

Prerequisites

  • Rust 1.90+ with Cargo

How to Run

cd examples/mini_recommender
cargo run

Expected Output

๐Ÿš€ VelesDB Mini Recommender Example

โœ… Ingested 8 products

๐Ÿ” Products similar to ID 101:
  - Bluetooth Speaker (score: 0.999) - \$49.99
  - Running Shoes X1 (score: 0.997) - \$129.99
  - Yoga Mat Premium (score: 0.993) - \$39.99

๐ŸŽฏ Recommendations in 'electronics' under \$100.00:
  - Wireless Headphones Pro (score: 0.999) - \$79.99
  - Bluetooth Speaker (score: 0.997) - \$49.99
  - Fitness Tracker (score: 0.962) - \$59.99

๐Ÿ“ VelesQL Query Parsing:
  โœ… Similarity search: parses correctly
  โœ… Filtered search: parses correctly
  โœ… Aggregation: parses correctly

๐Ÿ“Š Catalog Analytics:

  Category    | Count | Avg Price
  ------------|-------|----------
  electronics |     4 | \$97.49
  home        |     1 | \$89.99
  sports      |     3 | \$139.99

โœจ Tutorial complete! See docs/guides/TUTORIALS/MINI_RECOMMENDER.md

Scores may differ slightly depending on your platform.

VelesDB Features Demonstrated

FeatureWhere
Database::open()Opens a temporary database
create_collection()128-dim cosine collection
upsert()Batch insert with JSON payloads
search()K-nearest-neighbor vector search
Post-search filteringCategory + price filter in Rust
Parser::parse()VelesQL query parsing
Catalog analyticsIterate and aggregate point payloads

License

MIT License