Like, using the new ingestion pipeline?
its running live here if you want to see
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 document ingestion process
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
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?