Replies: 1 comment 4 replies
-
Hey @ZN1010! I'm here to help you with any issues or questions you have. I can assist with bug fixes, answer technical queries, and guide you on becoming a contributor. There doesn't appear to be a misalignment between the paper's idea of tree traversal and the actual implementation in However, the behavior you're experiencing—where only leaf nodes are returned—might be influenced by specific configurations or parameters. Key parameters that affect this behavior include
You can adjust these parameters when initializing the from llama_index.packs.raptor import RaptorRetriever
from llama_index.embeddings.openai import OpenAIEmbedding
from llama_index.llms.openai import OpenAI
from llama_index.vector_stores.chroma import ChromaVectorStore
import chromadb
# Initialize the vector store
client = chromadb.PersistentClient(path="./raptor_paper_db")
collection = client.get_or_create_collection("raptor")
vector_store = ChromaVectorStore(chroma_collection=collection)
# Initialize the RaptorRetriever
raptor_retriever = RaptorRetriever(
[],
embed_model=OpenAIEmbedding(model="text-embedding-3-small"),
llm=OpenAI(model="gpt-3.5-turbo", temperature=0.1),
vector_store=vector_store,
similarity_top_k=10, # Set the number of top nodes to retrieve
mode="tree_traversal" # Set the default mode
)
# Adjust the tree depth if needed
raptor_retriever.tree_depth = 3 # Set the depth of the tree
# Perform tree traversal retrieval
response = await raptor_retriever.tree_traversal_retrieval(query_str="your query here") Adjusting these parameters should help ensure that higher-level nodes with summaries are incorporated into the retrieval process [1][2]. |
Beta Was this translation helpful? Give feedback.
-
In RAPTOR's tree traversal method, we are supposed to retrieve and concatenate top k nodes of each level, so the nodes of higher levels will have summaries as their texts. However, when I ran the llama_index implementation and tried to print the final retrieved nodes, in the
tree_traversal_retrieval()
function ofbase.py
inRaptorPack
, I always get the leaf nodes as the returned output. It seems that all the nodes from higher levels are not incorporated into assembling the relevant context to users' query.Maybe there is a misalignment between the paper idea of tree traversal and the actual implementation? Or I am missing anything important? Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions