Sandbox
@Davidyz/VectorCode

Code repository indexing for LLMs and Neovim

VectorCode indexes a repository and exposes that indexed context to coding LLMs. It also ships a Neovim plugin and APIs for tool-calling or integrations, including MCP-based workflows.

873 stars49 forksPythonUpdated 6mo ago
Who it's for

Builders who want their agent to query project-specific code context instead of relying on memory alone.

What it delivers

You can give your agent task-relevant repo context and cut down hallucinations.

What it does

Repository indexing

Indexes the codebase so prompts can be built from real project content.

Chunking and file metadata

Breaks files into chunks and adds metadata so retrieval can return more useful pieces of code.

Project-root detection

Uses anchors like `.git` and project-level `.vectorcode/` files to find the right repository automatically.

Respect for ignore and include rules

Reads `.gitignore` and the `.vectorcode/vectorcode.include` / `.vectorcode/vectorcode.exclude` files to control what gets indexed.

Neovim plugin and Lua API

Provides Neovim APIs and plugin code for building or extending editor-side AI workflows.

MCP integration

Supports MCP-based connections so other tools can query the indexed repository context.

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

Files in the repo

Repository payload18 top-level entries
  • .github
  • .vectorcode
  • doc
  • docs
  • images
  • lua
  • plugin
  • src
  • tests
  • .gitignore
  • .pre-commit-config.yaml
  • LICENSE
  • Makefile
  • neovim.toml
  • pyproject.toml
  • README.md
  • selene.toml
  • stylua.toml

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More tools

JuliusBrussee/
caveman

🪨 why use many token when few token do trick — Claude Code skill that cuts 65% of tokens by talking like caveman

105k
1 add
MemPalace/
mempalace

The best-benchmarked open-source AI memory system. And it's free.

59k
stablyai/
orca

Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

66k

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

132k

Never stop coding. Free MIT AI gateway: one endpoint, 352 providers (150+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 550+ contributors

64k
headroomlabs-ai/
headroom

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

71k