Find answers from the community

Updated 3 days ago

Exploring the Document Summary Index in LlamaIndex

Hi! i am using llamaIndex python, mongoAtlas db as my persistant storage. I had an initial successful implementation of using MongoDBAtlasVectorSearch as my vectorStore, and rag is working πŸ™‚

but now i am exploring the document summary index, and im struggling to understand the concept of docstore and index store.
  1. am i able to create a document summary index from my existing vector store?
  2. does anyone have a copy of data in their docStore, vectorStore, indexStore? I will like to see the data to see how they all related to each other.
Any help pointing me to the right direction is greatly appreciated! T.T
W
n
8 comments
  1. Yes you can create DocumentSummaryIndex from your existing index but there is no direct way. you'll have to do something like:
Plain Text
1. Fetch all the nodes from existing index and create document object against each node.

2. Pass in the docuejmnt object to create `DocumentSummaryIndex`


  1. Docstore allows you for easy access to the nodes created. You can easily iterate over the nodes by accessing the nodes. Also docstore is created if you are creating index locally or you are specifying the docstore in case of vector store.
Vector Store: Its basically a combination of your nodes and embeddings.

You can find more detail here: https://docs.llamaindex.ai/en/stable/module_guides/storing/#concept
i see! if i were to understand it correctly, essentially we have to rescontruct the documents from the nodes in vectorStore and create a new DocumentSummaryIndex with the documents?


it seems that persisting nodes, and indexes in a docStore and indexStore respectively in mongoDB is the 'right way' to do it as its more extensible to support the different indexes.

Can i confirm that persisting docStore and indexStore in mongoDB is possible? i ultimately want to use both vectorIndex and summary Index.
if i were to understand it correctly, essentially we have to rescontruct the documents from the nodes in vectorStore and create a new DocumentSummaryIndex with the documents? Yes, if you dont want to ingest document again and want to use the same nodes present in vector store.

Yes you can persist docstore, indexstore in mongoDB: https://docs.llamaindex.ai/en/stable/examples/docstore/MongoDocstoreDemo/
interesting! i will try this approach! πŸ§‘β€πŸš€
thank alot for the help!
oyes, i have another qn.

suppose i have a document which represents a pdf page. I further chunk it into 5 nodes.
will i expect to see 6 entities in my docStore? 1 document + 5 nodes
No docstore will only show the chunked nodes: that is 5 nodes
thanks alot whitefang
Add a reply
Sign up and join the conversation on Discord