Commit f4ac35c
[3.4 Feature Branch] Introduce hook and context management to OpenSearch Agents (#4432)
* add hooks in ml-commons (#4326)
Signed-off-by: Xun Zhang <[email protected]>
* initiate context management api with hook implementation (#4345)
* initiate context management api with hook implementation
Signed-off-by: Mingshi Liu <[email protected]>
* apply spotless
Signed-off-by: Mingshi Liu <[email protected]>
---------
Signed-off-by: Mingshi Liu <[email protected]>
* Add Context Manager to PER (#4379)
* add pre_llm hook to per agent
Signed-off-by: Mingshi Liu <[email protected]>
change context management passing from query parameters to payload
Signed-off-by: Mingshi Liu <[email protected]>
pass hook registery into PER
Signed-off-by: Mingshi Liu <[email protected]>
apply spotless
Signed-off-by: Mingshi Liu <[email protected]>
initiate context management api with hook implementation
Signed-off-by: Mingshi Liu <[email protected]>
* add comment
Signed-off-by: Mingshi Liu <[email protected]>
* format
Signed-off-by: Mingshi Liu <[email protected]>
* add validation
Signed-off-by: Mingshi Liu <[email protected]>
---------
Signed-off-by: Mingshi Liu <[email protected]>
* add inner create context management to agent register api
Signed-off-by: Mingshi Liu <[email protected]>
* add code coverage
Signed-off-by: Mingshi Liu <[email protected]>
* allow context management hook register in during agent execute
Signed-off-by: Mingshi Liu <[email protected]>
* add code coverage
Signed-off-by: Mingshi Liu <[email protected]>
* add more code coverage
Signed-off-by: Mingshi Liu <[email protected]>
* add validation check
Signed-off-by: Mingshi Liu <[email protected]>
* adapt to inplace update for context
Signed-off-by: Mingshi Liu <[email protected]>
* Allow context management inline create in register agent without storing in index (#4403)
* allow inline create context management without storing in agent register
Signed-off-by: Mingshi Liu <[email protected]>
* make ML_COMMONS_MULTI_TENANCY_ENABLED default is false
Signed-off-by: Mingshi Liu <[email protected]>
---------
Signed-off-by: Mingshi Liu <[email protected]>
* Update the POST_TOOL hook emit saving to agentic memory (#4408)
* Fix POST_TOOL hook interaction updates and add tenant ID support
Signed-off-by: Mingshi Liu <[email protected]>
- Fix POST_TOOL hook to return full ContextManagerContext like PRE_LLM hook
- Update MLChatAgentRunner to properly handle interaction updates from POST_TOOL hook
- Ensure interactions list and tmpParameters.INTERACTIONS stay synchronized
- Add tenant ID support to MLPredictionTaskRequest in ModelGuardrail and SummarizationManager
Signed-off-by: Mingshi Liu <[email protected]>
* fix error message escaping
Signed-off-by: Mingshi Liu <[email protected]>
* consolicate post_hook logic
Signed-off-by: Mingshi Liu <[email protected]>
---------
Signed-off-by: Mingshi Liu <[email protected]>
* bump supported version to 3.4
Signed-off-by: Mingshi Liu <[email protected]>
---------
Signed-off-by: Xun Zhang <[email protected]>
Signed-off-by: Mingshi Liu <[email protected]>
Co-authored-by: Xun Zhang <[email protected]>1 parent 285b6e2 commit f4ac35c
File tree
89 files changed
+9840
-1551
lines changed- common/src
- main
- java/org/opensearch/ml/common
- agent
- contextmanager
- hooks
- input/execute/agent
- model
- transport
- agent
- contextmanagement
- resources/index-mappings
- test/java/org/opensearch/ml/common
- agent
- contextmanager
- transport/agent
- ml-algorithms/src
- main/java/org/opensearch/ml/engine
- agents
- algorithms
- agent
- contextmanager
- test/java/org/opensearch/ml/engine/algorithms
- agent
- contextmanager
- plugin
- src
- main/java/org/opensearch/ml
- action
- agents
- agent
- contextmanagement
- plugin
- rest
- task
- utils
- test/java/org/opensearch/ml
- action
- agents
- agent
- contextmanagement
- rest
- task
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
89 files changed
+9840
-1551
lines changedLines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
Lines changed: 95 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| 78 | + | |
| 79 | + | |
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
| |||
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| 95 | + | |
| 96 | + | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
| |||
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
| 111 | + | |
| 112 | + | |
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
| |||
128 | 138 | | |
129 | 139 | | |
130 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
131 | 152 | | |
132 | 153 | | |
133 | 154 | | |
| |||
171 | 192 | | |
172 | 193 | | |
173 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
174 | 201 | | |
175 | 202 | | |
176 | 203 | | |
| |||
214 | 241 | | |
215 | 242 | | |
216 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
217 | 253 | | |
218 | 254 | | |
219 | 255 | | |
| |||
256 | 292 | | |
257 | 293 | | |
258 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
259 | 301 | | |
260 | 302 | | |
261 | 303 | | |
| |||
283 | 325 | | |
284 | 326 | | |
285 | 327 | | |
| 328 | + | |
| 329 | + | |
286 | 330 | | |
287 | 331 | | |
288 | 332 | | |
| |||
329 | 373 | | |
330 | 374 | | |
331 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
332 | 382 | | |
333 | 383 | | |
334 | 384 | | |
| |||
351 | 401 | | |
352 | 402 | | |
353 | 403 | | |
| 404 | + | |
| 405 | + | |
354 | 406 | | |
355 | 407 | | |
356 | 408 | | |
| |||
384 | 436 | | |
385 | 437 | | |
386 | 438 | | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
387 | 482 | | |
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
Lines changed: 148 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 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 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
0 commit comments