Strategy 3 Group Snippets by File + Region

investigation: #578606 (comment 2870291617)

Multiple snippets from the same file are currently returned as separate items. This:

  • Wastes tokens
  • Makes reasoning harder
  • Causes the LLM to interpret multiple small fragments instead of one coherent region

multiple snippets in a same logic group can make it hard for LLM to reason about. For example, 4 snippets from server.rb, the first one is from line 1-line 10, the second is from line 11-line 20, the third is from line 100-121, the forth is from 120-130

These snippets share the same project_id, path, file_name, language, blob id. These information is repeated and it might negatively affect LLM. We can group and merge them.

Edited Nov 06, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading