[Phase 6.4.3] Document Chunker #94

Closed
opened 2026-04-07 04:20:04 +00:00 by Mark · 0 comments
Owner

Parent: Global Document Library

Overview

Build document chunking system for efficient embedding and retrieval.

Details

Create substrate/document_chunker.py:

DocumentChunker class:

  • chunk_document(content, chunk_size=500, overlap=50)
  • chunk_by_headings(content) - Preserve structure
  • chunk_code(content) - Split on functions/classes

Output:

  • DocumentChunk with: chunk_id, content, chunk_index, total_chunks
  • Preserve metadata (source, language)

Token estimation:

  • ~0.25 tokens per character
  • Target ~500 tokens per chunk

Acceptance Criteria

  • Split text into overlapping chunks
  • Respect code structure (functions/classes)
  • Preserve markdown headings
  • Return chunk metadata
## Parent: Global Document Library ## Overview Build document chunking system for efficient embedding and retrieval. ## Details Create `substrate/document_chunker.py`: **DocumentChunker class:** - chunk_document(content, chunk_size=500, overlap=50) - chunk_by_headings(content) - Preserve structure - chunk_code(content) - Split on functions/classes **Output:** - DocumentChunk with: chunk_id, content, chunk_index, total_chunks - Preserve metadata (source, language) **Token estimation:** - ~0.25 tokens per character - Target ~500 tokens per chunk ## Acceptance Criteria - [ ] Split text into overlapping chunks - [ ] Respect code structure (functions/classes) - [ ] Preserve markdown headings - [ ] Return chunk metadata
Mark 2026-05-27 19:59:14 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/mesh-seed#94
No description provided.