Skip to content

[BUG] Token chunking strategy silently drops text when overlap is set #10706

Backlog

Description

@kowshikdev

Describe the bug
With the Token strategy and overlap greater than 0, the window advances by a fixed step from its start. When a window ends early at a space, the text between that space and the next window's start lands in no chunk, so it is never embedded or searchable.

To Reproduce

  1. Create a knowledge base with the Token strategy, max size 1024 and overlap 200.
  2. Upload text with long runs without spaces, such as Chinese prose with a few English words, long URLs or base64.
  3. Compare the chunk text with the source: whole stretches are missing.

Expected behavior
Every character of the document appears in at least one chunk.

Additional context
iterateWordBoundaryChunkSpans in apps/sim/lib/chunkers/utils.ts. Documents already indexed would need re-processing to recover the missing text.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions