Add GenAI memory operation conventions#140
Merged
trask merged 24 commits intoMay 19, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the GenAI “memory operations” semantic conventions into this repo by adding new gen_ai.operation.name values, defining corresponding client spans and memory-related attributes (plus a JSON schema), and extending the reference scenario/reporting pipeline to demonstrate capturability (Google ADK scenario).
Changes:
- Add new memory operation span definitions (
create_memory_store,search_memory,update_memory,delete_memory,delete_memory_store) and memory attributes (gen_ai.memory.store.id,gen_ai.memory.record.id,gen_ai.memory.query.text,gen_ai.memory.records). - Introduce
docs/gen-ai/gen-ai-memory-records.jsonschema and update generated docs tables/pages to include the new operations/attributes. - Extend reference scenario + reporting to cover Google ADK memory create/update/search spans and generate new span coverage reports.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| reference/src/semconv_genai/semconv_model.py | Registers the new memory span types in the reference model loader. |
| reference/src/semconv_genai/report.py | Adds doc anchor links for the new memory span types in report output. |
| reference/src/semconv_genai/data_files.py | Adds memory span types to the reference report display order. |
| reference/scenarios/google-adk/scenario.py | Implements Google ADK memory create/update/search reference spans and attributes. |
| reference/scenarios/google-adk/data.json | Declares expected attributes observed for the new Google ADK memory span types. |
| reference/reports/update-memory-span.md | Adds generated reference coverage report page for update_memory. |
| reference/reports/search-memory-span.md | Adds generated reference coverage report page for search_memory. |
| reference/reports/delete-memory-store-span.md | Adds generated reference coverage report page for delete_memory_store (currently no supporting libs). |
| reference/reports/delete-memory-span.md | Adds generated reference coverage report page for delete_memory (currently no supporting libs). |
| reference/reports/create-memory-store-span.md | Adds generated reference coverage report page for create_memory_store. |
| reference/README.md | Lists the new memory span coverage reports in the reference index. |
| model/gen-ai/spans.yaml | Defines the new memory client span types and shared memory attribute group. |
| model/gen-ai/registry.yaml | Adds new gen_ai.operation.name values and memory attribute definitions (including schema linkage). |
| docs/registry/attributes/gen-ai.md | Updates generated attribute registry page to include new memory attributes/operation values. |
| docs/gen-ai/openai.md | Updates provider guidance docs to include new operation names in well-known lists. |
| docs/gen-ai/mcp.md | Updates MCP guidance docs to include new operation names in well-known lists. |
| docs/gen-ai/gen-ai-spans.md | Updates span documentation (including new memory span sections). |
| docs/gen-ai/gen-ai-metrics.md | Updates metric documentation to include new operation names in well-known lists. |
| docs/gen-ai/gen-ai-memory-records.json | Adds the JSON schema for gen_ai.memory.records. |
| docs/gen-ai/gen-ai-events.md | Updates event documentation to include new operation names in well-known lists. |
| docs/gen-ai/gen-ai-agent-spans.md | Updates agent span documentation to include new operation names in well-known lists. |
| docs/gen-ai/azure-ai-inference.md | Updates Azure AI Inference guidance docs to include new operation names in well-known lists. |
| docs/gen-ai/aws-bedrock.md | Updates AWS Bedrock guidance docs to include new operation names in well-known lists. |
| docs/gen-ai/anthropic.md | Updates Anthropic guidance docs to include new operation names in well-known lists. |
| CHANGELOG.md | Adds an Unreleased changelog entry for the new memory operation conventions. |
Add the non-normative memory records model representation, align the committed JSON schema with it, and apply the memory store id wording nit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the changelog link to the migrated GenAI PR and make create_memory_store set the memory store id whenever applicable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closed
trask
reviewed
May 11, 2026
Refresh generated markdown after resolving the registry documentation conflict. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove synthesized Google ADK memory store and record ids, and add AWS Bedrock AgentCore reference coverage for memory store lifecycle and record operations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
trask
reviewed
May 11, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Relax provider name for memory spans, add memory record count, remove store IDs from memory span names, and document opt-in capture for sensitive memory content. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add create_memory and upsert_memory operations, narrow update_memory to existing-record modifications, and update reference coverage for AgentCore and Google ADK. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make content required inside emitted memory record JSON objects while keeping the gen_ai.memory.records attribute opt-in. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 34 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (3)
reference/src/semconv_genai/semconv_model.py:1
- The PR description lists memory operation names as
create_memory_store,search_memory,update_memory,delete_memory,delete_memory_store, but the implementation also introducescreate_memoryandupsert_memory(and corresponding spans/reports). Please either update the PR description to include these operations or remove/defers these additions so the PR matches the stated scope.
reference/src/semconv_genai/semconv_model.py:1 - The PR description lists memory operation names as
create_memory_store,search_memory,update_memory,delete_memory,delete_memory_store, but the implementation also introducescreate_memoryandupsert_memory(and corresponding spans/reports). Please either update the PR description to include these operations or remove/defers these additions so the PR matches the stated scope.
docs/gen-ai/non-normative/models.ipynb:1 - These fields default to
Nonebut are annotated as non-optional (str,dict[str, Any],float). This creates a type mismatch (and can cause runtime validation errors ifNoneis ever passed explicitly). Preferstr | None,dict[str, Any] | None, andfloat | Nonefor consistency with the defaults.
{
trask
reviewed
May 12, 2026
Update the GenAI spans TOC for create/upsert memory, clarify the changelog entry, and align AgentCore reference labels with memory store semantic operations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
trask
reviewed
May 12, 2026
Add generated create_memory and upsert_memory span sections and group memory spans under a Memory heading in the spans document. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
trask
reviewed
May 13, 2026
Remove repeated span-name high-cardinality notes and simplify the memory store id attribute note now that store ids are not part of memory span names. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
trask
reviewed
May 13, 2026
…-ops Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace per-operation memory span conventions with a single gen_ai.memory.client span keyed by gen_ai.operation.name, and update generated docs, schema snapshot, and reference reports. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reformat gen-ai-memory-records.json with the notebook generator's 4-space JSON indentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ADK's InMemoryMemoryService has no public store-lifecycle API and the constructor produces no library-owned store identifier, so wrapping it in a create_memory_store span did not credibly demonstrate the operation. create_memory_store remains covered by reference/scenarios/aws-bedrock-agentcore/ where the returned memoryId is captured directly from the SDK response. Also annotate the in-memory store_id derivation as 'derivable' per the evaluate-reference rubric: (app_name, user_id) is ADK's own internal scope key for InMemoryMemoryService.
…server routes The aws-bedrock-agentcore reference scenario wrapped every boto3 call in botocore.stub.Stubber, which intercepts before the HTTP transport. Per reference/README.md, each scenario must exercise the SDK against the deterministic local mock server, so server.address/server.port coverage came from client configuration alone rather than from an actual SDK request. Add a bedrock_agentcore mock-server blueprint that serves both the control plane (CreateMemory, DeleteMemory) and data plane (BatchCreateMemoryRecords, BatchUpdateMemoryRecords, RetrieveMemoryRecords, DeleteMemoryRecord) operations at the URL paths declared by the botocore service model, and strip Stubber from the scenario. Span attributes are unchanged (data.json diff is empty); they are now observed from real HTTP round trips.
…enario Address 7 comments from PR open-telemetry#140 review 4293190348. The mock previously accepted any memoryId/memoryRecordId, and the scenario used hardcoded constants disconnected from the IDs returned by create_memory and batch_create_memory_records, so the lifecycle spans did not demonstrate real continuity across operations. Scenario: - Drop MEMORY_ID and MEMORY_RECORD_ID constants. - run_create_memory_store_reference returns response['memory']['id']. - run_create_and_update_memory_reference returns the memoryRecordId from the batch_create response, used in the subsequent batchUpdate payload. - main() threads both IDs into search, delete_memory, and delete_memory_store so every span and SDK call references real state. Mock blueprint: - create_memory and delete_memory now own the _MEMORIES lifecycle. - delete_memory, batchCreate, batchUpdate, retrieve, and delete_memory_record return 404 when memory_id is not in _MEMORIES. - batchUpdate reports missing records in failedRecords with errorCode=404 instead of falsely claiming SUCCEEDED. - delete_memory_record returns 404 when the record is not present. data.json diff is empty; scenario passes end-to-end against the tightened mock.
lmolkova
approved these changes
May 18, 2026
Address review feedback by inlining memory span attributes and removing the custom memory schema default helper. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lmolkova
approved these changes
May 19, 2026
Krishnachaitanyakc
added a commit
to Krishnachaitanyakc/semantic-conventions-genai
that referenced
this pull request
May 21, 2026
`make generate-all` after rebasing onto main with the GenAI memory attributes (open-telemetry#140) renumbers all subsequent footnote references in docs/registry/attributes/gen-ai.md. The handoff attribute rows (gen_ai.agent.handoff.source.name, .target.name) added by this PR remain present and unchanged; only the numeric footnote indices on the surrounding rows shift.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the narrowed GenAI memory operations proposal from open-telemetry/semantic-conventions#3250 into this repository.
Adds:
create_memory_store,search_memory,update_memory,delete_memory,delete_memory_storegen_ai.memory.store.id,gen_ai.memory.record.id,gen_ai.memory.query.text,gen_ai.memory.recordsdocs/gen-ai/gen-ai-memory-records.jsonwithcontentintentionally allowing any JSON valueupsert_memoryandsearch_memoryspans (matching ADK'sadd_session_to_memory/search_memoryAPI surface); AWS Bedrock AgentCore scenario coverscreate_memory_store,create_memory,update_memory,search_memory,delete_memory,delete_memory_storeReview feedback applied from old PR
gen_ai.memory.recordsYAML and JSON schema so recordcontentcan be any JSON value.gen_ai.memory.store.idin registry guidance.reference/.Framework evidence
BaseMemoryServiceandInMemoryMemoryServicedefineadd_session_to_memory,add_events_to_memory,search_memoryadd,search,delete, anddelete_allValidation
make generate-allmake check-policiescd reference && uv run run-scenario google-adkcd reference && uv run update-reportscd reference && uv tool run --from ruff ruff check src/semconv_genai scenarios/google-adkcd reference && uv tool run --from ruff ruff format --check src/semconv_genai scenarios/google-adkNotes
This intentionally keeps the migrated scope narrow and leaves contentious overlap with
gen_ai.retrieval.documentsto follow-up issue #139.