AI / LlamaIndex Interview Questions
What is the difference between VectorStoreIndex and SummaryIndex?
A VectorStoreIndex embeds every Node and answers queries by finding the Nodes whose embeddings are most similar to the query, so it's built for selective, targeted retrieval over potentially large corpora.
A SummaryIndex stores Nodes as a plain sequential list and, by default, sends all of them to the response synthesizer rather than doing similarity search. That makes it a poor fit for large corpora, since every query touches every Node, but it's ideal for holistic tasks like summarizing a short document end to end, where selective retrieval would risk missing content.
| VectorStoreIndex | SummaryIndex |
| Requires embeddings | Doesn't require embeddings by default |
| Retrieves top-k similar Nodes | Retrieves all Nodes by default |
| Scales to large corpora | Best for small corpora or full summarization |
In short, pick VectorStoreIndex when you need to find a needle in a haystack, and SummaryIndex when you need to read the whole haystack.
More Related questions...