Florian
Florian
CCConvex Community
Created by Florian on 5/27/2025 in #support-community
Vector Search with relational filter
With Prisma, I would do something like this:
prismadb.embeddings.findMany(
{
where: {
note: {
userId
}
}
})
prismadb.embeddings.findMany(
{
where: {
note: {
userId
}
}
})
Not sure what SQL query this translates to. But the userId is only stored in the note and not in the embeddings.
10 replies
CCConvex Community
Created by Florian on 5/27/2025 in #support-community
Vector Search with relational filter
That kind of duplication feels a bit ugly compared to relational databases
10 replies
CCConvex Community
Created by Florian on 5/27/2025 in #support-community
Vector Search with relational filter
So the userId has to be in both the note and the note embedding? i.e.
notes: defineTable({
title: v.string(),
body: v.string(),
userId: v.id("users"),
}).index("by_userId", ["userId"]),

embeddings: defineTable({
content: v.string(),
embedding: v.array(v.float64()),
noteId: v.id("notes"),
userId: v.id("users"),
})
notes: defineTable({
title: v.string(),
body: v.string(),
userId: v.id("users"),
}).index("by_userId", ["userId"]),

embeddings: defineTable({
content: v.string(),
embedding: v.array(v.float64()),
noteId: v.id("notes"),
userId: v.id("users"),
})
10 replies
CCConvex Community
Created by Florian on 5/27/2025 in #support-community
Vector Search with relational filter
How would I change my schema to do that? Considering that I split notes into text chunks before embedding them, so there is a 1-to-many relationship.
10 replies
CCConvex Community
Created by Florian on 5/21/2025 in #support-community
http request blocked by cors
For anyone running into the same problem, I had to add the "Authorization" header to the options endpoint like this:
"Access-Control-Allow-Headers": "Content-Type, Digest, Authorization",
"Access-Control-Allow-Headers": "Content-Type, Digest, Authorization",
28 replies
CCConvex Community
Created by Florian on 5/21/2025 in #support-community
http request blocked by cors
Maybe it works different because the AI SDK streams the response
28 replies
CCConvex Community
Created by Florian on 5/21/2025 in #support-community
http request blocked by cors
The options request gets through, but the post request doesn't
28 replies
CCConvex Community
Created by Florian on 5/21/2025 in #support-community
http request blocked by cors
22.5.2025, 17:26:45 [CONVEX H(OPTIONS /api/chat)] [LOG] 'CORS request' {
path: 'https://clean-deer-999.convex.site/api/chat',
origin: 'http://localhost:3000',
headers: Headers { host: 'clean-deer-999.convex.site', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', accept: '*/*', 'accept-encoding': 'gzip, deflate, br, zstd', 'accept-language': 'en-US,en;q=0.9,de-DE;q=0.8,de;q=0.7,en-DE;q=0.6,ru;q=0.5', 'access-control-request-headers': 'authorization,content-type', 'access-control-request-method': 'POST', origin: 'http://localhost:3000', priority: 'u=1, i', referer: 'http://localhost:3000/', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'cross-site', 'x-forwarded-for': '88.74.147.132', 'x-forwarded-host': 'clean-deer-999.convex.site', 'x-forwarded-proto': 'https', 'convex-request-id': '83cfc13510ffe6c4' },
method: 'OPTIONS',
body: null
}
22.5.2025, 17:26:45 [CONVEX H(OPTIONS /api/chat)] [LOG] 'CORS request' {
path: 'https://clean-deer-999.convex.site/api/chat',
origin: 'http://localhost:3000',
headers: Headers { host: 'clean-deer-999.convex.site', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', accept: '*/*', 'accept-encoding': 'gzip, deflate, br, zstd', 'accept-language': 'en-US,en;q=0.9,de-DE;q=0.8,de;q=0.7,en-DE;q=0.6,ru;q=0.5', 'access-control-request-headers': 'authorization,content-type', 'access-control-request-method': 'POST', origin: 'http://localhost:3000', priority: 'u=1, i', referer: 'http://localhost:3000/', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'cross-site', 'x-forwarded-for': '88.74.147.132', 'x-forwarded-host': 'clean-deer-999.convex.site', 'x-forwarded-proto': 'https', 'convex-request-id': '83cfc13510ffe6c4' },
method: 'OPTIONS',
body: null
}
Can you see anything in here?
28 replies
CCConvex Community
Created by Florian on 5/21/2025 in #support-community
http request blocked by cors
@erquhart Ok, the auth error is solved. But I'm still getting CORS error after adding the corsRouter.
28 replies
CCConvex Community
Created by Florian on 5/21/2025 in #support-community
http request blocked by cors
AuthProviderDiscoveryFailed but there are 0 Google results
28 replies
CCConvex Community
Created by Florian on 5/21/2025 in #support-community
http request blocked by cors
doesn't look like it
28 replies
CCConvex Community
Created by Florian on 5/21/2025 in #support-community
http request blocked by cors
I'll give it a try, but my Convex auth randomly stopped working
28 replies
CCConvex Community
Created by Florian on 5/21/2025 in #support-community
http request blocked by cors
It does look useful
28 replies
CCConvex Community
Created by Florian on 5/21/2025 in #support-community
http request blocked by cors
And my package.json entry looks like this: "convex-helpers": "npm:@erquhart/convex-helpers@^0.1.87",
28 replies
CCConvex Community
Created by Florian on 5/21/2025 in #support-community
http request blocked by cors
I can't figure out the import statement
28 replies
CCConvex Community
Created by Florian on 5/21/2025 in #support-community
http request blocked by cors
Thank you. Is that npm install command broken?
28 replies