{"id":13453983,"url":"https://github.com/poloclub/mememo","last_synced_at":"2025-05-13T18:38:43.615Z","repository":{"id":221667352,"uuid":"749523899","full_name":"poloclub/mememo","owner":"poloclub","description":"A JavaScript library that brings vector search and RAG to your browser!","archived":false,"fork":false,"pushed_at":"2024-08-15T19:13:37.000Z","size":69974,"stargazers_count":105,"open_issues_count":1,"forks_count":10,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-24T05:38:01.314Z","etag":null,"topics":["browser","document-search","gen-ai","image-search","llm","rag","vector-database","vector-search"],"latest_commit_sha":null,"homepage":"https://poloclub.github.io/mememo/","language":"TypeScript","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/poloclub.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-28T20:21:53.000Z","updated_at":"2025-03-19T15:38:52.000Z","dependencies_parsed_at":"2024-10-28T21:45:57.164Z","dependency_job_id":null,"html_url":"https://github.com/poloclub/mememo","commit_stats":null,"previous_names":["poloclub/mememo"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poloclub%2Fmememo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poloclub%2Fmememo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poloclub%2Fmememo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poloclub%2Fmememo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poloclub","download_url":"https://codeload.github.com/poloclub/mememo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254004971,"owners_count":21998158,"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","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":["browser","document-search","gen-ai","image-search","llm","rag","vector-database","vector-search"],"created_at":"2024-07-31T08:00:50.016Z","updated_at":"2025-05-13T18:38:43.591Z","avatar_url":"https://github.com/poloclub.png","language":"TypeScript","funding_links":[],"categories":["SDKs \u0026 Libraries","TypeScript"],"sub_categories":[],"readme":"# MeMemo \u003ca href=\"https://poloclub.github.io/mememo/\"\u003e\u003cimg align=\"right\" src=\"./examples/rag-playground/src/images/icon-logo.svg\" height=\"38\"\u003e\u003c/img\u003e\u003c/a\u003e\n\n[![build](https://github.com/poloclub/mememo/actions/workflows/build.yml/badge.svg)](https://github.com/poloclub/mememo/actions/workflows/build.yml)\n[![npm](https://img.shields.io/npm/v/mememo?color=orange)](https://www.npmjs.com/package/mememo)\n[![license](https://img.shields.io/badge/License-MIT-blue)](https://github.com/poloclub/mememo/blob/main/LICENSE)\n[![arxiv badge](https://img.shields.io/badge/arXiv-2407.01972-red)](https://arxiv.org/abs/2407.01972)\n[![DOI:10.1145/3543873.3587362](https://img.shields.io/badge/DOI-10.1145/3626772.3657662-blue)](https://doi.org/10.1145/3626772.3657662)\n\nA JavaScript library that brings vector search and RAG to your browser!\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"3\"\u003e\u003ca href=\"https://poloclub.github.io/mememo\"\u003e\u003cimg src='https://i.imgur.com/4cDZQSz.png' width=\"100%\"\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\u003c/tr\u003e\n  \u003ctr\u003e\n     \u003ctd\u003e\u003ca href=\"https://poloclub.github.io/mememo/?dataset=paper\"\u003e🤖 ML Paper Reviewer\u003c/a\u003e\u003c/td\u003e\n     \u003ctd\u003e\u003ca href=\"https://poloclub.github.io/mememo/?dataset=diffusiondb\"\u003e🌠 Prompt Enhancer\u003c/a\u003e\u003c/td\u003e\n     \u003ctd\u003e\u003ca href=\"https://poloclub.github.io/mememo/?dataset=accident\"\u003e🌱 Responsible AI Assistant\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## What is MeMemo?\n\nMeMemo is a JavaScript library that adapts the state-of-the-art approximate nearest neighbor search technique HNSW to browser environments.\nDeveloped with modern and native Web technologies, such as IndexedDB and Web Workers, our toolkit leverages client-side hardware capabilities to enable researchers and developers to efficiently search through millions of high-dimensional vectors in browsers.\nMeMemo enables exciting new design and research opportunities, such as private and personalized content creation and interactive prototyping, as demonstrated in our example application RAG Playground.✨\n\n### Features\n\n\u003cvideo src=\"https://github.com/poloclub/mememo/assets/15007159/081ab670-a90a-464b-a9e6-e70b308314c9\"\u003e\u003c/video\u003e\n\n## Getting Started\n\n### Installation\n\nMeMemo supports both browser and Node.js environments. To install MeMemo, you can use `npm`:\n\n```bash\nnpm install mememo\n```\n\n### Vector Search and Storage in Browsers\n\nThen, you can create a vector index and do an approximate nearest neighbor search through two functions:\n\n```typescript\n// Import the HNSW class from the MeMemo module\nimport { HNSW } from 'mememo';\n\n// Creating a new index\nconst index = new HNSW({ distanceFunction: 'cosine' });\n\n// Inserting elements into our index in batches\nlet keys: string[];\nlet values: number[][];\nawait index.bulkInsert(keys, values);\n\n// Find k-nearest neighbors\nlet query: number[];\nconst { keys, distances } = await index.query(query, k);\n```\n\n## Developing MeMemo\n\nClone or download this repository:\n\n```bash\ngit clone git@github.com:poloclub/mememo.git\n```\n\nInstall the dependencies:\n\n```bash\nnpm install\n```\n\nUse Vitest for unit testing:\n\n```\nnpm run test\n```\n\n## Developing the RAG Playground Examples\n\nClone or download this repository:\n\n```bash\ngit clone git@github.com:poloclub/mememo.git\n```\n\nNavigate to the example folder:\n\n```bash\ncd ./examples/rag-playground\n```\n\nInstall the dependencies:\n\n```bash\nnpm install\n```\n\nThen run Loan Explainer:\n\n```\nnpm run dev\n```\n\nNavigate to localhost:3000. You should see three Explainers running in your browser :)\n\n## Credits\n\nMeMemo is created by \u003ca href='https://zijie.wang/' target='_blank'\u003eJay Wang\u003c/a\u003e and \u003ca href='' target='_blank'\u003ePolo Chau\u003c/a\u003e.\n\n## Citation\n\nTo learn more about MeMemo, check out our [research paper](https://arxiv.org/abs/2407.01972) published at SIGIR'24.\n\n```bibtex\n@inproceedings{wangMeMemoOndeviceRetrieval2024,\n  title = {{{MeMemo}}: {{On-device Retrieval Augmentation}} for {{Private}} and {{Personalized Text Generation}}},\n  booktitle = {Proceedings of the 47th {{International ACM SIGIR Conference}} on {{Research}} and {{Development}} in {{Information Retrieval}}},\n  author = {Wang, Zijie J. and Chau, Duen Horng},\n  year = {2024},\n  urldate = {2024-06-26},\n  langid = {english}\n}\n```\n\n## License\n\nThe software is available under the [MIT License](https://github.com/poloclub/mememo/blob/main/LICENSE).\n\n## Contact\n\nIf you have any questions, feel free to [open an issue](https://github.com/poloclub/mememo/issues/new) or contact [Jay Wang](https://zijie.wang).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoloclub%2Fmememo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoloclub%2Fmememo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoloclub%2Fmememo/lists"}