Commit d4d2f6e
fix(memory): honor Vertex RAG top-k configuration
VertexAiRagMemoryService accepts a similarity_top_k argument but dropped it
when constructing the VertexRagStore, so search_memory read back None and
retrieval silently ignored the configured limit. The writer was removed
during the agentplatform migration while the reader was kept.
The value is now held on the service and passed to the RagQuery, which is
where retrieveContexts reads it. It is deliberately not restored on the
VertexRagStore: that request message carries rag_resources, rag_corpora and
vector_distance_threshold only, so a similarity_top_k set there would travel
as an undefined field on the request rather than as a retrieval limit.
Behavior change: anyone who set similarity_top_k has been getting the API
default and now gets the value they configured, so result counts move down or
up depending on whether that value is below or above the default.
No public interface changes.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 9547901541 parent f72f0db commit d4d2f6e
2 files changed
Lines changed: 33 additions & 1 deletion
File tree
- src/google/adk/memory
- tests/unittests/memory
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
| |||
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
211 | | - | |
| 214 | + | |
212 | 215 | | |
213 | 216 | | |
214 | 217 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
34 | 63 | | |
35 | 64 | | |
36 | 65 | | |
| |||
0 commit comments