Find answers from the community

Updated 2 months ago

Hi was hoping to get some direction

Hi, was hoping to get some direction about ComposableGraph concept as per https://gpt-index.readthedocs.io/en/latest/how_to/composability.html

In this example, a list index is constructed from 3 tree indices. the top level index (list index here) is fed into the ComposableGraph wrapper. my questions are:
a) query_configs is a list of configs. is this ordered in any manner (top-down manner or bottom-up)?
b) the example is using "index_struct_type": "tree" and "index_struct_type": "keyword_table".. should it not be a "list" instead of "keyword_table"?
c) can you share what is "recursive" in this?

and thank you for the awesome library! really appreciate all your efforts.
j
S
5 comments
good questions!

(a) nope, there's no ordering to it
(b) yeah the namings are off..i'll make the namings better, but in the meantime you can find the "index_struct_type" to actual index mapping here: https://gpt-index.readthedocs.io/en/latest/reference/indices/composability_query.html#gpt_index.data_structs.struct_type.IndexStructType
(c) it's "recursive" in the sense that we propagate the query from the parent index down to the subindices. so if list index is defined over 3 tree indices, then we would first query the list index. in the "first node" of the list index, which corresponds to the first tree index, we could query that first tree index with the same query and get a response from the tree index.
a and b makes sense, thanks.
for c, i guess my confusion lies around what is a scenario where recursive is not needed? i would assume smartly propagating the query down to the leaf nodes is the whole point of composing indices?
re: c - i don't think you have the ability to specify a recursive query or not if using a ComposableGraph? All queries are "recursive"
ah got it thanks πŸ™‚
Add a reply
Sign up and join the conversation on Discord