Skip to content

fix(rag): use full kodit enrichment content instead of 300-char preview#2015

Closed
philwinder wants to merge 1 commit into
mainfrom
fix/kodit-rag-full-content
Closed

fix(rag): use full kodit enrichment content instead of 300-char preview#2015
philwinder wants to merge 1 commit into
mainfrom
fix/kodit-rag-full-content

Conversation

@philwinder

Copy link
Copy Markdown
Member

Summary

Previously the RAG query returned only the first 300 characters of enriched chunks (via r.Preview), ignoring the configured chunk_size setting entirely. This meant that even if you set chunk_size to 5000, the LLM would only ever see ~200 tokens.

Now we:

  • Store both full content (for RAG) and truncated preview (for UI display)
  • RAG pipeline uses the full enrichment content
  • Handlers/MCP/UI continue using the preview for display efficiency

Fixes the issue where RAG chunks were hard-capped at 300 characters regardless of configuration.

Changes

  • kodit_servicer.go: Add Content field to KoditFileResult
  • kodit_service.go: Populate full content and truncated preview separately
  • rag_kodit.go: Use full r.Content instead of r.Preview

Previously the RAG query returned only the first 300 characters of the
enriched chunk (via r.Preview), ignoring the chunk_size setting. Now we
store both the full content and a truncated preview: the RAG pipeline
uses full content for better context, while the UI/API handlers continue
to use the preview for display efficiency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@philwinder philwinder closed this Jun 10, 2026
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