Skip to content

enabled embeddings of raw turns, small other edits#22

Open
jcodella wants to merge 3 commits into
AzureCosmosDB:mainfrom
jcodella:main
Open

enabled embeddings of raw turns, small other edits#22
jcodella wants to merge 3 commits into
AzureCosmosDB:mainfrom
jcodella:main

Conversation

@jcodella

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 22, 2026 19:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an opt-in switch to embed raw conversation turns on write (so they can be vector-searched), and updates both the SDK and Function App plumbing to support searching either the “memories” container or the “turns” container. It also updates Cosmos container provisioning so the turns container is always created with vector + full-text policies (primed for future turn-search) and standardizes vector index type to quantizedFlat.

Changes:

  • Add ENABLE_TURN_EMBEDDINGS / enable_turn_embeddings toggle to control whether turn docs get embeddings on write.
  • Add target parameter to search APIs to route vector search to either memories or turns containers.
  • Update Cosmos provisioning (SDK + IaC) and tests/docs to reflect always-on turns vector/full-text policies and quantizedFlat vector indexes.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/unit/test_thresholds.py Adds unit coverage for ENABLE_TURN_EMBEDDINGS env parsing/defaults.
tests/unit/test_cosmos_memory_client.py Updates provisioning expectations: turns container now includes vector/full-text policies and quantizedFlat.
tests/unit/test_container_routing.py Adds tests for resolving search(target=...) to the correct container.
tests/unit/store/test_memory_store.py Adds coverage ensuring turn embeddings are skipped by default and enabled when configured; validates search routing to turns.
tests/unit/function_app/test_pipeline_factory.py Ensures FA pipeline wires enable_turn_embeddings into MemoryStore.
tests/unit/aio/test_cosmos_memory_client.py Async equivalent of turns container provisioning assertions.
tests/unit/aio/store/test_memory_store.py Async equivalent coverage for turn embedding toggle and search routing.
infra/modules/functions.bicep Adds enableTurnEmbeddings parameter and app setting ENABLE_TURN_EMBEDDINGS.
infra/modules/cosmos.bicep Switches vector index type to quantizedFlat; primes turns container with vector/full-text policies and updates excluded path pattern for turns embedding.
infra/main.parameters.json Adds parameter wiring for enableTurnEmbeddings.
infra/main.bicep Adds top-level enableTurnEmbeddings parameter and wires into functions module; updates embedding-dimensions description for quantizedFlat.
function_app/shared/pipeline_factory.py Passes enable_turn_embeddings from config into MemoryStore.
function_app/shared/config.py Adds get_enable_turn_embeddings() to read ENABLE_TURN_EMBEDDINGS.
function_app/local.settings.json.template Documents and adds local ENABLE_TURN_EMBEDDINGS setting.
Docs/public_api.md Documents new constructor arg enable_turn_embeddings and search_cosmos(..., target=...).
Docs/concepts.md Documents turn-embedding default/flag and how to search turns.
azure/cosmos/agent_memory/thresholds.py Adds defaults + env parsing for enabling turn embeddings.
azure/cosmos/agent_memory/store/memory_store.py Implements enable_turn_embeddings behavior + search(..., target=...) routing.
azure/cosmos/agent_memory/processors/inprocess.py Wires SDK in-process processor store creation to the env-based toggle.
azure/cosmos/agent_memory/cosmos_memory_client.py Adds enable_turn_embeddings constructor arg; primes turns container with vector/full-text policies; adds search_cosmos(..., target=...).
azure/cosmos/agent_memory/aio/store/memory_store.py Async equivalent: turn embedding toggle + search(..., target=...).
azure/cosmos/agent_memory/aio/processors/inprocess.py Async equivalent wiring for env-based toggle.
azure/cosmos/agent_memory/aio/cosmos_memory_client.py Async equivalent constructor/provisioning/search changes.
azure/cosmos/agent_memory/_utils.py Updates container policy builder: quantizedFlat, salience composite toggle, and excluded embedding path pattern.
azure/cosmos/agent_memory/_container_routing.py Adds resolve_search_target() mapping public targets to containers.
azure/cosmos/agent_memory/_base/base_client.py Adds base config wiring so enable_turn_embeddings comes from arg or env default.
.env.template Documents and adds ENABLE_TURN_EMBEDDINGS default.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 391 to 397
indexing_policy = {
"includedPaths": [{"path": "/*"}],
"excludedPaths": [
{"path": "/embedding/*"},
{"path": "/source_memory_ids/*"},
{"path": "/supersedes_ids/*"},
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants