Find answers from the community

Updated last year

Real Time embedding

I need some suggestions here. I want to some real time embedding and semantic search. Can llamaindex framework support it? Any sample code can share ?
W
a
6 comments
What do you mean with real time embedding?

Like you have an exisiting vector index and you add more docs into it?
Here is business case. I want to build a solution to detect duplicate incident ticket. So I need to add in newly opened and assigned ticket into vector db. For any newly opened, unassigned ticket to do a similarity search and suggest possible duplicate ticket based on content and suggest user to cancel them.
Based on this, You possibly need a framework for example FastAPI to keep the current index active and some API endpoints.

Before adding the newly opened ticket make a query with the current index and check if any response is returned [ Best would be to add a similiarity Node postprocessor with some threshold value ]

If you do not get any response, You can go ahead and add the newly opened ticket into the active index using the index.insert method.
any sample code of index.insert ?
Yes you can insert like this
Plain Text
documents = SimpleDirectoryReader(DOC_FOLDER_PATH, file_metadata=filename_fn).load_data()

# Index
index = GPTVectorStoreIndex.from_documents(documents, service_context=service_context)

# creating new document
doc = Document(text="this is a document lol!")

# Add to existing index
index.insert(doc)
Thanks. let me try
Add a reply
Sign up and join the conversation on Discord