MCPcopy Index your code
hub / github.com/gorse-io/gorse

github.com/gorse-io/gorse @v0.5.10 sqlite

repository ↗ · DeepWiki ↗ · release v0.5.10 ↗
4,160 symbols 13,929 edges 229 files 678 documented · 16%
README

Gorse Open-source Recommender System Engine

test codecov Discord Twitter Follow Gurubase

Gorse is an AI powered open-source recommender system written in Go. Gorse aims to be a universal open-source recommender system that can be quickly integrated into a wide variety of online services. By importing items, users, and interaction data into Gorse, the system will automatically train models to generate recommendations for each user. Project features are as follows.

  • Multi-source: Recommend items from latest, user-to-user, item-to-item, collaborative filtering and etc.
  • Multimodal: Support multimodal content (text, image, videos, etc.) via embedding.
  • AI-powered: Support both classical recommenders and LLM-based recommenders.
  • GUI Dashboard: Provide GUI dashboard for recommendation pipeline editing, system monitoring, and data management.
  • RESTful APIs: Expose RESTful APIs for data CRUD and recommendation requests.

Quick Start

The playground mode has been prepared for beginners. Just set up a recommender system for GitHub repositories by the following commands.

docker run -p 8088:8088 zhenghaoz/gorse-in-one --playground

The playground mode will download data from GitRec and import it into Gorse. The dashboard is available at http://localhost:8088.

After the "Generate item-to-item recommendation" task is completed on the "Tasks" page, try to insert several feedbacks into Gorse. Suppose Bob is a developer who interested in LLM related repositories. We insert his star feedback to Gorse.

read -d '' JSON << EOF
[
    { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"ollama:ollama\", \"Value\": 1.0, \"Timestamp\": \"2022-02-24\" },
    { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"huggingface:transformers\", \"Value\": 1.0, \"Timestamp\": \"2022-02-25\" },
    { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"rasbt:llms-from-scratch\", \"Value\": 1.0, \"Timestamp\": \"2022-02-26\" },
    { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"vllm-project:vllm\", \"Value\": 1.0, \"Timestamp\": \"2022-02-27\" },
    { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"hiyouga:llama-factory\", \"Value\": 1.0, \"Timestamp\": \"2022-02-28\" }
]
EOF

curl -X POST http://127.0.0.1:8088/api/feedback \
   -H 'Content-Type: application/json' \
   -d "$JSON"

Then, fetch 10 recommended items from Gorse. We can find that LLM-related repositories are recommended for Bob.

curl http://127.0.0.1:8088/api/recommend/bob?n=10

For more information:

Architecture

Gorse is a single-node training and distributed prediction recommender system. Gorse stores data in MySQL (MariaDB), MongoDB, Postgres, or ClickHouse, with intermediate results cached in Redis, MySQL (MariaDB), MongoDB and Postgres.

  1. The cluster consists of a master node, multiple worker nodes, and server nodes.
  2. The master node is responsible for model training, non-personalized recommendation, configuration management, and membership management.
  3. The server node is responsible for exposing the RESTful APIs and online real-time recommendations.
  4. Worker nodes are responsible for offline recommendations for each user.

In addition, the administrator can perform system monitoring, data import and export, and system status checking via the dashboard on the master node.

Contributors

Any contribution is appreciated: report a bug, give advice or create a pull request. Read CONTRIBUTING.md for more information.

Acknowledgments

gorse is inspired by the following projects:

Extension points exported contracts — how you extend this code

Layer (Interface)
(no doc) [7 implementers]
common/nn/layers.go
Store (Interface)
(no doc) [5 implementers]
storage/blob/blob.go
UnifiedIndex (Interface)
UnifiedIndex maps users, items and labels into a unified encoding space. [2 implementers]
dataset/unified_index.go
CFSplit (Interface)
CFSplit is the dataset split for collaborative filtering. [1 implementers]
dataset/dataset.go
MatrixFactorization (Interface)
(no doc) [3 implementers]
model/cf/model.go
FactorizationMachines (Interface)
(no doc) [3 implementers]
model/ctr/model.go
Model (Interface)
Model is the interface for all models. Any model in this package should implement it.
model/model.go
Database (Interface)
Database is the common interface for cache store.
storage/cache/database.go

Core symbols most depended-on inside this repo

Equal
called by 931
config/config.go
Error
called by 508
common/log/log.go
Logger
called by 357
common/log/log.go
String
called by 313
common/nn/op.go
Now
called by 243
config/config.go
Add
called by 219
common/ann/ann.go
Key
called by 208
storage/cache/database.go
Set
called by 186
storage/cache/database.go

Shape

Method 2,681
Function 975
Struct 420
Interface 36
TypeAlias 35
FuncType 10
Class 3

Languages

Go100%
Python1%

Modules by API surface

protocol/data_store.pb.go432 symbols
protocol/cache_store.pb.go241 symbols
protocol/protocol.pb.go171 symbols
protocol/data_store_grpc.pb.go146 symbols
common/nn/op.go122 symbols
protocol/vector_store.pb.go107 symbols
protocol/cache_store_grpc.pb.go81 symbols
storage/data/sql.go70 symbols
dataset/unified_index.go68 symbols
storage/data/proxy.go64 symbols
server/rest.go64 symbols
storage/data/database.go62 symbols

Dependencies from manifests, versioned

cel.dev/exprv0.25.1 · 1×
cloud.google.com/gov0.123.0 · 1×
cloud.google.com/go/auth/oauth2adaptv0.2.8 · 1×
cloud.google.com/go/compute/metadatav0.9.0 · 1×
cloud.google.com/go/monitoringv1.24.3 · 1×
cloud.google.com/go/storagev1.61.3 · 1×
filippo.io/edwards25519v1.1.0 · 1×
github.com/Azure/azure-sdk-for-go/sdk/azcorev1.20.0 · 1×
github.com/Azure/azure-sdk-for-go/sdk/internalv1.11.2 · 1×

Datastores touched

(mysql)Database · 1 repos
(mongodb)Database · 1 repos
gorseDatabase · 1 repos
mydbDatabase · 1 repos
gorseDatabase · 1 repos
gorseDatabase · 1 repos

For agents

$ claude mcp add gorse \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact