mememo
v0.1.0
一个将矢量搜索和抹布带到浏览器的JavaScript库!
| ? ML纸审稿人 | ?提示增强器 | ?负责的AI助手 |
Mememo是一个JavaScript库,它将最新的近似邻居搜索技术HNSW适应浏览器环境。我们的工具包采用现代和本地网络技术(例如IndexEdDB和Web Workers)开发,利用客户端硬件功能使研究人员和开发人员能够通过浏览器中的数百万高维矢量进行有效搜索。 Mememo可以使令人兴奋的新设计和研究机会,例如私人和个性化的内容创建和交互式原型制作,如我们的示例应用程序抹布游乐场所示。
Mememo支持浏览器和Node.js环境。要安装Mememo,您可以使用npm :
npm install mememo然后,您可以创建一个向量索引,并通过两个功能进行大约最近的邻居搜索:
// Import the HNSW class from the MeMemo module
import { HNSW } from 'mememo' ;
// Creating a new index
const index = new HNSW ( { distanceFunction : 'cosine' } ) ;
// Inserting elements into our index in batches
let keys : string [ ] ;
let values : number [ ] [ ] ;
await index . bulkInsert ( keys , values ) ;
// Find k-nearest neighbors
let query : number [ ] ;
const { keys , distances } = await index . query ( query , k ) ; 克隆或下载此存储库:
git clone [email protected]:poloclub/mememo.git安装依赖项:
npm install使用Vitest进行单元测试:
npm run test
克隆或下载此存储库:
git clone [email protected]:poloclub/mememo.git导航到示例文件夹:
cd ./examples/rag-playground安装依赖项:
npm install然后运行贷款解释器:
npm run dev
导航到Localhost:3000。您应该看到三个在浏览器中运行的解释器:)
Mememo是由Jay Wang和Polo Chau创建的。
要了解有关Mememo的更多信息,请查看我们在Sigir'24上发表的研究论文。
@inproceedings { wangMeMemoOndeviceRetrieval2024 ,
title = { {{MeMemo}}: {{On-device Retrieval Augmentation}} for {{Private}} and {{Personalized Text Generation}} } ,
booktitle = { Proceedings of the 47th {{International ACM SIGIR Conference}} on {{Research}} and {{Development}} in {{Information Retrieval}} } ,
author = { Wang, Zijie J. and Chau, Duen Horng } ,
year = { 2024 } ,
urldate = { 2024-06-26 } ,
langid = { english }
}该软件可根据MIT许可证获得。
如果您有任何疑问,请随时打开问题或联系Jay Wang。