[BUG] Token chunking strategy silently drops text when overlap is set
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start by reading iterateWordBoundaryChunkSpans in apps/sim/lib/chunkers/utils.ts and trace how it advances chunk windows when a window ends at a space. Reproduce with Token strategy, max size 1024, overlap 200, and text containing long runs without spaces; verify every source character appears in at least one chunk.
Written by the indexing model from the issue text.
Description
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
- Create a knowledge base with the Token strategy, max size 1024 and overlap 200.
- Upload text with long runs without spaces, such as Chinese prose with a few English words, long URLs or base64.
- 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.
- Dominant language
- TypeScript
- Stars
- 29.8k
- Forks
- 3.9k
- Avg merge
- 1h 43m
- Merged PRs (30d)
- 937
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from simstudioai/sim
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
simstudioai/sim#10710 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
simstudioai/sim#10708 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
simstudioai/sim#10704 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
simstudioai/sim#10702 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
simstudioai/sim#10699 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
melgarafael/DeskcommCRM#5614 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 76/100
slackapi/slack-health-score#253 ·
Maintainers usually reply within 1 day
-
feature needs triage site
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
owid/owid-grapher#8019 ·
Maintainers usually reply within 1 day
-
via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug:new
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
callstackincubator/simlock#2088 ·
Maintainers usually reply within 1 day