Find answers from the community

Updated 4 months ago

Composable index

At a glance
Hi all, I'm new to this channel. But I joined for a reason. I'm kinda stuck. I have been able to create a composible graph over my documents. But I want to make it dynamic such that new documents can be added if needed, how best can I do this?

If I could get access to the index that is created over my documents it would be easy to add a node, but I don't know how to directly get access to the index. I also want to be able to change the default retrieval option for the index. I tried using a custom retriever as the documentation shows, but that only worked for the sub-indices, not the index itself. I tried passing the composible graph itself to the custom retriever, but that gave an error.

can someone assist?
L
S
12 comments
Hello! πŸ‘‹

I don't think you'll get a better answer than what I gave on github earlier tbh.

If you check out the source code for the composable index, you'll see that there is no single "underlying" index. It's just a collection of indexes, and their summaries are used to build a top level "router"

So you can update the underlying sub-index that you want to insert into, and you shouldn't have to rebuild anything as long as the summaries don't change.

In order for an insert feature to work, some mechanism would have to decide which sub index to insert into (maybe the LLM?)

Tbh I would really recommend a data agent or sub question engine over a composable index.
https://gpt-index.readthedocs.io/en/latest/examples/query_engine/sub_question_query_engine.html

https://gpt-index.readthedocs.io/en/latest/core_modules/agent_modules/agents/modules.html

The compsable index has quite a bit of tech debt at the moment (hence the junky ux). Would definitely welcome any PRs to make this function better!
Thanks Logan. I was just checking if anyone had any other ideas. I appreciate the quick feedback.
When I get a chance, I'll look at the source as well and hopefully make some PRs.
Probably only in a couple of weeks though.
So it turns out that you can get access to the root index of a composible graph
you can just access the root_index property
So my initial thinking was correct - you can add new documents as sub-indices easily enough
I guess I misunderstood your original intent, I just assumed that the document had to go into a sub index 🀣 whoops
@Logan M , is there a way to get the nodes that were sent to the LLM during a query from a composable graph? Normally, I'd just assign the index as a retriever to a variable and get the nodes directly, but it isn't defined in the composable graph class.
No worries, I see that the response itself has the nodes as part of it.
It sure does πŸ‘Œ
Add a reply
Sign up and join the conversation on Discord