Find answers from the community

Updated 3 months ago

What are the pros cons of tree and

What are the pros/cons of tree and vector indexes? I understand roughly how they work but can’t figure out why one would vector over tree or vice versa. Isn’t a Vector Tree best?
L
H
M
6 comments
Vector tree is slow and uses many tokens

Vector index is fast and uses as few tokens as possible

tbh the tree index isn't really that useful. I would use a list index with tree_summarize for generating summaries, and a vector index for everything else (an of course, use a router engine or sub question engine as needed 🙂 )
Just curious why list index for generating summaries? Instead of vector index
List index will read every node in an index, a vector index will only read the top k

If your index is very large, you could still use a vector index with tree_summarize, and maybe set a higher top k (default is 2)

Depends on the use case tbh
Thank you for explaining!
I imagine the tree index finds relevant leaf nodes by following paths that have higher relevance like a decision tree. When deciding which path to go down, how is the comparison done?
The reason I asked about Vector Tree is because I thought the path descend uses some similarity measure that’s not based on embedding
Yea the tree index will traverse by letting the LLM decide which node is more relevant

There is also an embedding mode that does something similar, but using embedding similarity (which speeds it up a bit)
Add a reply
Sign up and join the conversation on Discord