Add Qdrant custom payload on documents to query them by filter
Hi !
The Qdrant integration works well with the content, vector, and payload. However, it would be great to be able to add our own payload in JSON. This would allow querying the database on more criteria, like geolocation for instance.
It would enable the creation of one's own DynamicStructuredTool and therefore search within the same Qdrant base as the vectors.
An approach like this, for instance:
* Method to add vectors to the Qdrant database. Each vector is associated
* with a document, which is stored as the payload for a point in the
* database.
* @param vectors Array of vectors to be added to the Qdrant database.
* @param documents Array of `Document` instances associated with the vectors.
* @returns Promise that resolves when the vectors have been added to the database.
*/
async addVectors(vectors, documents) {
if (vectors.length === 0) {
return;
}
await this.ensureCollection();
const points = vectors.map((embedding, idx) => ({
id: uuid(),
vector: embedding,
payload: {
// add custom payload here <========== HERE
// ...documents[idx].payload
content: documents[idx].pageContent,
metadata: documents[idx].metadata,
},
}));
await this.client.upsert(this.collectionName, {
wait: true,
points,
});
}```
Thanks !
Hello, is anyone working on this ticket at the moment? My group and I would like to contribute to this repository for a group project.
Hi I'm going to assume that no one else is working on this and my team will get started working on it.
🤖
Hi, @uptoo-owner,
I'm helping the langchainjs team manage their backlog and am marking this issue as stale. From what I understand, you raised a request for the ability to add custom JSON payloads to documents in Qdrant, enabling diverse querying criteria such as geolocation. This feature would allow for the creation of custom DynamicStructuredTools and searching within the same Qdrant base as the vectors. The issue has garnered interest from @youngjaeheo2002 and their team, who are considering contributing to the repository for a group project.
Could you please confirm if this issue is still relevant to the latest version of the langchainjs repository? If it is, please let the langchainjs team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you!
I would like to reopen this ticket, because from my point of view it's not correct. The customPayload can be passed as general dbConfig, but will not have any effect when using fromExistingCollection(). But I think it's often the use case that I want to add a customPayload to ALL documents at once, like a tenantId. So I created another MR for this.
Thank you! Will look as soon as possible
Hi, @uptoo-owner. I'm Dosu, and I'm helping the LangChain JS team manage their backlog. I'm marking this issue as stale.
Issue Summary:
- The issue suggests enhancing Qdrant integration by allowing custom JSON payloads in documents for complex queries.
- @youngjaeheo2002 and team showed interest in contributing to this feature.
- @JustDoItSascha reopened the issue, highlighting the lack of support for adding custom payloads to all documents at once.
- @jacoblee93 acknowledged the issue and promised to review the proposed changes.
Next Steps:
- Please confirm if this issue is still relevant to the latest version of the LangChain JS repository by commenting here.
- If there is no further activity, the issue will be automatically closed in 7 days.
Thank you for your understanding and contribution!
still relevant
dosubot[bot] @.***> schrieb am Fr., 24. Jan. 2025, 17:00:
Hi, @uptoo-owner https://github.com/uptoo-owner. I'm Dosu https://dosu.dev, and I'm helping the LangChain JS team manage their backlog. I'm marking this issue as stale.
Issue Summary:
- The issue suggests enhancing Qdrant integration by allowing custom JSON payloads in documents for complex queries.
- @youngjaeheo2002 https://github.com/youngjaeheo2002 and team showed interest in contributing to this feature.
- @JustDoItSascha https://github.com/JustDoItSascha reopened the issue, highlighting the lack of support for adding custom payloads to all documents at once.
- @jacoblee93 https://github.com/jacoblee93 acknowledged the issue and promised to review the proposed changes.
Next Steps:
- Please confirm if this issue is still relevant to the latest version of the LangChain JS repository by commenting here.
- If there is no further activity, the issue will be automatically closed in 7 days.
Thank you for your understanding and contribution!
— Reply to this email directly, view it on GitHub https://github.com/langchain-ai/langchainjs/issues/2756#issuecomment-2612868313, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAADHQ2O4IHLHY7BDS6XRL2MJPS7AVCNFSM6AAAAABQUBMCZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJSHA3DQMZRGM . You are receiving this because you were mentioned.Message ID: @.***>
Let's continue this convo in #7069 .. thanks @JustDoItSascha for taking a stab at a fix for this 🙏