import io.agentscope.core.rag.integration.haystack.HayStackConfig;
import io.agentscope.core.rag.integration.haystack.HayStackKnowledge;
import io.agentscope.core.rag.model.RetrieveConfig;
HayStackConfig config = HayStackConfig.builder()
.baseUrl("http://localhost:8080") // your HayStack service
.topK(10)
.build();
HayStackKnowledge knowledge = HayStackKnowledge.builder()
.config(config)
.build();
List<Document> hits = knowledge.retrieve(
"What is AI?",
RetrieveConfig.builder().limit(5).build()
).block();