Find answers from the community

Updated last year

Any one able to ellaborate on the

Any one able to ellaborate on the difference between the use cases of the SummaryIndex and the DocumentSummaryIndex? It look like the summary index is a linked list over the documents ndoes and then uses the refine query to run multiple LLM calls to summarise the document on the fly?

My RAG is poor at summaries atm because its just chuncked and vector based. Was thinking to pre-summarising all the documents with like a 7B model and then put them into a key word look up store.

What is the default store for these indexes? The document store?
1
T
L
W
5 comments
Yeah I think If you want to synthesize the response across all your nodes you'll want the SummaryIndex and if you want separate summaries from each document stored for retrieval you'd use the DocumentSummaryIndex. So I guess unless you need to have everything read in your index during query time, the DocumentSummaryIndex might be more appropriate for you? And yeah should be the docstore
@Teemu Hi teemu long time no see
Thanks for that! Makes sense.
how could i change the respond language in the docstore.json. i've change the system_promt ,but it didn't work:
city_docs = []
for file in pdf_files:
docs = SimpleDirectoryReader(
input_files=[file]
).load_data()
title = file.split(':')[0]
docs[0].doc_id = title
city_docs.extend(docs)


LLM (gpt-3.5-turbo)

system_prompt="Always respond in Chinese"
chatgpt = OpenAI(temperature=0, model="gpt-3.5-turbo",api_base=api_base1,api_key=api_key1,system_prompt=system_prompt)
service_context = ServiceContext.from_defaults(llm=chatgpt, chunk_size=1024)

default mode of building the index

response_synthesizer = get_response_synthesizer(
response_mode="tree_summarize", use_async=True
)
doc_summary_index = DocumentSummaryIndex.from_documents(
city_docs,
service_context=service_context,
response_synthesizer=response_synthesizer,
show_progress=True,
)

doc_summary_index.storage_context.persist("index")
Add a reply
Sign up and join the conversation on Discord