VectorCode

DavidyzMIT更新放缓

把本地代码库切块并生成向量索引,通过 MCP 服务让 LLM 和 Neovim 按语义检索相关代码,省去手动翻文件。

A code repository indexing tool to supercharge your LLM experience.

0.7.20发布于 2025-12-15 05:49 UTC874star50fork同步于 2026-11-07 07:31 UTC

怎么上手

由 README 提炼,执行前请确认
pip install vectorcode
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

把代码仓库索引成向量库,为编码 LLM 注入任务相关上下文,减少幻觉

把本地代码库切块并生成向量索引,通过 MCP 服务让 LLM 和 Neovim 按语义检索相关代码,省去手动翻文件。

核心能力

  • 按语法语义切分代码块,基于 tree-sitter 实现
  • 用 Chroma 持久化客户端存储向量索引
  • 自动识别项目根目录并遵循 .gitignore
  • 提供 Neovim 插件与 Lua API 供 AI 插件调用
  • 支持查看和删除集合中的文件

容易踩的坑

项目处于 beta 阶段,0.x 版本 minor 号变更即含破坏性改动,建议锁定版本如 vectorcode<0.7.0;README 未给出具体 CLI 用法,需查阅 docs/cli.md;Neovim 插件需先完成 CLI 配置再使用

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本0.7.20
  1. 0.7.20Release 0.7.20最新正式版2025-12-15 · 2025-12-15 05:49 UTC

    📦 Uncategorized

    • feat: support CodeCompanion v18.0.0
      • PR: #301
  2. 0.7.19Release 0.7.192025-11-13 · 2025-11-13 11:55 UTC
    查看更新说明

    🐛 Fixes

    • Check for empty job runner output in async_check.
      • PR: #297
    • fix(nvim): convert vim.NIL args to nil in codecompanion tools
      • PR: #298
    • Ensure LSP progress ends even on failure
      • PR: #299
  3. 0.7.18Release 0.7.182025-09-26 · 2025-09-26 13:08 UTC
    查看更新说明

    🐛 Fixes

    • Fix type annotations and documentations for nvim plugin
      • PR: #289
    • Handle nil results in check
      • PR: #292
    • Use utils functions for path checks
      • PR: #293
  4. 0.7.17Release 0.7.172025-09-20 · 2025-09-20 03:32 UTC
    查看更新说明

    🐛 Fixes

    • Improved error propagation from cmd jobrunner
      • PR: #285
    • Fix filter condition for chunk inclusion
      • PR: #287
    • fix(codecompanion): improve error handling for empty stderr output
      • PR: #286
  5. 0.7.16Release 0.7.162025-09-04 · 2025-09-04 02:26 UTC
    查看更新说明

    🚀 Features

    • Add prompt library builder for codecompanion.nvim extension
      • PR: #264

    🐛 Fixes

    • Fix type annotation for summarisation adapter.
      • PR: #281

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    VectorCode

    codecov Test and Coverage pypi

    VectorCode is a code repository indexing tool. It helps you build better prompt for your coding LLMs by indexing and providing information about the code repository you're working on. This repository also contains the corresponding neovim plugin that provides a set of APIs for you to build or enhance AI plugins, and integrations for some of the popular plugins.

    [!NOTE] This project is in beta quality and is undergoing rapid iterations. I know there are plenty of rooms for improvements, and any help is welcomed.

    Why VectorCode?

    LLMs usually have very limited understanding about close-source projects, projects that are not well-known, and cutting edge developments that have not made it into releases. Their capabilities on these projects are quite limited. With VectorCode, you can easily (and programmatically) inject task-relevant context from the project into the prompt. This significantly improves the quality of the model output and reduce hallucination.

    asciicast

    Documentation

    [!NOTE] The documentation on the main branch reflects the code on the latest commit. To check for the documentation for the version you're using, you can check out the corresponding tags.

    • For the setup and usage of the command-line tool, see the CLI documentation;
    • For neovim users, after you've gone through the CLI documentation, please refer to the neovim plugin documentation (and optionally the lua API reference) for further instructions.
    • Additional resources:
      • the wiki for extra tricks and tips that will help you get the most out of VectorCode;
      • the discussions where you can ask general questions and share your cool usages about VectorCode.
      • If you're feeling adanvturous, feel free to check out the pull requests for WIP features.

    If you're trying to contribute to this project, take a look at the contribution guide, which contains information about some basic guidelines that you should follow and tips that you may find helpful.

    About Versioning

    This project follows an adapted semantic versioning:

    • Until 1.0.0 is released, the major version number stays 0 which indicates that this project is still in early stage, and features/interfaces may change from time to time;
    • The minor version number indicates breaking changes. When I decide to remove a feature/config option, the actual removal will happen when I bump the minor version number. Therefore, if you want to avoid breaking a working setup, you may choose to use a version constraint like "vectorcode<0.7.0";
    • The patch version number indicates non-breaking changes. This can include new features and bug fixes. When I decide to deprecate things, I will make a new release with bumped patch version. Until the minor version number is bumped, the deprecated feature will still work but you'll see a warning. It's recommended to update your setup to adapt the new features.

    TODOs

    • query by file path excluded paths;
    • chunking support;
      • add metadata for files;
      • chunk-size configuration;
      • smarter chunking (semantics/syntax based), implemented with py-tree-sitter and tree-sitter-language-pack;
      • configurable document selection from query results.
    • NeoVim Lua API with cache to skip the retrieval when a project has not been indexed Returns empty array instead;
    • job pool for async caching;
    • persistent-client;
    • proper remote Chromadb support (with authentication, etc.);
    • respect .gitignore;
    • implement some sort of project-root anchors (such as .git or a custom .vectorcode.json) that enhances automatic project-root detection. Implemented project-level .vectorcode/ and .git as root anchor
    • ability to view and delete files in a collection;
    • joint search (kinda, using codecompanion.nvim/MCP);
    • Nix support (unofficial packages here);
    • Query rewriting (#124).

    Credit

    Special Thanks

    JetBrains logo.

    Star History

    Star History Chart