embeddingnearest-neighborvespavector-database

Utilizing vespa only as vector database and not embedder


I have utilized Vespa when trying to store embedding embedded using some model defined in services.xml file. However, I intend to generate embeddings externally and store them in Vespa and utilize it for nearest neighbor search for explicitly providing query vectors.

However, I face issue defining schema for such use-case. Schema

Error


Solution

  • To fix this: Move the embedding field inside the document block in the schema. (Also, the document type should be named "neighbors", not "schema".)

    Explanation: Your embedding field is not sourcing another field and mutating it, as when the embedding happens in the indexing statement, it is just a value of the document. Those must be defined inside the document block as they define the document type that you can write and get.