Skip to content

Commit 73ec24f

Browse files
committed
docs: add RagCode vs Generic RAG comparison section
Explains key differentiators: - Semantic chunking (functions/classes) vs arbitrary text splits - Rich metadata (name, type, params, deps, lines) vs filename only - Relationship tracking (inheritance, method calls, imports) - AST parsing per language vs treating code as plain text - Exact + semantic search combined - Complete runnable code units vs fragments Includes visual example showing the difference in AI assistant responses.
1 parent c09f1c2 commit 73ec24f

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,43 @@ Without RagCode, AI assistants must:
107107

108108
**Bottom Line:** RagCode gives you enterprise-grade AI code search with zero privacy concerns and zero ongoing costs.
109109

110+
### 🧠 RagCode vs Generic RAG Systems
111+
112+
Most RAG systems treat code like plain text - they split files into arbitrary chunks of N tokens without understanding the code structure. **RagCode is different.**
113+
114+
| Aspect | Generic RAG | RagCode |
115+
|--------|-------------|---------|
116+
| **Chunking** | Arbitrary text splits (512 tokens) | Semantic units (functions, classes, methods) |
117+
| **Context** | Random text fragments | Complete code entities with full context |
118+
| **Metadata** | Filename only | Name, type, parameters, return type, dependencies, line numbers |
119+
| **Relationships** | None | Knows `UserController` uses `UserService`, inheritance chains |
120+
| **Search** | Semantic similarity only | Exact name match + semantic similarity combined |
121+
| **Language Awareness** | Treats all text the same | AST parsing per language (Go, PHP, Python) |
122+
| **Results** | May return partial functions | Always returns complete, runnable code units |
123+
124+
**Why this matters for AI assistants:**
125+
126+
```
127+
❌ Generic RAG returns:
128+
"...the user authentication logic checks the token
129+
and validates against the database. If valid, it..."
130+
→ AI sees fragment, must guess the rest
131+
132+
✅ RagCode returns:
133+
func AuthenticateUser(token string) (*User, error) {
134+
// Complete function with all context
135+
user, err := db.FindByToken(token)
136+
if err != nil { return nil, ErrInvalidToken }
137+
return user, nil
138+
}
139+
File: auth/middleware.go, Lines: 45-52
140+
Called by: LoginHandler, RefreshToken
141+
Depends on: db.FindByToken, ErrInvalidToken
142+
→ AI sees complete picture, responds accurately
143+
```
144+
145+
**The result:** AI assistants using RagCode give more accurate answers because they see complete, contextual code - not random text fragments.
146+
110147
---
111148

112149
## ✨ Core Features & Capabilities

llms.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111
- **Zero cost** - no API fees, runs on local Ollama + Qdrant
1212
- **Privacy-first** - code never leaves your machine
1313

14+
## RagCode vs Generic RAG
15+
16+
Unlike generic RAG that splits code into arbitrary text chunks, RagCode:
17+
- **Semantic chunking** - extracts complete functions, classes, methods (not random 512-token splits)
18+
- **Rich metadata** - name, type, parameters, return type, dependencies, line numbers
19+
- **Relationships** - knows class inheritance, method calls, imports
20+
- **AST parsing** - understands Go, PHP, Python syntax (not regex/heuristics)
21+
- **Exact + semantic search** - find "UserController" exactly, not just similar text
22+
- **Complete code units** - AI sees runnable code, not fragments
23+
1424
## Compatibility
1525

1626
- **IDEs:** Windsurf, Cursor, VS Code + GitHub Copilot, Claude Desktop, Antigravity

0 commit comments

Comments
 (0)