Find answers from the community

A
Azru
Offline, last seen 3 months ago
Joined September 25, 2024
Hello, does anyone know why utilizing index.storage_context.persist(persist_dir="<persist_dir>") significantly slows down each query, making it approximately 30 times slower compared to when storage is not used?
4 comments
L
A
A
Azru
·

RAG

Hello ! I have loaded a large amount of data into LlamaIndex, and I am looking for a way to:

  • Restrict responses to only the data I have provided myself. If a query pertains to information not present in my data, I would like to receive something like: "Sorry, I don't have knowledge of that."
  • Include references for each generated response. Whenever a response is provided, it would be very helpful if it were accompanied by the documents and line numbers from which the information was sourced. This would allow for increased transparency and traceability.
Could you please guide me on the best way to implement these features with LlamaIndex?
2 comments
A
W
Hello, does anyone know why utilizing index.storage_context.persist(persist_dir="<persist_dir>") significantly slows down each query, making it approximately 30 times slower compared to when storage is not used?
1 comment
W
is it recommended to pre process data before using it with llamaindex ? Seems I have much better results when parsing everything into a text file and passing it to llamaindex
3 comments
A
T
s
when creating nodes, how text is segmented by default? what is the default chunking strategy
1 comment
W
A
Azru
·

```

Plain Text
    def process_question(self, query):
        selected_files = self.get_selected_files(self.file_tree)
        node_ids = [n.node_id for n in self.index.docstore.docs.values() if n.metadata['file_name'] in selected_files]
        retriever = VectorIndexRetriever(self.index, node_ids=node_ids, similarity_top_k=3)
        custom_template = (...)
        query_engine = RetrieverQueryEngine.from_args(
            retriever=retriever,
            response_mode="compact",
            prompt_template=PromptTemplate(custom_template)
        )
        chat_engine = self.index.as_chat_engine()
        response = chat_engine.chat(query)


How can I use my query_engine for my chat_engine I used to do that response = query_engine.query(query)but it seems it doesnt work using chat engine
3 comments
L
hey guys what is the best way to add the context of old answer and prompt so it’s more conversational
2 comments
A
T
do you have any example ? 😄
7 comments
T
A
Hey everyone! 😊 I'm currently using LlamaIndex to answer questions from my documents, but I'd like to refine my searches to a specific subset of documents that I can define at each prompt. The tricky part is that I want to maintain the VectorStore with all my documents, as the specific subset of documents I need to search in can change with every prompt.

For a concrete example, imagine I have 5 folders, each containing various PDFs. For one query, I might need to search exclusively within folder 1. Then, for the next query, my search should be limited to folders 3 and 5.

Does anyone have tips on how to dynamically restrict searches to a specified group of documents in LlamaIndex, while still keeping the entire VectorStore intact for flexibility? Any advice or examples would be super helpful!

Thanks in advance! 🙌
2 comments
A
h