RAG & Agents Engineering

M15 lab, advanced indexing

Search the child, return the parent.

A port of LangChain’s ParentDocumentRetriever runs here on a 2,184-character page of the Larkspur Cloud handbook. Children are what the index searches; parents are what the model reads. Move both sizes and watch the answer, and the token bill, change.

Golden question

The last parent stop drops parent_splitter, so the whole page is the parent. Both splitters are recursive with no overlap; the index returns the top 2 children by TF-IDF cosine, as in the M10 baseline.

Answer whole, children only
Answer whole, parents returned
Tokens sent, children only
Tokens sent, parents

Index map of the page

matched childparent returnedstored, not usedthe answer

Searched: the top 2 children

Cosine similarity, TF-IDF

RankChildScoreCharactersParentText

Returned: what the model reads

Matched child underlined; answer marked

    All three golden questions at this setting

    Golden questionChildren onlyTokensParentsTokens
    Answers found

    “Children only” is plain chunking at the child size: the same two matches, sent as they are. Tokens use the four-characters-per-token rule of thumb; the footer gives the mean.