Skip to content

Commit 31cea4c

Browse files
committed
update readme
1 parent c0e1acd commit 31cea4c

1 file changed

Lines changed: 45 additions & 34 deletions

File tree

README.md

Lines changed: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
11
# Code-RAG
22

3+
[![PyPI version](https://img.shields.io/pypi/v/code-rag-mcp.svg)](https://pypi.org/project/code-rag-mcp/)
4+
[![Build Status](https://github.com/qduc/code-rag/actions/workflows/ci.yml/badge.svg)](https://github.com/qduc/code-rag/actions)
5+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6+
[![Python Versions](https://img.shields.io/pypi/pyversions/code-rag-mcp.svg)](https://pypi.org/project/code-rag-mcp/)
7+
38
**Semantic code search for your entire codebase.** Ask questions in plain English, get relevant code snippets with source locations.
49

510
Instead of grepping for function names, ask "authentication logic" and find all related auth code across your project.
611

12+
## Table of Contents
13+
14+
- [Quick Start](#quick-start)
15+
- [Example (CLI)](#example-cli)
16+
- [Why Use Code-RAG?](#why-use-code-rag)
17+
- [Use with Claude Code (MCP Integration)](#use-with-claude-code-mcp-integration)
18+
- [Configuration](#configuration)
19+
- [How It Works](#how-it-works)
20+
- [API Usage](#api-usage)
21+
- [Supported Languages](#supported-languages)
22+
- [Requirements](#requirements)
23+
- [Troubleshooting](#troubleshooting)
24+
- [Development](#development)
25+
- [Contributing](#contributing)
26+
727
## Quick Start
828

929
```bash
@@ -14,31 +34,10 @@ source .venv/bin/activate
1434
# Install
1535
pip install -e .
1636

17-
# Start the MCP server (default)
18-
code-rag
19-
20-
# Or use the interactive CLI search
37+
# Use the interactive CLI search
2138
code-rag-cli
22-
```
23-
24-
## Example (CLI)
25-
26-
```
27-
$ code-rag-cli --path /home/user/myproject
28-
29-
Processing codebase... Found 247 files
30-
Indexed 1,234 chunks in 12s
3139

32-
Query: authentication logic
33-
34-
Result 1 | Similarity: 0.85
35-
File: src/code_rag/auth/authenticator.py (lines 45-78)
36-
37-
class Authenticator:
38-
"""Handle user authentication and session management."""
39-
40-
def authenticate(self, username: str, password: str) -> bool:
41-
...
40+
# To use as MCP server see below section
4241
```
4342

4443
## Why Use Code-RAG?
@@ -52,24 +51,36 @@ class Authenticator:
5251

5352
Code-RAG works as an MCP server, letting Claude automatically search your codebase during conversations.
5453

54+
> **Note on `uv`:** Many examples below use [uv](https://github.com/astral-sh/uv) (specifically `uvx`) for fast, zero-config execution. If you don't have `uv` installed, you can use standard `pip` or `npx` (if using a wrapper).
55+
5556
### Quick Setup
5657

57-
**Option 1: Using uvx (after publishing to PyPI)**
58+
**Option 1: Using uvx (Recommended)**
5859
```bash
59-
# Claude Desktop (config.json)
60-
claude mcp add code-rag
60+
# Install uv first: https://github.com/astral-sh/uv
6161

62-
# Or with Claude Code
62+
# Claude Code
6363
claude mcp add code-rag --transport stdio uvx code-rag-mcp
6464
```
6565

66-
**Option 2: Local installation**
66+
**Option 2: Using pip (Standard)**
67+
```bash
68+
# Install in your environment
69+
pip install code-rag-mcp
70+
71+
# Register with Claude Code using the absolute path to the binary
72+
claude mcp add code-rag --transport stdio $(which code-rag-mcp)
73+
```
74+
75+
**Option 3: Local development installation**
6776
```bash
68-
# Install in virtual environment
77+
# Clone and install
78+
git clone https://github.com/qduc/code-rag.git
79+
cd code-rag
6980
pip install -e .
7081

7182
# Register with Claude Code
72-
claude mcp add code-rag --transport stdio path/to/venv/bin/code-rag-mcp
83+
claude mcp add code-rag --transport stdio $(pwd)/.venv/bin/code-rag-mcp
7384
```
7485

7586
### Configuration
@@ -103,12 +114,12 @@ claude mcp add code-rag --transport stdio uvx code-rag-mcp
103114

104115
**Common Configuration Options**:
105116
- `CODE_RAG_EMBEDDING_MODEL` - Embedding model (default: `nomic-ai/CodeRankEmbed`)
106-
- `nomic-ai/CodeRankEmbed` - Code-optimized, runs locally
107-
- `text-embedding-3-small` - OpenAI embeddings (requires `OPENAI_API_KEY`)
117+
- `nomic-ai/CodeRankEmbed` - Code-optimized, runs locally, requires GPU for best performance
118+
- `text-embedding-3-small` - OpenAI embeddings, no GPU required (requires `OPENAI_API_KEY`)
108119
- `CODE_RAG_DATABASE_TYPE` - Database backend: `chroma` or `qdrant` (default: `chroma`)
109120
- `CODE_RAG_CHUNK_SIZE` - Chunk size in characters (default: `1024`)
110-
- `CODE_RAG_RERANKER_ENABLED` - Enable result reranking (default: `false`)
111-
- `CODE_RAG_SHARED_SERVER` - Share embedding server across instances (default: `true`)
121+
- `CODE_RAG_RERANKER_ENABLED` - Enable result reranking, may yield better results but slower (default: `false`)
122+
- `CODE_RAG_SHARED_SERVER` - Share embedding server across instances, reduce memory footprint (default: `true`)
112123

113124
**Example with OpenAI embeddings**:
114125
```json

0 commit comments

Comments
 (0)