{"id":35829188,"url":"https://github.com/faizchishtie/vemcache","last_synced_at":"2026-01-07T22:00:06.831Z","repository":{"id":162541109,"uuid":"626521449","full_name":"FaizChishtie/vemcache","owner":"FaizChishtie","description":"Vemcache is an in-memory vector database.","archived":false,"fork":false,"pushed_at":"2024-09-09T21:12:27.000Z","size":46,"stargazers_count":31,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-10T22:52:53.302Z","etag":null,"topics":["in-memory-caching","in-memory-database","vector","vector-database"],"latest_commit_sha":null,"homepage":"https://vemcache.com","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FaizChishtie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-11T16:24:22.000Z","updated_at":"2024-09-09T21:12:24.000Z","dependencies_parsed_at":"2023-07-18T01:31:21.055Z","dependency_job_id":null,"html_url":"https://github.com/FaizChishtie/vemcache","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/FaizChishtie/vemcache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaizChishtie%2Fvemcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaizChishtie%2Fvemcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaizChishtie%2Fvemcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaizChishtie%2Fvemcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FaizChishtie","download_url":"https://codeload.github.com/FaizChishtie/vemcache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaizChishtie%2Fvemcache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28238201,"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":"2026-01-07T02:00:05.975Z","response_time":58,"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":["in-memory-caching","in-memory-database","vector","vector-database"],"created_at":"2026-01-07T22:00:05.437Z","updated_at":"2026-01-07T22:00:06.810Z","avatar_url":"https://github.com/FaizChishtie.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vemcache\n\nVemcache is an in-memory vector database. \n\nVemcache can be thought of as the Redis equivalent for vector databases.\n\n## Getting Started\n\n### Prerequisites\n\n- Docker: To run Vemcache using Docker, you need to have Docker installed on your system. You can install Docker by following the instructions on the [Docker website](https://docs.docker.com/get-docker/).\n- Rust: To build and run Vemcache, you need Rust and Cargo installed on your system. You can install them using [rustup](https://rustup.rs/).\n\n### Building Vemcache\n\n#### Using Docker\n\n1. Pull the [Vemcache image from dockerhub](https://hub.docker.com/r/faizchishtie/vemcache)\n\n```bash\ndocker pull faizchishtie/vemcache\n```\n\n2. Run the image\n\n```bash\ndocker run --rm -it -p 7070:7070 faizchishtie/vemcache:latest\n```\n\n#### Using docker-compose\n\nAdd the following to your `docker-compose.yml`\n\n```\nversion: \"3.7\"\n\nservices:\n  vemcache:\n    image: faizchishtie/vemcache:latest\n    ports:\n      - \"7070:7070\"\n    environment:\n      - VEMCACHE_HOST=0.0.0.0\n      - VEMCACHE_PORT=7070\n      - VEMCACHE_SECRET=mysecret\n```\n\n#### Locally\n\n1. Clone the Vemcache repository:\n\n```bash\ngit clone https://github.com/faizchishtie/vemcache.git\ncd vemcache\n```\n\n2. Build Vemcache:\n\n```bash\nmake build\n```\n\n3. Run Vemcache\n\n```bash\nmake run\n```\n\n## Using Vemcache\n\nConnect to Vemcache with a TCP client like `telnet` or `nc`.\n\nUse `telnet` to connect to Vemcache\n\n```bash\ntelnet 0.0.0.0 7070\n```\n\nOr use `nc`\n\n```bash\nnc 0.0.0.0 7070\n```\n\nOnce connected, you can interact with the Vemcache server by sending commands.\n\n### Inserting Vectors\nTo insert a vector into the database, use the insert command followed by the vector values:\n\n```bash\ninsert 0.5 0.7 0.2\n```\nTo insert a vector with a specified key, use the named_insert command followed by the key and vector values:\n\n```bash\nnamed_insert my_vector 0.5 0.7 0.2\n```\n\n### Retrieving Vectors\nTo retrieve a vector from the database using its key, use the get command followed by the key:\n\n```bash\nget my_vector\n```\n\n### Removing Vectors\n\nTo remove a vector from the database using its key, use the remove command followed by the key:\n\n```bash\nremove my_vector\n```\n\n### Performing Vector Operations\n\nTo calculate the cosine similarity between two vectors, use the vcosine command followed by the keys of the two vectors:\n\n```bash\nvcosine vector1 vector2\n```\n\nTo find the k nearest neighbors of a vector, use the knn command followed by the key of the query vector and the value of k:\n\n```bash\nknn query_vector 3\n```\n\nTo perform element-wise addition of two vectors, use the vadd command followed by the keys of the two vectors:\n\n```bash\nvadd vector1 vector2\n```\n\nTo perform element-wise subtraction of two vectors, use the vsub command followed by the keys of the two vectors:\n\n```bash\nvsub vector1 vector2\n```\n\nTo scale a vector by a scalar value, use the vscale command followed by the key of the vector and the scalar value:\n\n```bash\nvscale vector1 2.0\n```\n\n### Dumping the Database\n\nTo dump the database to a JSON file, use the dump command followed by the path to the file:\n\n```bash\ndump vemcache.json\n```\n\n### Closing the Connection\n\nTo exit the client, press Ctrl+C or type quit (if using telnet).\n\nThis concludes the basic usage of Vemcache for vector operations. For more advanced operations and detailed explanations of each command, refer to the [Vemcache documentation](vemcache.com).\n\n### Example Session\n\n```bash\n# User connects to Vemcache using telnet\n$ telnet 0.0.0.0 7070\nTrying 0.0.0.0...\nConnected to 0.0.0.0.\nEscape character is '^]'.\n\n# User inserts a vector with the key \"vector_a\"\nnamed_insert vector_a 0.5 0.7 0.2\nOK\n\n# User inserts another vector with the key \"vector_b\"\nnamed_insert vector_b 0.1 0.9 0.4\nOK\n\n# User retrieves the vector with the key \"vector_a\"\nget vector_a\n[0.5, 0.7, 0.2]\n\n# User calculates the cosine similarity between \"vector_a\" and \"vector_b\"\nvcosine vector_a vector_b\nCosine Similarity: 0.8693\n\n# User finds the nearest neighbor of \"vector_a\" (k=2)\nknn vector_a 2\nID: vector_a, Vector: [0.5, 0.7, 0.2]\nID: vector_b, Vector: [0.1, 0.9, 0.4]\n\n# User performs element-wise addition of \"vector_a\" and \"vector_b\"\nvadd vector_a vector_b\n[0.6, 1.6, 0.6]\n\n# User scales \"vector_a\" by a factor of 2\nvscale vector_a 2.0\n[1.0, 1.4, 0.4]\n\n# User removes \"vector_a\" from the database\nremove vector_a\nOK\n\n# User attempts to retrieve \"vector_a\" again (expecting an error)\nget vector_a\nnull\n\n# Dump vemcache db\ndump vemcache.json\nDatabase dump successful: vemcache.json\n\n# User exits the session\nquit\nConnection closed by foreign host.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaizchishtie%2Fvemcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaizchishtie%2Fvemcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaizchishtie%2Fvemcache/lists"}