The Difference Between Code and Documents

Split a Python file into 1000-character chunks with RecursiveCharacterTextSplitter, embed them, run vector search — this is the most common "code RAG" implementation. The problem is that it treats code as text:

def evaluate_rag(questions, answers, contexts):

"""Evaluate RAG system quality"""

...(50 lines of code)...