Find answers from the community

Updated 4 months ago

Add

At a glance

The community member is working on a chatbot using LlamaIndex and GPT API, and has successfully built the chatbot by retrieving knowledge from public documents. They now want to add a feature that allows users to upload their private documents and ask questions based on those documents, while also keeping the old indexed documents. The community member's question is how to combine the public documents with the private documents.

In the comments, another community member suggests using the insert method to add the new private data to the existing index. However, they also mention that it might be better to create a new index that includes both the public and private data, as the previous index would only contain the first user's private data until it is deleted.

The original community member thanks the other community member and indicates they will try the suggested approach, and asks if they can get back to the thread if they face another issue.

hey guys, I was working on a rag based chatbot using llamaindex and gpt api. successfully built the chatbot retrieving knowledge from the public documents. now i want to add a feature to it so that when a user uploads their private document, he can ask questions based on that document while also keeping the old indexed documents. my question is how can i combine those documents that I've had with the public documents with the private documents?
W
n
3 comments
You can add new info into existing index using insert method.

Plain Text
documents = private data
for doc in docs: 
    index.insert(doc) 


But I guess you'll have spin up new index for new with public and thier private data as previous one will have first user private data until you delete it
thanks a lot @WhiteFang_Jr will try that and can i get back to you on this thread if i face another issue?
Add a reply
Sign up and join the conversation on Discord