Find answers from the community

Updated 3 months ago

Above just a part code, user upload

Above just a part code, user upload their document to our system, we will create the DocumentSummaryIndex and persist it. I found the llamaindex will stored chunk text and summary result on local docstore.json file.
Q1: Each chunk text will send to LLM get summary, use the default prompt: Is parallel to call LLM API do chunk summarize?
Plain Text
Context information from multiple sources is below.
---------------------
{text}
---------------------
Given the information from multiple sources and not prior knowledge, answer the query.
Query: Describe what the provided text is about. Also describe some of the questions that this text can answer. 
Answer: 


Q2: Why need LLM "describe some of the questions that this text can answer", What role do these questions play?

Q3: When use the DocumentSummaryIndex create the query engine to answer user query, I see query engine not used local docstore.json file summary result, just call LLM API to do each chunk summarize and combine those summary do final summarize.
What role do these summary result play on stage of create summary index?

Plain Text
doc_summary_index = load_index_from_storage(
    StorageContext.from_defaults(
        persist_dir=store_path
    ),
    service_context=service_context,
)
summary_query_engine = doc_summary_index.as_query_engine(
            response_mode="tree_summarize",
            streaming=True,
            use_async=True
        )
query = 'write a summary about this document'
summary_query_engine.query(query)
L
1 comment
1) async calls to summarize, yes

2) Just trying to create good text/embeddings for retrieval. You are also free to modify this prompt

3) The default retrieval mode is embeddings. So it picks the top-k most similar documents based on the generated summaries, then uses those entire documents to answer the query
Add a reply
Sign up and join the conversation on Discord