Repository navigation
feat(memory): send the run's executionType on memory search - #2035
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the memory-search execution metadata changes.
No open issues 🎉
What changed in this PR
This PR adds run execution metadata to the UiPath Platform SDK’s memory searches, enabling LLMOps to distinguish debug usage from deployed usage when counting memory use.
Changes:
- Adds a shared
resolve_execution_type()helper and defaults search requests to the run’s execution type while preserving explicit values. - Moves episodic and escalation searches to the vNext endpoint and supports JSON-string escalation answers with capitalized keys.
- Adds resolver and memory-service tests and bumps
uipath-platformto0.3.22.
| File | Description |
|---|---|
packages/uipath/uv.lock |
Updates the platform dependency version to 0.3.22. |
packages/uipath-platform/uv.lock |
Aligns the lockfile with version 0.3.22. |
packages/uipath-platform/tests/services/test_memory_service.py |
Covers search routing, request metadata, and escalation answer parsing. |
packages/uipath-platform/tests/common/test_resolve_execution_type.py |
Tests environment, job, and CLI execution-type signals. |
packages/uipath-platform/src/uipath/platform/memory/memory.py |
Adds optional execution type and escalation answer parsing. |
packages/uipath-platform/src/uipath/platform/memory/_memory_service.py |
Uses vNext search routes with memory and execution types. |
packages/uipath-platform/src/uipath/platform/constants/__init__.py |
Defines the debug environment-variable constant. |
packages/uipath-platform/src/uipath/platform/common/_config.py |
Implements shared debug-versus-runtime resolution. |
packages/uipath-platform/src/uipath/platform/common/__init__.py |
Exports the execution-type resolver. |
packages/uipath-platform/pyproject.toml |
Bumps the package version to 0.3.22. |
Review effort: Balanced
JosephMar
left a comment
There was a problem hiding this comment.
does this depend on backend changes? need to make sure the ship cadence aligns
LLMOps counts how often deployed agent runs put each memory into their prompt,
so it needs to know whether a search comes from a debug or a deployed run.
- resolve_execution_type(): one debug-vs-deployed value for spans and memory.
Debug when UIPATH_IS_DEBUG=true, when Orchestrator marks the job as debug
(isDebug, inherited by every job a debug job starts, e.g. Maestro solution
debug), or when the CLI runs debug/dev/eval; otherwise Runtime.
- MemorySearchRequest gains an optional execution_type; the service fills it
from resolve_execution_type() when the caller leaves it unset.
- search and escalation_search move to the vNext route
POST /llmopstenant_/api/Memory/{id}/search, the one that accepts
executionType, sending memoryType 0 (episodic) or 1 (escalation).
- EscalationMemoryMatch parses the answer LLMOps returns as a JSON string
(and its capitalized Output/Outcome keys), so escalation hits validate
instead of failing the response model.
- Bump uipath-platform to 0.3.22.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
906eb58 to
f23019f
Compare
0.3.22 was released from main. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🚨 Heads up:
|



What changed?
LLMOps is adding a count of how often deployed agent runs put each memory into their prompt, so users can see whether a memory is actually used in production. To count it, LLMOps has to know whether a memory search comes from a debug run or a deployed run. Today the search request carries nothing about the calling run.
resolve_execution_type()(uipath.platform.common) is one debug-vs-deployed value for a run, meant to be shared by memory search and agent spans. A run isDebugwhen any of these says so, andRuntimeotherwise:UIPATH_IS_DEBUG=trueisDebuginternal argument, which marks a debug job and every job started from it. A Maestro solution debug runs a deployed process withuipath rununder such a job, so the CLI command alone would say runtime.debug/dev(playground) orevalA signal can only turn a run into
Debug.MemorySearchRequest.execution_type(executionTypeon the wire) is optional. When the caller leaves it unset,MemoryServicefills it fromresolve_execution_type(). A value set by the caller is kept.searchandescalation_searchmove to the vNext routePOST /llmopstenant_/api/Memory/{memorySpaceId}/search, the route that acceptsexecutionType. They sendmemoryType0(episodic) or1(escalation). Response shapes are unchanged.escalation_ingestkeeps its current route.EscalationMemoryMatchparsesanswerfrom the JSON string LLMOps returns, including capitalizedOutput/Outcomekeys. Before this, every escalation hit failed the response model, and callers had to fall back to parsing the raw payload.Bumps
uipath-platformto 0.3.23.A follow-up in
uipath-agents-pythonmakes spanexecutionTypeuse the sameresolve_execution_type(), so spans and memory usage label a run the same way. That PR needs this one released first.How has this been tested?
tests/services/test_memory_service.pycovers:memoryTypeper methodexecutionTypedefaulting toRuntime, becomingDebugunderUIPATH_IS_DEBUG=true, and an explicit value being keptNone, and as invalid JSON (which still fails validation)tests/common/test_resolve_execution_type.pycovers each signal on its own: the env var in every case,isDebugtrue/false inuipath.json, and theplayground/eval/runtimeexecution sources.uv run pytest tests/services/test_memory_service.py tests/common: 175 passed.ruff check,ruff format --checkandmypy src testsare clean.uipath-platformsuite: only two.ovpnattachment-MIME tests intest_span_utils.pyfail locally. That code isn't touched here; Windows' registry maps.ovpnto an OpenVPN MIME type, so those tests fail on this machine only.Are there any breaking changes?
The old search routes stay up, so earlier SDK versions keep working. This version needs the LLMOps service to serve the vNext search route, which it already does. Usage counting starts once the LLMOps change that reads
executionTypeis deployed; until then the field is ignored.🤖 Generated with Claude Code