-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add default indexing policy to chat history #36
Conversation
Open to discussions here - I didn't dig very deeply into this. I was writing integration tests for langflow and running into this error. |
A side comment: the reason the CI fails is unrelated to this PR. I encountered the same while upgrading the vectorize and came up with a fix (see #37 for a brief explanation). I suggest to bring that one in this branch once 37 is merged, to get smooth CI here as well. Now to the main question. While tailoring the indexing policy for chat history to the use is in general a good thing (fight SAI waste!), I am not sure I get the reason why one should use the same collection for both vectorstore and chat history. The format of the documents in them is different as far as I remember, no? |
I could probably imagine up some use-case where we'd want metadata attached to each message, such as "time sent" for accessing only the last five minutes of chat history, or "location" for location-based recommendations in a conversation, which would reduce the number of stores to query. However, it's true the main reason was during testing I ran into this - I wanted to use a single fixture to set up my Astra collections before running tests, which used the I don't have a stronger argument than the above, so very happy to pass on this as "working-as-intended". Edit: I'm leaning your direction as well, after looking again at the existing patterns.
The |
Closing per above comment |
Adds a default indexing policy to the chat message history class.
The reason for this is that the default policy when creating a vector store through
AstraDBVectorStore
uses this policy. Meaning, if you create a collection with the class, you cannot initialize chat history, as you'll get this error:I think it makes sense in this case to make the default indexing policy the same here.
langchain-datastax/libs/astradb/langchain_astradb/vectorstores.py
Line 57 in 77d3d81