I have an app where users can sign up and fill out a profile. This profile consists of 16 questions that can be answered using a slider. Each "answer" for a question can be between -3 and 3 (or 0 and 7).
A user should be able to find similar users based on the results of the questions. I thought using a vector database like Weaviate or Pinecone could help me find these matches on demand, but unfortunately if I do simple experiments the similarity mostly 0.
Here is what I am doing in Pinecone:
Indexing:
const index = await initIndex()
const vectors = [
{
id: '1',
values: [-3, -3, -3, -3, -3]
},
{
id: '2',
values: [-1, -1, -1, -1, -1]
},
{
id: '3',
values: [0, 0, 0, 0, 0]
},
{
id: '4',
values: [1, 1, 1, 1, 1]
},
{
id: '5',
values: [3, 3, 3, 3, 3]
}
] as Vector[]
const upsertRequest: UpsertRequest = {
vectors
}
await index.upsert({
upsertRequest,
})
Searching:
const index = await initIndex()
const queryRequest = {
topK: 10,
vector: [0, 0, 0, 0, 0],
includeValues: true
}
const queryResponse = await index.query({ queryRequest })
Result:
{
"queryResponse": {
"results": [],
"matches": [
{
"id": "2",
"score": 0,
"values": [
-1,
-1,
-1,
-1,
-1
]
},
{
"id": "1",
"score": 0,
"values": [
-3,
-3,
-3,
-3,
-3
]
},
{
"id": "3",
"score": 0,
"values": [
0,
0,
0,
0,
0
]
},
{
"id": "5",
"score": 0,
"values": [
3,
3,
3,
3,
3
]
},
{
"id": "4",
"score": 0,
"values": [
1,
1,
1,
1,
1
]
}
],
"namespace": ""
}
}
Why is the score always 0? Shouldn't it be .5 based on the vectors in my database?