展示HN:构建代码代理?尝试快速的代码嵌入模型,效果更佳。

1作者: islogan大约 1 个月前原帖
我们是一小组对构建人机协作编码代理感兴趣的本科生。我们梦想着一个世界,在这个世界里,构建复杂的代理工作流程就像玩乐高一样简单和富有创意。 在我们构建项目时,我们需要一个工具,能够轻松尝试不同的代码嵌入模型,以便了解哪些模型在不同场景下表现最佳,并理解它们的优缺点。 为了加快这一过程,我们开发了PurpleSearch,一个针对本地代码库的“即时”搜索引擎。这个工具让你可以快速将任何开源嵌入模型部署到实际应用中,使其能力可视化并易于理解。请查看演示视频。 流程: 选择任何Java项目。我们将其转化为代码图,嵌入图中的代码片段并进行索引。然后,你可以查询代码片段索引。我们将返回排名前10的代码片段以及围绕它们的子图,以便更深入地理解上下文(我们称之为集群)。我们将这些集群输入到一个大型语言模型(LLM)中,利用它们作为上下文来回答你的查询。 Purple Search! 演示视频: [https://www.youtube.com/watch?v=aglrXDLoOhQ](https://www.youtube.com/watch?v=aglrXDLoOhQ) Github: [https://github.com/logantucker25/PurpleSearch](https://github.com/logantucker25/PurpleSearch) 注意:这个工具可能还有些粗糙,偶尔会出现卡顿。它尚未经过全面测试,适用于我们的小组以外的使用。我们希望它能对某些人有所帮助……如果是这样,请随意对这段代码进行修改,使其更符合你的需求。欢迎提交PR。
查看原文
We are a small group of undergrads interested in building human in the loop coding agents. We dream of a world where building complex agent workflows feels as simple and creative as playing with legos.<p>When we were building stuff we needed a tool that made it easy to try out different code embedding models so that we could see which ones worked best in different scenarios and understand their strengths and weaknesses.<p>So to speed that process up we made PurpleSearch an &#x27;instant&#x27; search engine for your local codebases. This tool lets you quickly deploy any open source embedding model on hugging face into a real application that makes their capabilities visual and easy to digest. Check out the demo vid.<p>The flow: Pick any Java project. We&#x27;ll turn it into a code graph, embed code snippets from the graph and index them. Then you can query the code snippet index. We&#x27;ll return the 10 highest ranking snippets and the the subgraph that surrounds them for deeper contextual understanding (we call it a cluster). We feed these clusters into an LLM who uses them as context to answer your query.<p>Purple Search!<p>Demo video: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=aglrXDLoOhQ" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=aglrXDLoOhQ</a><p>Github: <a href="https:&#x2F;&#x2F;github.com&#x2F;logantucker25&#x2F;PurpleSearch">https:&#x2F;&#x2F;github.com&#x2F;logantucker25&#x2F;PurpleSearch</a><p>note: This tool might be a little rough around the edges and occasionally get hung up. It hasnt been fully tested for use outside of our small group. We hope that it is useful to someone out there... if so feel free add to this code in any way that you like and make it into whatever suits you best. PRs welcome.