Skip to content

Add line numbers to RAG search results for source navigation#4

Merged
odfalik merged 1 commit intomainfrom
feat/rag-line-numbers
Jan 3, 2026
Merged

Add line numbers to RAG search results for source navigation#4
odfalik merged 1 commit intomainfrom
feat/rag-line-numbers

Conversation

@odfalik
Copy link
Copy Markdown
Contributor

@odfalik odfalik commented Jan 3, 2026

Summary

  • RAG search results now include start_line and end_line fields
  • Agents can navigate directly to relevant sections in markdown files using these offsets
  • Pre-chunking uses header-aware splitting to preserve document structure

Changes

  • Modified chromadb_client.py to pre-chunk markdown with line number metadata
  • Updated search.py to return start_line and end_line in RAG results
  • Added test to verify line numbers are included

Test plan

  • All 33 tests pass
  • New test test_rag_search_includes_line_numbers verifies the feature

🤖 Generated with Claude Code

- Pre-chunk markdown with header-aware splitting to preserve line positions
- Store start_line, end_line, header_path in chunk metadata
- Return line numbers in RAG search results so agents can navigate to source
- Add test to verify line numbers are included in results

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@odfalik odfalik merged commit 7d2b820 into main Jan 3, 2026
2 checks passed
@odfalik odfalik deleted the feat/rag-line-numbers branch January 3, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant