A powerful AI-powered code assistant that uses Retrieval Augmented Generation (RAG) with local LLM processing for privacy and enhanced context-awareness.
- Local Code Understanding: Uses Ollama with the deepseek-r1:8b model for code explanations
- Context-Aware Responses: Leverages RAG with CodeT5 embeddings and Pinecone vector database
- Codebase Indexing: Intelligent chunking and embedding of your codebase
- VS Code Extension: Seamlessly integrated into your development workflow
- CLI Application: Also available as a command-line tool
This project consists of two main components:
- VS Code Extension: Provides code explanation directly in your editor
- CLI Application: Command-line interface for code explanations
- Node.js (v14 or higher)
- Ollama with the deepseek-r1:8b model installed
- Pinecone account with an index created (dimension: 768)
-
Install the extension from the VSIX file:
code --install-extension fix-extension/sarvx-code-ai-assistant-0.1.0.vsix -
The extension provides the following commands:
Code AI Assistant: Test Connections- Test connections to Ollama and PineconeCode AI Assistant: Explain Selected Code (Simple)- Explain the selected code
- Run the CLI application:
node cli-app-fixed.js explain "your code here"
Before using the assistant, you need to index your codebase:
- Configure your Pinecone API key in
index-repo.cjs - Run the indexing script:
node index-repo.cjs /path/to/your/codebase
- Embeddings: Uses CodeT5 model to create embeddings of code chunks
- Vector Database: Pinecone stores code embeddings for retrieval
- Local LLM: Ollama runs the deepseek-r1:8b model locally for privacy
- Retrieval: Similar code context is retrieved to enhance explanations
This project is licensed under the MIT License - see the LICENSE file for details.