Skip to content

redis-developer/search-workshop-golang

Repository files navigation

Product Search Relevance with RedisVL for Golang

License: MIT Go 1.25+ Redis Query Engine RedisVL for Golang

🌟 Overview

Welcome to this hands-on workshop where you'll build and evaluate ecommerce product search with Go and Redis. You start with a working product-search service (the HTTP API skeleton and the web UI are provided complete) and an empty Redis database. Lab by lab, you implement the search internals with RedisVL for Golang: embeddings, indexing, vector search, filters, hybrid search, and facets. Then you stop guessing and start measuring: using the WANDS relevance judgments and the Redis Retrieval Optimizer, you score every configuration and leave with an evidence-backed recommendation for production.

🤔 Why This Workshop?

Search quality drops when you disregard design principles like:

  • Full-text search alone can miss intent when wording changes even minimally
  • Vector search alone can return semantically related but lexically weak matches
  • Tuning by eyeballing results does not survive contact with real users

This workshop teaches the full loop: build the retrieval, observe its behavior, measure it with graded relevance judgments, and choose the next experiment.

🎯 What You'll Build

By the end of this workshop, you'll have a complete Redis-powered search app with:

  • A deterministic, judged WANDS product-search sample (600 products, 24 queries)
  • Local in-process embeddings (ONNX, no API keys) behind a Redis embeddings cache
  • A RedisVL index with text, tag, numeric, and vector fields
  • Vector, filtered vector, hybrid (FT.HYBRID), and faceted search, all visible live in the UI and switchable per query
  • A relevance loop: nDCG@10 and Recall@25 against real human judgments
  • A Retrieval Optimizer study across index types (FLAT / HNSW / SVS-VAMANA), embedding models, and query strategies: one ranked table, one recommendation

📋 Prerequisites

Required knowledge

  • Basic Go familiarity
  • Basic understanding of search concepts
  • Familiarity with command-line tools
  • Basic understanding of Docker and Git

Required software

Option 1: GitHub Codespaces

  • GitHub account with Codespaces access
  • Browser or VS Code with Codespaces support

Option 2: Dev Containers locally

Option 3: Local development

  • Go 1.25+
  • Docker
  • ONNX Runtime (brew install onnxruntime on macOS; apt install libonnxruntime or the official releases on Linux)
  • uv (only for Lab 8)
  • jq (optional, prettifies the checkpoint curls)

Check your setup at any time:

make doctor

Required accounts

No paid account is required. Everything runs locally, embeddings included. (OpenAI embeddings appear only as an optional tuning comparison for those who bring a key.)

🗺️ Workshop Structure

This workshop has an estimated duration of 90–120 minutes, organized into progressive labs. Each lab ends with the running service able to do something it could not do before. Watch the UI come alive as you go.

Lab Topic Duration
0 Setup: data, Redis, and the empty shelf 10 min
1 Local embeddings with a Redis cache 15 min
2 Schema, index, and loading products 15 min
3 Vector search 10 min
4 Filtered vector search 10 min
5 Hybrid search with FT.HYBRID 15 min
6 Faceting with aggregations 10 min
7 Tuning knobs and index monitoring 20 min
8 The optimizer study: pick a winner 15 min
9 Wrap-up and next experiments 5 min

Lab instructions live in labs/.

Branches

  • main is where you work. Clone it and go: it contains the guided gaps for all of Labs 1–6, and every lab doc includes the complete code to paste, so falling behind just means pasting a little faster.
  • workshop-complete holds the finished service, for reference and for jumping straight to Labs 7–9 (which add configuration and measurement, not code).

🚀 Getting Started

  1. Pick a setup option from the prerequisites and open the project (Codespace, Dev Container, or local clone).

  2. Verify the tools and start Redis:

    make doctor
    make redis-start
  3. Start with Lab 0. You work on main throughout.

🧭 How the Repository Is Laid Out

cmd/prep         WANDS download + deterministic workshop sample (provided)
cmd/searchd      the service: JSON API + web UI on one port
cmd/eval         nDCG@10 / Recall@25 evaluator (Lab 7's instrument)
internal/embed   ← Lab 1 lives here
internal/search  ← Labs 2–6 live here
internal/httpapi HTTP plumbing (provided, you never edit this)
web/             the search UI (provided, served via go:embed)
optimizer/       Lab 8's Retrieval Optimizer study (Python, uv)
config.yaml      every tuning knob in the workshop
labs/            lab instructions

The design rule: every line you write is RedisVL code. HTTP handlers, JSON, config, and frontend are all provided.

📚 Resources

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

👥 Maintainers

📄 License

This project is licensed under the MIT License.

About

Hands-on workshop to demonstrate how to implement both basic and advanced search patterns with Redis Search. Built using Redis OSS, RedisVL for Golang, and Docker.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages