Metadata-Version: 2.1
Name: VectorCode
Version: 0.5.7
Summary: A tool to vectorise repositories for RAG.
Author-Email: Davidyz <hzjlyz@gmail.com>
License: MIT
Project-URL: homepage, https://github.com/Davidyz/VectorCode
Project-URL: github, https://github.com/Davidyz/VectorCode
Project-URL: documentation, https://github.com/Davidyz/VectorCode/blob/main/docs/cli.md
Requires-Python: <3.14,>=3.11
Requires-Dist: chromadb<=0.6.3
Requires-Dist: sentence-transformers
Requires-Dist: pathspec
Requires-Dist: tabulate
Requires-Dist: shtab
Requires-Dist: numpy
Requires-Dist: psutil
Requires-Dist: httpx
Requires-Dist: tree-sitter
Requires-Dist: tree-sitter-language-pack
Requires-Dist: pygments
Requires-Dist: transformers!=4.51.0,!=4.51.1,!=4.51.2,>=4.36.0
Requires-Dist: wheel<0.46.0
Requires-Dist: colorlog
Provides-Extra: legacy
Requires-Dist: numpy<2.0.0; extra == "legacy"
Requires-Dist: torch==2.2.2; extra == "legacy"
Requires-Dist: transformers<=4.49.0; extra == "legacy"
Provides-Extra: intel
Requires-Dist: optimum[openvino]; extra == "intel"
Requires-Dist: openvino; extra == "intel"
Provides-Extra: lsp
Requires-Dist: pygls<2.0.0; extra == "lsp"
Requires-Dist: lsprotocol; extra == "lsp"
Provides-Extra: mcp
Requires-Dist: mcp<2.0.0; extra == "mcp"
Requires-Dist: pydantic; extra == "mcp"
Description-Content-Type: text/markdown

# VectorCode

[![codecov](https://codecov.io/github/Davidyz/VectorCode/branch/main/graph/badge.svg?token=TWXLOUGG66)](https://codecov.io/github/Davidyz/VectorCode)
[![Test and Coverage](https://github.com/Davidyz/VectorCode/actions/workflows/test_and_cov.yml/badge.svg)](https://github.com/Davidyz/VectorCode/actions/workflows/test_and_cov.yml)
[![pypi](https://img.shields.io/pypi/v/vectorcode.svg)](https://pypi.org/project/vectorcode/)

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 because that's what I used to write this tool.

> [!NOTE]
> This project is in beta quality and only implements very basic retrieval and
> embedding functionalities. There are plenty of rooms for improvements and any
> help is welcomed.

> [!NOTE]
> [Chromadb](https://www.trychroma.com/), the vector database backend behind
> this project, supports multiple embedding engines. I developed this tool using
> SentenceTransformer, but if you encounter any issues with a different embedding 
> function, please open an issue (or even better, a pull request :D).

<!-- mtoc-start -->

* [Why VectorCode?](#why-vectorcode)
* [Documentation](#documentation)
* [TODOs](#todos)
* [Credit](#credit)

<!-- mtoc-end -->

## 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.
![](./images/codecompanion_chat.png)

## Documentation

> [!NOTE]
> The documentation on the `main` branch reflects the code on the latest commit
> (apologies if I forget to update the docs, but this will be what I aim for). To
> check for the documentation for the version you're using, you can [check out
> the corresponding tags](https://github.com/Davidyz/VectorCode/tags).

- For the setup and usage of the command-line tool, see [the CLI documentation](./docs/cli.md);
- For neovim users, after you've gone through the CLI documentation, please refer to 
  [the neovim plugin documentation](./docs/neovim.md) for further instructions.
- Additional resources:
  - the [wiki](https://github.com/Davidyz/VectorCode/wiki) for extra tricks and
    tips that will help you get the most out of VectorCode;
  - the [discussions](https://github.com/Davidyz/VectorCode/discussions) where
    you can ask general questions and share your cool usages about VectorCode.

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

## TODOs
- [x] query by ~file path~ excluded paths;
- [x] chunking support;
  - [x] add metadata for files;
  - [x] chunk-size configuration;
  - [x] smarter chunking (semantics/syntax based), implemented with
    [py-tree-sitter](https://github.com/tree-sitter/py-tree-sitter) and
    [tree-sitter-language-pack](https://github.com/Goldziher/tree-sitter-language-pack);
  - [x] configurable document selection from query results.
- [x] ~NeoVim Lua API with cache to skip the retrieval when a project has not
  been indexed~ Returns empty array instead;
- [x] job pool for async caching;
- [x] [persistent-client](https://docs.trychroma.com/docs/run-chroma/persistent-client);
- [-] proper [remote Chromadb](https://docs.trychroma.com/production/administration/auth) support (with authentication, etc.);
- [x] respect `.gitignore`;
- [x] 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 (atm you can only `drop`
  and `vectorise` again);
- [x] joint search (kinda, using codecompanion.nvim/MCP).

## Credit

- Thank [@milanglacier](https://github.com/milanglacier) (and [minuet-ai.nvim](https://github.com/milanglacier/minuet-ai.nvim)) for the support when this project was still in early stage;
- Thank [@olimorris](https://github.com/olimorris) for the help (personally and
  from [codecompanion.nvim](https://github.com/olimorris/codecompanion.nvim))
  when this project made initial attempts at tool-calling;
- Thank [@ravitemer](https://github.com/ravitemer) for the help to interface
  VectorCode with [MCP](https://modelcontextprotocol.io/introduction).
