📄 中文摘要
构建了一个轻量级的 AI 代理记忆系统,最初使用 TF-IDF 关键字搜索,简单快速且无依赖。然而,关键字搜索存在局限性,无法处理语义相似的查询。为了解决这一问题,考虑使用 sentence-transformers 和 numpy,但这将引入 2GB 的 PyTorch,违背了零依赖的初衷。通过创新的方法,成功在不增加任何依赖的情况下实现了向量搜索功能。
📄 English Summary
Adding Vector Search to a Zero-Dependency Python Package
A lightweight memory system for AI agents was built, initially utilizing TF-IDF keyword search, which is simple, fast, and dependency-free. However, keyword search has limitations, particularly in handling semantically similar queries. To address this, using sentence-transformers and numpy was considered, but this would introduce 2GB of PyTorch, contradicting the goal of zero dependencies. An innovative approach was developed to implement vector search without adding any dependencies.
Powered by Cloudflare Workers + Payload CMS + Claude 3.5
数据源: OpenAI, Google AI, DeepMind, AWS ML Blog, HuggingFace 等