Based on the error you're encountering, the RAG search is returning a null value for the score field in one of the search results, but the validator expects a v.float64() (a number).
This error indicates that the RAG component is returning search results where at least one result has a null score instead of a numeric value. This could happen in a few scenarios:
- Vector search without embeddings: If the search is being performed without proper embeddings being generated or stored
- Data inconsistency: There might be some entries in your RAG namespace that don't have proper vector embeddings
- Component version issue: This could be a bug in the specific version of the RAG component you're using
Potential Solutions
1. Check your RAG setup
Ensure your RAG instance is properly configured with an embedding model:
const rag = new RAG(components.rag, {
textEmbeddingModel: openai.embedding("text-embedding-3-small"),
embeddingDimension: 1536,
});
2. Verify your search parameters
When calling search, make sure you're providing valid parameters as shown in the RAG component documentation:
const { results, text, entries, usage } = await rag.search(ctx, {
namespace: "global",
query: args.query,
limit: 10,
vectorScoreThreshold: 0.5,
});
3. Check for data migration issues
If you recently migrated data or changed your RAG configuration, some entries might not have proper embeddings. The RAG component supports graceful migrations, so you may need to re-add or migrate your content.