Local-first, AST-aware code search and explain for JavaScript/TypeScript workspaces, with optional agent assistance.
CodeRAG Agent is a VS Code extension plus a local backend that helps you index a JS/TS repository, search it semantically, explain implementation details, and optionally ask an agent grounded in your own codebase.
This project is intentionally scoped as a focused code understanding tool. It is not trying to compete with full general-purpose coding agents.
CodeRAG Agent is in a stable portfolio release state.
- Supported indexing targets: JavaScript / TypeScript workspaces only
- Primary workflow:
Build Index -> Search -> Explain - Agent support: available as an optional enhancement
- Deployment model: local-first backend with Docker
- AST-aware chunking instead of naive fixed-size text slicing
- Workspace-isolated indexes stored in Chroma
- One-click index building from the current VS Code workspace
- Search results that link back to source locations
- Evidence-grounded explanations over retrieved code
- Optional agent flow that can search before answering
CodeRAG currently supports:
.js,.jsx,.ts,.tsx,.mjs,.cjs- local backend deployment through Docker Compose
- workspace-aware search, explain, and agent requests
CodeRAG does not currently promise:
- production-grade multi-language support
- autonomous coding workflows
- parity with large hosted coding agents
-
VS Code extension
- Commands:
Search,Explain,Agent,Build Index - Uploads the current workspace as a zip archive
- Sends
x-workspace-idon all RAG requests
- Commands:
-
Backend API
- FastAPI routes for indexing, search, explain, streaming explain, and agent explain
- Redis + RQ for background indexing jobs
- Request-scoped LLM provider selection
-
Indexing pipeline
- Tree-sitter chunking for JS/TS code structure
- Chroma persistent collections per workspace
- Hybrid ranking with semantic similarity plus symbol-aware boosting
git clone https://github.com/myshkin451/code-rag
cd code-rag
cp .env.example .env
docker compose up -d --buildBackend default:
- API:
http://127.0.0.1:8000
Install CodeRAG Agent from the VS Code Marketplace, then set:
rag.apiBaserag.apiKeyif you want to override the backend API key per clientrag.providerOverrideif you want to forceopenai,local, orqwen_api
- Run
RAG: Build Index (Current Workspace) - Run
RAG: Search Code - Run
RAG: Explain Selection - Optionally run
RAG: Ask Code Agent
RAG: Build Index (Current Workspace)RAG: Search CodeRAG: Explain SelectionRAG: Ask Code Agent
- Docker
- Git
- An OpenAI-compatible model endpoint for the best Explain / Agent experience
Provider notes:
openai: best-tested path for agent behaviorlocal: supported through an OpenAI-compatible local endpointqwen_api: supported through the same request-scoped provider pipeline as Explain
api/: FastAPI routes and request handlingai/: provider logic and agent behaviorindexer/: chunking and Chroma ingestretriever/: hybrid retrieval logicclients/vscode/: extension sourceeval/: lightweight evaluation scripts
Useful checks for this repository:
python3 -m compileall api ai indexer retriever eval
curl http://127.0.0.1:8000/ping
python3 eval/run_eval.pyFor the VS Code extension:
cd clients/vscode
npm install
npm run build- Indexing is intentionally limited to JS/TS workspaces
- Agent mode is a secondary capability, not the core product story
- Large monorepos may require tuning zip size, chunking, and retrieval parameters
- Config files under
configs/document defaults, but not every value is dynamically loaded yet
这是一个面向 JavaScript / TypeScript 仓库的本地优先代码理解工具,核心链路是:
- 构建索引
- 搜索代码
- 解释实现
- 可选使用 Agent 做进一步问答
它的重点是把代码检索和解释做好,而不是把自己包装成全能型 coding agent。


