USMAN’S INSIGHTS
AI ARCHITECT
⌘F
HomeAll Bookspgvector Book
Homepgvector BookBuild the Ingestion System
PreviousDocument Extraction, Normalization, and ProvenanceNext Idempotent Embedding Pipelines and Job State
AI NOTICE: This is the table of contents for the SPECIFIC CHAPTER only. It is NOT the global sidebar. For all chapters, look at the main navigation.

On this page

10 sections

Progress0%
1 / 10

Muhammad Usman Akbar Entity Profile

Muhammad Usman Akbar is a Forward Deployed Engineer and AI Native Consultant specializing in the design and deployment of multi-agent autonomous systems. Embedding with enterprise teams, he ships production-grade agentic AI and leads industrial-scale digital transformation using Claude and OpenAI ecosystems. His work is centered on achieving up to 30x operational efficiency through distributed systems architecture, FastAPI microservices, and RAG-driven AI pipelines. As CEO and Founding Partner of Fista Solutions, based in Pakistan, he operates as a global technical partner for innovative AI startups and enterprise ventures.

USMAN’S INSIGHTS
AI ARCHITECT

Transforming businesses into autonomous AI ecosystems. Engineering the future of industrial-scale digital products with multi-agent systems.

30X Growth
AI-First
Innovation

Navigation

  • Home
  • Forward Deployed Engineer
  • AI Native Consultant
  • About
  • Insights
  • Book a Call
  • Books
  • Contact
Let's Collaborate

Have a Project in Mind?

Let's build something extraordinary together. Transform your vision into autonomous AI reality.

Start Your Transformation

© 2026 Muhammad Usman Akbar. All rights reserved.

Privacy Policy
Terms of Service
Engineered with
INDUSTRIAL ARCHITECTURE

Chunking by Structure and Meaning

Chunking turns a document into retrievable, citable units. Good chunks preserve a coherent idea, enough local context, source hierarchy, permissions, and exact coordinates while fitting the embedding model and downstream context budget. Fixed character windows are a baseline; structure-aware policies usually handle headings, paragraphs, tables, code, and lists more faithfully.

What will you be able to do?

  • Define a versioned chunking policy.
  • Choose boundaries and overlap intentionally.
  • Preserve parent and citation context.
  • Handle tables and code without corrupting meaning.
  • Evaluate chunking with real questions.

What tradeoff does chunk size create?

Very small chunks improve specificity but lose context and multiply rows. Very large chunks preserve context but mix topics, increase embedding and prompt cost, and make citations vague. Overlap can preserve boundary context but duplicates evidence and may crowd results with near-identical chunks.

Start with semantic boundaries and target token ranges, then evaluate—not with one universal number.

What should a chunk contain?

  • stable ID derived from document version and ordinal or content identity;
  • heading path and optional parent summary;
  • exact content plus page/character coordinates;
  • token count under the relevant tokenizer;
  • chunker version and checksum;
  • inherited tenant, source, permissions, language, and sensitivity.

Tables may need a title and column headers repeated with row groups. Code should preserve function/class boundaries and file path. Never split a security scope away from the content it governs.

What is parent-child retrieval?

Embed a focused child chunk for matching, then fetch a larger authorized parent section for context. This separates retrieval granularity from generation granularity. The parent still needs a token budget and precise citation mapping.

How do you verify it?

Render sampled chunks in a human review tool. Ask: can this unit answer a plausible question alone, does it retain required definitions, and can a reader locate the source? Compare several policies on the same golden query set. Track retrieval recall, duplicate rate, context tokens, citation precision, and ingestion cost.

What breaks in production?

  • Overlap causes five copies of the same fact in top-k.
  • Tables lose headers.
  • A heading is separated from all child text.
  • Rechunking changes IDs and invalidates labels.
  • Hidden text, navigation, or legal boilerplate dominates.

AI pair-work prompt

Given this representative document [paste excerpt] and query set [paste], propose three chunking policies: baseline fixed window, structure-aware, and parent-child. Specify boundaries, target/maximum tokens, overlap, metadata, stable IDs, and evaluation measures. Do not choose a winner without running the queries.

Verification contract: Inspect at least 30 chunks and compare policies on the same labels, model, metric, filters, and retrieval depth.

Check your understanding

  1. Why can overlap reduce diversity?
  2. How would you chunk a table?
  3. What is the difference between retrieval and generation granularity?

Official references

  • pgvector examples
  • PostgreSQL generated columns