$ show gorse-io/gorse
Gorse is a production-grade, open-source recommender system engine written in Go. It implements a master/server/worker distributed architecture: the master coordinates training and cluster state, workers generate offline recommendations, and servers expose a REST API, dashboard, and gRPC endpoints. The system supports collaborative filtering via BPR and ALS matrix factorization, click-through rate prediction via an Attentional Factorization Machine, item-to-item/user-to-user similarity based on embeddings, non-personalized leaderboards, external script recommenders, and LLM-based reranking/chat recommenders. It includes a complete data model for users, items, feedback, and labels, with storage backends for SQL databases, MongoDB, Redis, and vector stores (xvec, Qdrant, Weaviate, Milvus), plus blob storage for model artifacts. The codebase is organized around strong abstractions: storage interfaces, protobuf-based services, a recommendation logic layer, model training/evaluation packages, and a common utility layer containing an autograd tensor library, SIMD-optimized float kernels, HNSW vector search, and concurrency helpers. It exposes admin/client CLIs, JSONL import/export, hyperparameter optimization with Optuna, monitoring metrics, and OpenTelemetry tracing. Although this repository contains ML training, benchmarks, and data-loading code, it is fundamentally an application platform rather than a data-research repository. The engineering is strong but carries complexity from supporting many storage backends, architecture-specific SIMD generated code, and a large monolithic master task file; some deprecated APIs and generated-code drift are present.
The LLM identified 5 files worth highlighting for reuse:
Portable SIMD-accelerated float32 primitives (add, sub, mul, div, sqrt, dot, euclidean, matrix multiply, fp16 conversion) with AVX/AVX512/NEON/RVV/LASX assembly backends and a scalar fallback. This is a standalone numerical kernel with no domain logic; it can be lifted directly into any Go project needing high-performance vector math.
Core operations for a custom autograd tensor library, including differentiable tensor ops, layers, loss functions, and optimizers. It demonstrates a clean differentiable-programming design in Go and can be reused as a self-contained deep learning toolkit when decoupled from protocol serialization.
HNSW approximate nearest-neighbor index with concurrent insert/search and binary serialization. It is a well-isolated, generic vector index that can be extracted and reused in any similarity-search or embedding-retrieval system.
Reflection-based deep copy utility that handles cyclic structures, custom marshal/unmarshal hooks, and interface types. This is a broadly reusable utility for any Go codebase requiring safe deep cloning without boilerplate.
Parallel execution helpers (parallel for loops, for-each, detachable tasks) with context cancellation and rate limiting. It is a compact, dependency-light concurrency utility suitable for CPU-bound batch processing in any Go service.