Find answers from the community

Updated last year

anyone know how to flush the buffer

anyone know how to flush the buffer after an upload? after upload and document ingestion is there a way to dump the buffer in python? If I upload and ingest a document then send a query it goes thru the document ingestion again every time unless i reload.
L
M
38 comments
Like, using the new ingestion pipeline?
Or which buffer?
python buffer i think
that buffer lmao
its running live here if you want to see
212.178.231.251:8501
oh hmm, maybe it's just del uploadedfile ?
assuming you don't need it after running that function
as you see i have it running a rm -r 'dir/* but it is holding the document in the buffer cache
my send message process
Attachment
2023-11-15_115347.jpg
my document ingestion process
Attachment
2023-11-15_115415.jpg
do you have any examples of saving the chat to the chromadb?
i have documents working but it doesnt want to save the chat lol
chromadb is only for vectors, can't really save chats in there πŸ€”
need something like redis and just pickle the chat history into there
does redis convert it to a vector?
Redis has support for vectors too (we have RedisVectorSore), but it's also just a general purpose key-val store (like a big dictionary lol)
is there a way to convert the chat to a vector?
im trying to use chroma db as long term memory
Oh thats easy enough

Plain Text
from llama_index.embeddings import OpenAIEmbedding

embed_model = OpenAIEmbedding()

vectors = embed_model.get_text_embedding_batch([str(message) for message in chat_history])
or you can create nodes with the chat message strings
and throw those into a VectorStoreIndex
probably more what you wanted lol
nodes = [TextNode(text=str(message)) for message in chat_history]
can that be used with hugging face instruct embeddings?
this is my defined function:
def ingest_conversation(msg, dataframe=False): docs = msg model_name = "BAAI/bge-small-en" model_kwargs = {"device": "cpu"} encode_kwargs = {"normalize_embeddings": True} embedding = HuggingFaceBgeEmbeddings(model_name=model_name, model_kwargs=model_kwargs, encode_kwargs=encode_kwargs) adk = Chroma.from_texts(docs, embedding, collection_name="Conversation", persist_directory="./memory") if dataframe: return pd.DataFrame(adk) return adk
oh and the buffer issue was easily fixed with:
I came up with a "hacky" way to achieve the chat to chromadb embedding lol i had python write it to a .txt then sent that .txt to the document ingestion and wa la... lol
now to build the relevance comparison search... any pointers?
Can you explain that a bit more?
the relevance search against the chromadb? i don't know if I can lol... im still reading and learning what it is lol
if it retrieves simmular data and includes it with the prompt before sending to the llm. is that what everyone calls a "RAG" system?
ok i built an embedding server and I was wondering if you might know. im sending to a get endpoint the text file from my loader. with that i need to pass a couple args. any idea where to put the args? or is there any nifty llama_index embeddings i can load that handle that?
Add a reply
Sign up and join the conversation on Discord