You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m using a vectorStore and want to build a prompt that includes two distinct contexts, both retrieved from the vector store, for example:
Given the context below:
-----------------
<context1> // result set #1 from vectorStore (e.g., filter A / topK1)
-----------------
Write a document using the model below:
-----------------
<context2> // result set #2 from vectorStore (e.g., filter B / topK2)
-----------------
I’m currently using QuestionAnswerAdvisory like this:
What’s the recommended Spring AI pattern to run two separate vectorStore queries (with different filters/topK) and inject both result sets into a single prompt?
Is it possible to attach two QuestionAnswerAdvisors (one per filter) and have them both contribute to the final context?
Or should I run two queries manually (pre-prompt), then pass them as separate variables/sections in the prompt template (e.g., <context1> and <context2>) via prompt().param(...)?
Any code snippet or best practice for merging multiple retrievals into one prompt would be greatly appreciated. Thanks!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone, I need some guidance.
I’m using a
vectorStore
and want to build a prompt that includes two distinct contexts, both retrieved from the vector store, for example:I’m currently using
QuestionAnswerAdvisory
like this:What’s the recommended Spring AI pattern to run two separate vectorStore queries (with different filters/topK) and inject both result sets into a single prompt?
<context1>
and<context2>
) viaprompt().param(...)
?Any code snippet or best practice for merging multiple retrievals into one prompt would be greatly appreciated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions