Hey I am trying to use the
SummaryIndex
mechansim for the agent tool.
I have:
summary_index = SummaryIndex(nodes)
summary_index.storage_context.persist(os.path.join(persist_dir, "summary_index"))
summary_query_engine = summary_index.as_query_engine(
llm=self.model,
response_mode="tree_summarize",
use_async=True,
)
summary_tool = QueryEngineTool.from_defaults(
name=f"summary_tool_{class_name}",
query_engine=summary_query_engine,
description=(f"Useful for summarization questions related to {class_name}"),
)
I cannot figure out how to persist both the
vector_index
and the
summary_index
on disk so I do not have to regenerate it. How do you recommend I do that.
Also, how do I check the summary mechanism is even working ? The
summary_index.summary=None
which tells me something is off. Is the summary text generated and stored somewhere by any chance?