← Back to Work

Selected case studies · SYSTEM

Generative AI (K-Bot) Per-Type Parsing & Chunking Pipeline

A preprocessing system that lifts RAG quality by routing parsing, chunking, and embedding per document type

Role
Backend · AI/RAG
Period
2025.11 ~ 2026.02
Stack
LangChain · Document parser · Embeddings · Vector DB

01 / Problem

A single text-processing path erased PDF page context, slide structure, and cross-page tables, weakening the context available to retrieval.

02 / Constraints

  1. 01

    The existing upload API and user flow had to remain stable.

  2. 02

    PDF, DOCX, PPT/PPTX, Excel, and text required different structural handling inside one pipeline.

  3. 03

    Page, slide, and sheet provenance had to survive through retrieval.

03 / Decisions & approach

01

Route by document type

Parser and chunking strategies are selected from file type and usage context.

02

Preserve structure while chunking

Headings and layout define semantic units, while cross-page tables are merged into one searchable unit.

03

Keep provenance as data

Page, slide, and sheet positions stay in chunk metadata so evidence remains traceable after retrieval.

04 / System flow

Document processing flow

One upload entry point selects the strategy that fits each document.

  1. 01

    Upload

    Detect file type

  2. 02

    Route

    Choose strategy

  3. 03

    Parse

    Extract layout, tables, text

  4. 04

    Chunk

    Create structural units

  5. 05

    Index

    Store with provenance

05 / Outcome

  • Tables, slides, and page-based documents became structure-aware searchable units.
  • New document types can be added as strategies without changing the upload flow.

06 / Lessons

Retrieval quality starts with how much source structure survives, before the embedding model enters the picture.