{"id":13506088,"url":"https://github.com/guokr/simbase","last_synced_at":"2025-10-03T12:59:41.492Z","repository":{"id":9682620,"uuid":"11627513","full_name":"guokr/simbase","owner":"guokr","description":"A vector similarity database","archived":false,"fork":false,"pushed_at":"2014-07-03T06:13:08.000Z","size":13621,"stargazers_count":230,"open_issues_count":8,"forks_count":28,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-07-17T10:59:12.094Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guokr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-24T06:03:52.000Z","updated_at":"2025-06-30T06:08:06.000Z","dependencies_parsed_at":"2022-09-05T20:00:36.459Z","dependency_job_id":null,"html_url":"https://github.com/guokr/simbase","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/guokr/simbase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokr%2Fsimbase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokr%2Fsimbase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokr%2Fsimbase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokr%2Fsimbase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guokr","download_url":"https://codeload.github.com/guokr/simbase/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokr%2Fsimbase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278165685,"owners_count":25940957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T01:00:34.366Z","updated_at":"2025-10-03T12:59:41.460Z","avatar_url":"https://github.com/guokr.png","language":"Java","funding_links":[],"categories":["Projects","数据库"],"sub_categories":[],"readme":"Simbase: A vector similarity database\n======================================\n\nSimbase is a redis-like vector similarity database. You can add, get, delete\nvectors to/from it, and then retrieve the most similar vectors within one vector\nset or between two vector sets.\n\nRelease\n--------\n\nCurrent version is [v0.1.0-beta1](https://github.com/guokr/simbase/releases/tag/v0.1.0-beta1).\n\nBuild status\n-------------\n[![Build Status](https://secure.travis-ci.org/guokr/simbase.png)](http://travis-ci.org/guokr/simbase)\n\nConcepts\n--------\n\nSimbase use a concept model as below:\n\n                       + - - - +\n          +-----------\u003e| Basis |\u003c------------------+\n          |  belongs   + _ _ _ +      belongs      |\n          |                                        |\n          |                                        |\n    + - - - - - +        source           + - - - - - - - -+ \n    | VectorSet |\u003c------------------------| Recommendation |\n    + - - - - - +                         + - - - - - - - -+\n          ^              target                    |\n          |________________________________________|\n\n* Vector set: a set of vectors\n* Basis: the basis for vectors, vectors in one vector set have same basis\n* Recommendation: a one-direction binary relationship between two vector sets which have the same basis\n\nA real example follow the model below:\n\n         + - - - - - +                 + - - - - - - - -+ \n    +---\u003e|  Articles |\u003c----------------|  User Profiles |\n    |    + - - - - - +                 + - - - - - - - -+\n    |          |\n    +----------+\n\nThis graph shows\n\n* recommend article by article (recommend from article to article)\n* recommend article by user profile (recommend from user profile to article)\n\nHow to build and start\n-----------------------\n\nTo build the project, you need install leiningen first, and then\n\n  \u003e cd SIMBASE_HOME\n  \n  \u003e lein uberjar\n\nAfter the uberjar is created, you can start the system\n\n  \u003e cd SIMBASE_HOME\n  \n  \u003e bin/start\n\nHow to connect to Simbase\n--------------------------\n\nYou can use redis-cli directly for administration tasks.\n\nOr you can use redis client bindings in different language directly in a programming way.\n\nPython example\n\n``` python\nimport redis\n\ndest = redis.Redis(host='localhost', port=7654)\ndest.execute_command('bmk', 'ba', 'a', 'b', 'c')\ndest.execute_command('vmk', 'ba', 'va')\ndest.execute_command('rmk', 'va', 'va', 'cosinesq')\n```\n\nNode.js example\n\n``` javascript\nvar redis = require(\"redis\"), client = redis.createClient(7654, 'localhost');\n\nclient.send_command('bmk', ['ba', 'a', 'b', 'c'])\nclient.send_command('vmk', ['ba', 'va'])\nclient.send_command('rmk', ['va', 'va', 'cosinesq'])\n```\n\nA general application case\n---------------------------\n\nFor example, we need to recommend articles to users, we may follow below steps:\n\nSetup\n\n    \u003e bmk b2048 t1 t2 t3 ... t2047 t2048\n    \u003e vmk b2048 article\n    \u003e vmk b2048 userprofile\n    \u003e rmk userprofile article cosinesq\n\nFill data\n\n    \u003e vadd article 1 0.11 0.112 0.1123...\n    \u003e vadd article 2 0.21 0.212 0.2123...\n    ...    \n\n    \u003e vadd userprofile 1 0.11 0.112 0.1123...\n    \u003e vadd userprofile 2 0.21 0.212 0.2123...\n    ...\n\nQuery\n\n    \u003e rrec userprofile 2 article\n\nAll commands are explained in next section.\n\nCore commands\n--------------\nThen you can use redis-cli to connect to simbase directly\n\nBasis related\n\n*   blist\n\n    \u003e blist\n    \n    List all basis in system\n\n*   bmk basisname components...\n\n    \u003e bmk b512 universe time space human animal plant...\n    \n    Create a basis\n\t\n*   brev basisname components...\n\n    \u003e brev b512 plant animal human space time universe...\n    \n    Revise a basis\n    \nVector set related\n\n*   vlist basisname\n\n    \u003e vlist b512\n    \n    List all vector set with one basis\n\n*   vmk basisname vecsetname\n\n    \u003e vmk b512 article\n    \n    Create a vector set\n\n*   vget vecsetname vecid\n\n    \u003e vget article 12345678\n    \n    Get the vector for the article with id 12345678\n\n*   vadd vecsetname vecid components...\n\n    \u003e vadd article 12345678 0.1 0.12 0.123 0.1234 0.12345 0.123456...\n    \n    add the value for the article vector with id 12345678\n\n*   vset vecsetname vecid components...\n\n    \u003e vset article 12345678 0.1 0.12 0.123 0.1234 0.12345 0.123456...\n    \n    set the value for the article vector with id 12345678\n\n*   vacc vecsetname vecid components...\n\n    \u003e vacc article 12345678 0.1 0.12 0.123 0.1234 0.12345 0.123456...\n    \n    accumulate the value for the article vector with id 12345678\n\n*   vrem vecsetname vecid\n\n    \u003e vrem article 12345678\n    \n   remove the vector with id 12345678 from article vector set \n\nRecommendation related\n\n*   rlist vecsetname\n\n    \u003e rlist article\n    \n    List all recommendation targets with the inputed vecset as source\n\n*   rmk vecsetname1 vecsetname2 funcscore\n\n    \u003e rmk userprofile article cosinesq\n    \n    Create a recommendation to article by userprofile and it use cosinesq as score function.\n    Currently score functions you can choice are: 'cosinesq' and 'jensenshannon' \n\n*   rrec vecsetname1 vecid vecsetname2\n\n    \u003e rrec userprofile 87654321 article\n    \n    Recommend articles for user 87654321\n\nLimitations\n------------\n\n### Assumptions on vectors\n\nAlthough Simbase can store arbitrary vectors, but score functions may apply some constraints on vectors.\n\nFor example, if you adopt \"jensenshannon\" as your score function, you should assure your vector is a\nprobability distribution, i.e. the sum of all components equals to one.\n\n### Performance consideration\n\nThe write operation is handled in a single thread per basis, and comparison between any two vectors is needed,\nso the write operation is scaled at O(n).\n\nWe had a non-final performance test for the dense vectors on an i7-cpu Macbook, it can easily handle 100k\n1k-dimensional vectors with each write operation in under 0.14 sec; and if the linear scale ratio can hold, \nit means Simbase can handle 700k dense vectors with each write operation in under 1 sec.\n\nSince the data is all in memory, the read operation is pretty fast.\n\nWe are still in the process of tuning the performance of the sparse vectors.\n\nLicenses\n---------\n\nSimbase is dual licensed under the Apache License 2.0 and\nEclipse Public License 1.0. Simbase is free for commercial use\nand distribution under the terms of either license.\n\nSpecial thanks\n---------------\n\nSpecial thanks for Feng Sheng, we borrowed lots of code from his\ngreat project http-kit ( https://github.com/http-kit/http-kit/ ).\n\nAlso thanks for Kunwei Zhang from Tsinghua Univ. for his smart idea.  \n\nContributors\n-------------\n\n* Mingli Yuan ( https://github.com/mountain )\n* Wanjian Wu ( https://github.com/jseagull )\n* Yang Zhang ( https://github.com/zmouren )\n* Jianjiang Zhu ( https://github.com/zjjott )\n* Jiacai Liu ( https://github.com/jiacai2050 )\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguokr%2Fsimbase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguokr%2Fsimbase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguokr%2Fsimbase/lists"}