AutoDoc: Ask Your Codebase
Chat with your codebase from inside VS Code, using a local, private retrieval-augmented generation (RAG) pipeline. Your code never leaves your machine.
AutoDoc parses your project with tree-sitter, stores functions, classes and methods in a local ChromaDB index, and answers questions with a quantized LLaMA model running on ONNX Runtime. Every answer comes with clickable sources that jump to the exact file and line.
Features
- Chat sidebar. Ask questions about the open workspace. Answers stream in as they are generated.
- Clickable sources. See which functions and classes an answer is based on, and open them with one click.
- Explain Selection / Explain File. Select code and press
Ctrl+Alt+E (Cmd+Alt+E on Mac), or right-click a file or editor tab and choose AutoDoc: Explain Current File. Asking "explain this file" in chat also uses the open file.
- Index Workspace. Index or re-index the open folder. Re-indexing replaces old chunks, so edited and deleted code doesn't linger.
- Filters. Limit retrieval to a language (Python, JS, TS, Rust, Go) or chunk type (function, class, method, module).
- Server management. The extension starts the AutoDoc server for you and shows its status in the status bar.
Requirements
Preview. This extension is the front end for the AutoDoc Python server, which runs on your machine. Plan on about 10 minutes of one-time setup and a 3.4 GB model download.
- Python 3.10 or newer, and Git
- About 5 GB of free disk space and about 4 GB of free RAM while answering
- Windows, macOS or Linux (tested on Windows 11)
1. Install the AutoDoc server
git clone https://github.com/Rishabh-0202/autodoc autodoc
cd autodoc
python -m venv .venv
.\.venv\Scripts\Activate.ps1 # macOS/Linux: source .venv/bin/activate
pip install -e .
2. Download a model (about 3.4 GB)
hf download onnx-community/Llama-3.2-3B-Instruct-GENAI-ONNX --include "cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/*" --local-dir models/llama-3.2-3b
Then create a file named .env in the autodoc folder containing:
MODEL_PATH=models/llama-3.2-3b/cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4
Without a model, indexing and search still work, but answers are disabled.
3. Connect the extension
Click AutoDoc: set up in the status bar (or run AutoDoc: Choose AutoDoc Folder… from the Command Palette) and pick the autodoc folder from step 1.
Usage
- Open a project and click the AutoDoc icon in the activity bar.
- Click Index this workspace (or the database icon in the view title).
- Ask a question, or select code and run AutoDoc: Explain Selection.
The first question starts the server and loads the model, which can take 15-30 seconds.
Settings
| Setting |
Default |
Description |
autodoc.serverUrl |
http://127.0.0.1:8000 |
URL of the AutoDoc API |
autodoc.serverDirectory |
(empty) |
Your AutoDoc folder (holds .env, models/, data/). Its .venv is used automatically. |
autodoc.serverCommand |
(empty) |
Explicit path to the autodoc executable |
autodoc.autoStartServer |
true |
Start the server automatically when needed |
autodoc.topK |
5 |
Code chunks retrieved per question. Fewer is faster. |
autodoc.maxTokens |
0 |
Maximum answer length (0 = server default). Lower is faster. |
autodoc.temperature |
null |
Sampling temperature (null = server default) |
Commands
| Command |
What it does |
| AutoDoc: Ask a Question |
Ask from an input box |
| AutoDoc: Explain Selection |
Explain the selected code (or the whole file if nothing is selected) |
| AutoDoc: Explain Current File |
Explain the open file |
| AutoDoc: Choose AutoDoc Folder… |
Point the extension at your AutoDoc install |
| AutoDoc: Index Workspace |
Index (or refresh) the open folder |
| AutoDoc: Re-index Workspace (Clear Existing Data) |
Delete the whole index, then index this folder |
| AutoDoc: Start Server / Stop Server |
Control the local server |
| AutoDoc: Show Server Log |
Open the server output |
| AutoDoc: Clear Chat |
Clear the conversation |
Privacy
Everything runs locally: parsing, embeddings, the vector index and the language model. The extension only talks to the AutoDoc server URL you configure (localhost by default).
Known limitations
- A 3B model on a laptop CPU is slow (several tokens per second) and can misread code. Always check the sources.
- Each question is answered on its own; follow-up questions don't see earlier ones.
- Supported languages: Python, JavaScript, TypeScript, Rust, Go.
Feedback
Found a bug or have an idea? Open an issue at https://github.com/Rishabh-0202/autodoc/issues.