You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Note**: This POC was innovative for its time, but modern tools like Cursor and Windsurf now apply this principle directly in IDEs. This remains an excellent educational project for understanding RAG implementation.
8
8
@@ -14,7 +14,7 @@ CodeRAG combines **Retrieval-Augmented Generation (RAG)** with AI to provide int
14
14
15
15
Most coding assistants work with limited scope, but CodeRAG provides the full context of your project by:
16
16
-**Real-time indexing** of your entire codebase using FAISS vector search
17
-
-**Semantic code search** powered by OpenAI embeddings
17
+
-**Semantic code search** powered by OpenAI embeddings
18
18
-**Contextual AI responses** that understand your project structure
19
19
20
20
## 🚀 Quick Start
@@ -34,14 +34,17 @@ cd CodeRAG
34
34
python -m venv venv
35
35
source venv/bin/activate # On Windows: venv\\Scripts\\activate
36
36
37
-
# Install dependencies
37
+
# Install dependencies (installs the package with dev extras)
38
38
pip install -r requirements.txt
39
39
40
40
# Configure environment
41
41
cp example.env .env
42
42
# Edit .env with your OpenAI API key and settings
43
43
```
44
44
45
+
> The requirements file simply references `-e .[dev]`; feel free to run
46
+
> `pip install -e .[dev]` directly if you prefer editable installs.
47
+
45
48
### Configuration
46
49
47
50
Create a `.env` file with your settings:
@@ -63,6 +66,9 @@ python main.py
63
66
64
67
# In a separate terminal, start the web interface
65
68
streamlit run app.py
69
+
70
+
# Query the local index from the terminal (after indexing completes)
71
+
coderag-cli "how is faiss configured?"
66
72
```
67
73
68
74
## 📖 How It Works
@@ -88,7 +94,7 @@ graph LR
88
94
89
95
```
90
96
CodeRAG/
91
-
├── 🧠 coderag/ # Core RAG functionality
97
+
├── 🧠 coderag/ # Core RAG functionality
92
98
│ ├── config.py # Environment configuration
93
99
│ ├── embeddings.py # OpenAI embedding generation
94
100
│ ├── index.py # FAISS vector operations
@@ -103,7 +109,7 @@ CodeRAG/
103
109
### Key Components
104
110
105
111
-**🔍 Vector Search**: FAISS-powered similarity search for code retrieval
106
-
-**🎯 Smart Embeddings**: OpenAI embeddings capture semantic code meaning
112
+
-**🎯 Smart Embeddings**: OpenAI embeddings capture semantic code meaning
107
113
-**📡 Real-time Updates**: Watchdog monitors file changes for live indexing
108
114
-**💬 Conversational UI**: Streamlit interface with chat-like experience
109
115
@@ -116,7 +122,7 @@ CodeRAG/
116
122
"Show me examples of the embedding generation process"
117
123
```
118
124
119
-
### Get Improvements
125
+
### Get Improvements
120
126
```
121
127
"How can I optimize the search performance?"
122
128
"What are potential security issues in this code?"
@@ -125,7 +131,7 @@ CodeRAG/
125
131
126
132
### Debug Issues
127
133
```
128
-
"Why might the search return no results?"
134
+
"Why might the search return no results?"
129
135
"How do I troubleshoot OpenAI connection issues?"
130
136
"What could cause indexing to fail?"
131
137
```
@@ -138,11 +144,7 @@ CodeRAG/
138
144
# Install pre-commit hooks
139
145
pip install pre-commit
140
146
pre-commit install
141
-
142
-
# Run formatting and linting
143
-
black .
144
-
flake8 .
145
-
mypy .
147
+
pre-commit run --all-files
146
148
```
147
149
148
150
### Testing
@@ -165,7 +167,7 @@ python scripts/run_monitor.py
165
167
- Verify OpenAI API key is working
166
168
- Ensure your query relates to indexed Python files
167
169
168
-
**OpenAI API errors**
170
+
**OpenAI API errors**
169
171
- Verify API key in `.env` file
170
172
- Check API usage limits and billing
171
173
- Ensure model names are correct (gpt-4, text-embedding-ada-002)
0 commit comments