给AI写代码时配个专属资料库,速度提升25倍
AI写代码时总得翻遍整个代码库找上下文,就像每次写文章都要重读整本书。CodeNib给每个代码版本建了三种索引(关键词、语义、结构),让AI能直接定位到具体函数或变量,不用反复搜索。实测中,更新索引比从头重建快8.7到25.4倍,AI找代码的速度也比传统方法快4.7倍。虽然它不是你明天就能用的工具,但指明了方向:未来AI写代码会更像人类——带着记忆工作,而不是每次从头翻书。
📄 原文摘要(英文)
Coding agents repeatedly search, navigate, and retain context from evolving repositories, but disconnected indexes, language servers, and task-local histories force repeated discovery and obscure lifecycle costs. CodeNib builds reusable lexical, dense, and structural views per repository commit, maps outputs to repository-relative source ranges, maintains selected views across edits, and serves ranked search, symbol navigation, and bounded context through one runtime. Across 100 snapshots, we map quality-cost frontiers across the repository-context lifecycle. When outputs match an independent rebuild, graph and vector updates are 8.7times and 25.4times faster at the median. On the static-navigation subset matching normalized live-server locations (63% of 1,000 requests), the median per-request live/static latency ratio is 4.7times. Across five models, selected context policies preserve localization with 50--87% fewer trajectory tokens than paired grep/read. Together, these results support multi-view repository-context serving with explicit, operation-specific validity boundaries.