October 21, 2024
Chicago 12, Melborne City, USA
java

Why are the docs not being found in Spring AI Vector Store when they exist in mongo?


I am working on a simple RAG using Spring AI and my MQTT server project available here. I swear I had it working once but I didn’t commit and now it isn’t working again. Basically I think this issue is with the vectorstore. I say that because here

public void updateSmartHomeVectors() throws JsonProcessingException {
        String smartHomeJson = haNetworkCache.getSmartHomeJson();
        List<Document> documents = tokenizeSmartHomeStatus(smartHomeJson);
        vectorStore.add(documents);
        logger.warn("Smart Home Vectors Updated");
}

When I break point on the last line I see

enter image description here

But when I try to confirm they were added using vectorStore.similaritySearch(SearchRequest.query("door").withTopK(5)) I get a result of 0 even though I see things like

enter image description here

in mongo. And when I try to ask it a question I get

I’m sorry, but I can’t determine what devices are available without additional context or >specific information about your setup. Please provide more details or check your smart >home app or hub for a list of connected devices.

What am I missing why is it not seeing the rag info



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video