Does anyone know if it's possible to create a vector field in Payload CMS that utilizes MongoDB's native vector data type (introduced in MongoDB 7.0) for efficient vector similarity searches?
I'm aiming to implement AI-powered search within Payload without relying on external tools that might complicate the setup. Specifically, I want to:
- Define a vector field in my Payload schema that maps directly to MongoDB's actual vector type, ensuring optimal performance for similarity queries.
- Perform vector similarity searches in a single database query without needing to fetch documents twice or perform additional processing outside of MongoDB.
- Retrieve and resolve the resulting documents in Payload with the desired depth (including nested relationships), based on the similarity search results.
Has anyone successfully implemented this or can offer guidance on how to set up such a vector field in Payload, execute efficient similarity queries, and seamlessly integrate the results with Payload's document resolution features?
Any examples or insights would be greatly appreciated!