enabled embeddings of raw turns, small other edits#22
Open
jcodella wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
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_embeddingstoggle to control whetherturndocs get embeddings on write. - Add
targetparameter 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
quantizedFlatvector 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/*"}, | ||
| ], |
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.
No description provided.