Skip to content

Commit 8a365f4

Browse files
authored
docs: correct Cosmos memory guide state scoping (#9443)
1 parent 2e08ad7 commit 8a365f4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎python/packages/azure-cosmos-memory/AGENTS.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ from agent_framework_azure_cosmos_memory import CosmosMemoryContextProvider
3535
- Documentation and examples that show a literal Foundry project endpoint must use the full project-scoped form
3636
`https://your-account.services.ai.azure.com/api/projects/your-project`, including the `/api/projects/your-project`
3737
path.
38-
- Set a stable `user_id` in `state["user_id"]` or `session.state["user_id"]` for long-term,
39-
cross-session memory. Without it, memory scopes to the ephemeral session id and the provider
40-
logs a one-time warning.
38+
- Set a stable `user_id` in the provider-scoped state for long-term, cross-session memory:
39+
`session.state.setdefault(provider.source_id, {})["user_id"] = "user-123"`.
40+
Without it, memory scopes to the ephemeral session id.
4141
- Background fact extraction runs out-of-band after each turn. Call `provider.flush()` before
4242
shutdown so in-flight extraction completes before the client closes.
4343
- See `README.md` for full configuration, authentication, and processor-tuning options.

0 commit comments

Comments
 (0)