Skip to content

Conversation

@nagkumar91
Copy link

@nagkumar91 nagkumar91 commented Jan 6, 2026

Summary

Adds GenAI memory operation semantic conventions (attributes + spans) and a non-normative implementation guide.

Changes

  • Adds gen_ai.operation.name enum values: search_memory, update_memory (upsert), delete_memory, create_memory_store, delete_memory_store.
  • Adds gen_ai.memory.* attributes for stores/items, type/scope/namespace, search results, update strategy, and metadata.
  • Adds span definitions for memory store lifecycle + search/upsert/delete.
  • Updates generated docs (including provider-specific docs that render the gen_ai.operation.name value set).
  • Adds non-normative implementation guide + diagrams.
  • Adds changelog entry.

Key semantics

  • update_memory is an upsert to avoid create vs update ambiguity.
  • gen_ai.memory.type is a low-cardinality string (e.g., short_term, long_term).
  • gen_ai.memory.scope is required for create_memory_store and delete_memory.
  • delete_memory semantics:
    • If gen_ai.memory.id is set, delete a specific item.
    • If gen_ai.memory.id is not set, delete all items in the specified gen_ai.memory.scope (and within gen_ai.memory.namespace, if applicable).
  • gen_ai.memory.content and gen_ai.memory.query are opt-in due to sensitivity.

Prototype (temporary)

This PR includes a temporary, non-normative runnable prototype under prototype/memory/ that emits traces matching the memory semantic conventions, plus a small trace viewer backed by Azure Application Insights.

  • Stories + docs: prototype/memory/scenarios/README.md
  • One-command run + view: prototype/memory/scenarios/run_and_view.py
  • Viewer UI: prototype/memory/scenarios/trace_viewer.py
  • App Insights query logic: prototype/memory/scenarios/trace_retriever.py

No credentials are committed. Configure via prototype/memory/scenarios/.env.local (git-ignored) copied from prototype/memory/scenarios/.env.sample.

cd prototype/memory

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements-appinsights.txt

cp scenarios/.env.sample scenarios/.env.local
python3 scenarios/run_and_view.py --capture-content

Fixes #3250

Validation

  • make check-policies (required DOCKER_USER_IS_HOST_USER_ARG=-u 0:0 locally due to Docker Desktop volume ownership)
  • make table-check, make registry-generation, make chlog-validate, make yamllint, make markdownlint, make markdown-link-check, make markdown-toc

Merge update

  • Merged main and regenerated markdown with .

@github-actions github-actions bot added enhancement New feature or request area:gen-ai labels Jan 7, 2026
@nagkumar91 nagkumar91 changed the title gen-ai: non-normative memory operations proposal gen-ai: semantic conventions for memory operations Jan 7, 2026
@nagkumar91
Copy link
Author

Added a temporary GenAI Memory prototype under prototype/memory/ (story suite + App Insights viewer).

Entry point:
python3 prototype/memory/scenarios/run_and_view.py --capture-content

Diff stat (latest commit):

39cff95d prototype(memory): add story suite + App Insights viewer
 prototype/memory/.gitignore                        |   16 +
 prototype/memory/README.md                         |   34 +
 .../core/python/genai_memory_otel/__init__.py      |  115 +++
 .../core/python/genai_memory_otel/attributes.py    |  434 +++++++++
 .../core/python/genai_memory_otel/exporters.py     |  525 ++++++++++
 .../core/python/genai_memory_otel/llm_client.py    |  366 +++++++
 .../memory/core/python/genai_memory_otel/spans.py  |  585 +++++++++++
 .../python/genai_memory_otel/tests/__init__.py     |    1 +
 .../python/genai_memory_otel/tests/test_spans.py   |  516 ++++++++++
 .../core/python/genai_memory_otel/tool_spans.py    |   78 ++
 prototype/memory/requirements-appinsights.txt      |    9 +
 prototype/memory/scenarios/.env.sample             |   63 ++
 prototype/memory/scenarios/README.md               |  339 +++++++
 .../scenarios/all_memory_spans_demo/python/main.py | 1025 ++++++++++++++++++++
 .../customer_support_agent/python/main.py          |  300 ++++++
 prototype/memory/scenarios/run_and_view.py         |  236 +++++
 .../scenarios/story1_customer_support/README.md    |  220 +++++
 .../story1_customer_support/python/main.py         |  362 +++++++
 .../scenarios/story2_shopping_assistant/README.md  |  245 +++++
 .../story2_shopping_assistant/python/main.py       |  358 +++++++
 .../story3_multi_agent_research/README.md          |  250 +++++
 .../story3_multi_agent_research/python/main.py     |  655 +++++++++++++
 .../scenarios/story4_multi_tenant_saas/README.md   |  237 +++++
 .../story4_multi_tenant_saas/python/main.py        |  347 +++++++
 .../scenarios/story5_compliance_audit/README.md    |  249 +++++
 .../story5_compliance_audit/python/main.py         |  525 ++++++++++
 .../scenarios/story6_gdpr_lifecycle/README.md      |  290 ++++++
 .../scenarios/story6_gdpr_lifecycle/python/main.py |  321 ++++++
 prototype/memory/scenarios/story_runner.py         |  120 +++
 prototype/memory/scenarios/trace_retriever.py      |  459 +++++++++
 prototype/memory/scenarios/trace_viewer.py         |  895 +++++++++++++++++
 31 files changed, 10175 insertions(+)

@nagkumar91 nagkumar91 marked this pull request as ready for review January 26, 2026 16:38
@nagkumar91 nagkumar91 requested review from a team as code owners January 26, 2026 16:38
@nagkumar91
Copy link
Author

nagkumar91 commented Jan 26, 2026

Updates pushed in this PR (links to updated files/sections):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gen-ai enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant