Find answers from the community

s
F
Y
a
P
Updated last month

Response mode graph

I have a ComposableGraph over a GPTListIndex. How do I set the response mode of the List indices to "compact"? (When creating the ComposableGraph I didn't provide the List indices "as query engines" so I wonder where I should set this)
L
y
28 comments
Compact is the default response mode mode now I think...

I'm not sure where to set that though if you didn't pass the custom query engines πŸ€”
I found it, thanks πŸ™‚
On the same topic, do you understand how the flow of the ComposableGraph works? I'm trying to understand the last example in https://betterprogramming.pub/llamaindex-deep-lake-for-financial-statement-analysis-954f2b789c8e

Given the complex query, I understand the decompose broke it down to a simpler query (more specific), but who made it break it down to 3 different queries? I thought the decompose only breaks a single query to a (simpler) single query. If that was the graph that did it, how did it know to run the decompose 3 times given the query "Compare revenue in Q1, Q2, Q3 of 2018"?
It sounds like it transforms the query for every subindex, given the index summary
So the query essentially gets adapted to that given subindex
But I guess it does it only for those indices that match the query based on their summary?
Well, since the top level is a list, it will always ask all 3 sub indexes and then aggregate the response from those sub-indexes
I meant to ask which ListIndex it queries...the top level is a graph and the sub indices are ListIndex. Shere are several List Indices per quarterly report, but the query only refers to 3 specific quarters, so my question is if the graph queries them all or only those 3?
How does it know to only perform 3 queries?
What is your top level index?
I just revised my response
Top level is a graph, as in the example
and sub indices are ListIndex
In the example, the top level is a keyword index
Attachment
image.png
You did the same? If so, it will query every list index whose summary has matching keywords
Yeah, same as mine
And then after it decided the query will be decomposed?
Yup, for each chosen subindex (at least, that's what I think is happening haha)
That makes sense
Hey Logan, another question if I may - How can I add additional info to the sub-index response? Assuming my sub indices are GPT Vector Indices, I want to concat to the final response coming from the LLM additional info so that the root node of the composable graph will have more context (otherwise it gets results from different sub-indices which needs to be aggregated at the top, but it lacks info on the connection between each response to the sub index id or other attributes)
Not sure what you mean exactly. Are you talking about metadata or?
No...let's assume I have a keyword graph over a vector index. Once the relevant sub indexes are queried, all final responses are being aggregated at the top to generate the final response. However, each response comes with no context.
So basically I would want to concatenate to each sub-index response some meta data associated with that specific index
I thiiiink the summaries for each sub index are also used for the top level aggregation. I know I've seen the appear as source_nodes in the response object
How can I set the summary for each index? basically I used this code but it looks like the top level only gets the response and not the summary for each sub-index used
graph = ComposableGraph.from_indices( GPTSimpleKeywordTableIndex, indices, index_summaries, service_context=service_context3, max_keywords_per_chunk=50 )
yea index_summaries is what sets it... maybe I'm wrong there then πŸ€”
I think regardless it should be a very relevant use case to concat info to sub-index responses so that higher level indices get more context
yea probably! Would be a good PR πŸ™‚

So many things on the todo list at the moment πŸ˜΅β€πŸ’«
I guess that for now, instead of using Simple Vector as sub indexes I could create my own custom index which calls the vector index but then concats info to the response
Definitely...but I see you guys are progressing very fast πŸ™‚
Add a reply
Sign up and join the conversation on Discord