AI / LlamaIndex Interview Questions
Explain the lifecycle of a Node from Document to retrieval?
A Node passes through several distinct stages between when raw data enters LlamaIndex and when it's finally used to answer a query.
- A reader, such as
SimpleDirectoryReader, loads raw data into a Document with base metadata likefile_name. - A node parser splits the Document into one or more Nodes, sized according to
chunk_sizeandchunk_overlap. - Each Node is assigned relationships to its neighbors and source Document via the
NodeRelationshipenum, so context and provenance aren't lost after chunking. - Optional metadata extractors, like a title or summary extractor, enrich the Node with additional derived metadata.
- The embedding model converts the Node's text into a vector.
- The Node and its vector are persisted into the docstore and vector store respectively.
- At query time, a retriever fetches the Node, it may pass through postprocessors, and finally its text reaches the response synthesizer to help produce an answer.
More Related questions...