GPT-4o · Pinecone · tree-sitter
Semantic search over yt-dlp's 120,000-line source. Ask in plain English. DevLens retrieves the exact functions and returns cited, grounded answers.
Under the hood
A three-stage pipeline from raw source code to cited, grounded answers, built on production-grade components.
Step 01
Every Python file is parsed with tree-sitter to build a
concrete syntax tree. Top-level functions and classes are extracted as
self-contained semantic chunks, each with its full source and exact
line range.
Step 02
Each chunk is encoded into a 1,536-dimensional vector using OpenAI's
text-embedding-3-small. Vectors are stored in Pinecone
for sub-millisecond nearest-neighbour retrieval via semantic similarity,
not keyword matching.
Step 03
Your question is embedded in real time. The top‑8 most similar
chunks are passed to GPT-4o as grounding context. It
synthesises a precise answer backed exclusively by real source code,
with file path and line number citations.
FYP · NUCES
The academic context behind DevLens — the problem it solves, the research gap it addresses, and the scope of what was built and evaluated.
Problem Statement
Developers spend the majority of their working time not writing code, but trying to understand it. When a new developer joins a team, weeks can pass before they are productive. Today’s AI coding tools compound this with a new cost: every query to a cloud AI assistant burns paid API tokens. Those costs multiply across every developer, every onboarding cycle, every codebase. DevLens solves this by ingesting a codebase once into a vector database and answering questions against it — so the cost of understanding is paid once, not thousands of times.
Gap Reduction
Prior research on RAG for code — most recently Zhang et al. (EMNLP 2025) — evaluates only automated code generation. No prior work applies AST-based chunking to the developer comprehension problem. DevLens also preserves two pieces of information prior work discards: the class a function belongs to, and the plain-English docstring that describes what it does.
Project Scope
DevLens ingests Python codebases using Abstract Syntax Tree parsing, stores semantically complete code chunks in a vector database, and answers developer questions with source references. The project includes a formal evaluation study comparing AST-based chunking against two naive baselines using LLM-as-judge methodology on a benchmark of natural language questions about a real-world codebase.
In Scope
Future Work
Research Positioning
Where DevLens sits relative to prior work on two key axes