Skip to content

Add changefeed triggers for summarization and memory processing#4

Merged
aayush3011 merged 15 commits into
AzureCosmosDB:mainfrom
jcodella:main
Apr 16, 2026
Merged

Add changefeed triggers for summarization and memory processing#4
aayush3011 merged 15 commits into
AzureCosmosDB:mainfrom
jcodella:main

Conversation

@jcodella
Copy link
Copy Markdown
Contributor

This pull request introduces comprehensive documentation updates to cover the new automatic processing feature using Cosmos DB change feed triggers. It explains how the toolkit can now automatically process thread summaries, fact extraction, and user summaries in the background, based on configurable thresholds. The changes also provide setup instructions, troubleshooting steps, and usage examples for both local and Azure environments. Additionally, the .github/CODEOWNERS and CI workflow files are removed.

Major documentation improvements:

  • Added detailed explanations of automatic processing via the Cosmos DB change feed trigger, including how it works, required configuration, threshold settings, and when to use automatic vs. on-demand processing (Docs/concepts.md, Docs/design_patterns.md, Docs/README.md) [1] [2] [3] [4] [5].
  • Updated local and Azure testing guides to include setup and validation steps for change feed auto-processing, including configuration examples, test code, and troubleshooting tips (Docs/local_testing.md, Docs/azure_testing.md) [1] [2] [3] [4] [5] [6] [7] [8] [9].

Design pattern and usage updates:

  • Expanded the design patterns documentation to show how automatic processing integrates with existing CRUD, summarization, and fact extraction workflows, with clear references to the new feature (Docs/design_patterns.md) [1] [2] [3].

Project configuration and maintenance:

  • Removed the .github/CODEOWNERS file, eliminating required reviewers for all changes.
  • Removed the .github/workflows/ci.yml file, disabling the existing GitHub Actions CI pipeline.

These updates ensure users and developers can leverage the new automatic processing capabilities and have clear guidance for setup, testing, and troubleshooting.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Cosmos DB change feed–driven “automatic processing” for the Azure Functions pipeline (thread summaries, fact extraction, user summaries) using per-scope counter documents + threshold crossings, and updates docs/samples/tests accordingly. Also removes GitHub repo governance/automation files.

Changes:

  • Implemented on_memory_change Cosmos DB trigger + counter/threshold helpers and extracted batch-processing logic for testability.
  • Added unit + integration tests covering threshold logic, counter retries, and basic end-to-end counter increments.
  • Expanded documentation and the demo notebook to explain/configure/validate change feed auto-processing; updated local settings template; removed CI workflow and CODEOWNERS.

Reviewed changes

Copilot reviewed 14 out of 17 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
azure_functions/function_app.py Adds change feed trigger, counter management, threshold checks, orchestration starts.
azure_functions/activities.py Switches Functions’ Cosmos endpoint env var to COSMOS_DB__accountEndpoint.
azure_functions/local.settings.json.template Updates template settings for change feed + endpoint key.
agent_memory_toolkit/models.py Introduces counter as a new MemoryType.
tests/unit/test_changefeed.py Unit tests for thresholding, counter increments, batch grouping, orchestration starts.
tests/integration/test_changefeed_integration.py Live Cosmos integration test for counter creation/increment behavior.
Docs/concepts.md Documents change feed automatic processing mechanics and required containers/settings.
Docs/design_patterns.md Adds guidance for automatic vs on-demand processing and config knobs.
Docs/local_testing.md Adds local setup/validation steps for change feed auto-processing.
Docs/azure_testing.md Adds Azure app settings + validation steps for change feed auto-processing.
Docs/README.md Updates doc index entries to include automatic processing coverage.
README.md Updates top-level description/diagram/features list to include auto-processing.
Samples/Demo.ipynb Adds change feed demo steps; clears most outputs but includes new auto-processing cells.
.gitignore Adds ignores for .github/, openspec*, .pytest_cache/.
.github/workflows/ci.yml (removed) Removes CI workflow.
.github/CODEOWNERS (removed) Removes required reviewers configuration.

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

Comment thread azure_functions/function_app.py Outdated
Comment thread azure_functions/function_app.py Outdated
Comment thread azure_functions/function_app.py Outdated
Comment thread azure_functions/function_app.py
Comment thread Docs/local_testing.md
Comment thread Docs/azure_testing.md
Comment thread Samples/Demo.ipynb Outdated
Comment thread Samples/Demo.ipynb Outdated
Comment thread tests/integration/test_changefeed_integration.py
Comment thread azure_functions/function_app.py
Comment thread azure_functions/activities.py Outdated
Comment thread agent_memory_toolkit/models.py Outdated
Comment thread azure_functions/function_app.py Outdated
Comment thread azure_functions/function_app.py Outdated
Comment thread azure_functions/function_app.py Outdated
Comment thread azure_functions/function_app.py Outdated
Comment thread azure_functions/function_app.py
Comment thread azure_functions/function_app.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 14, 2026 17:40
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 15 changed files in this pull request and generated 9 comments.

Comments suppressed due to low confidence (1)

tests/unit/test_changefeed.py:1

  • The new FACT_EXTRACTION_EVERY_N threshold path (starting the orchestrator with extract_facts_only) isn’t covered by the added unit tests, while the analogous thread-summary and user-summary paths are. Add a test case that sets FACT_EXTRACTION_EVERY_N > 0, returns an (old,new) pair that crosses the facts threshold, and asserts starter.start_new is called with extract_facts_only.
"""Unit tests for the change feed trigger helpers and batch logic in function_app.py."""

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

Comment thread azure_functions/function_app.py
Comment thread azure_functions/function_app.py Outdated
Comment thread azure_functions/function_app.py Outdated
Comment thread Samples/Demo.ipynb Outdated
Comment thread Samples/Demo.ipynb Outdated
Comment thread Samples/Demo.ipynb Outdated
Comment thread Samples/Demo.ipynb Outdated
Comment thread Samples/Demo.ipynb Outdated
Comment thread Samples/Demo.ipynb
Copilot AI review requested due to automatic review settings April 14, 2026 18:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 20 changed files in this pull request and generated 6 comments.


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

Comment thread azure_functions/function_app.py Outdated
Comment thread azure_functions/activities.py
Comment thread azure_functions/activities.py
Comment thread azure_functions/activities.py
Comment thread azure_functions/activities.py
Comment thread azure_functions/function_app.py
Copilot AI review requested due to automatic review settings April 16, 2026 17:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 23 changed files in this pull request and generated 4 comments.


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

Comment thread azure_functions/function_app.py
Comment thread azure_functions/function_app.py Outdated
Comment thread tests/integration/test_changefeed_integration.py Outdated
Comment thread .github/workflows/ci.yml
Aayush Kataria and others added 2 commits April 16, 2026 10:30
Copilot AI review requested due to automatic review settings April 16, 2026 19:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 23 changed files in this pull request and generated 5 comments.


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

Comment thread agent_memory_toolkit/cosmos_memory_client.py
Comment thread agent_memory_toolkit/aio/cosmos_memory_client.py
Comment thread .github/workflows/ci.yml
Comment thread tests/integration/test_changefeed_integration.py
Comment thread .github/workflows/ci.yml
@aayush3011
Copy link
Copy Markdown
Contributor

@copilot apply changes based on the comments in this thread

@aayush3011 aayush3011 self-requested a review April 16, 2026 19:15
@aayush3011 aayush3011 merged commit 1fac8b9 into AzureCosmosDB:main Apr 16, 2026
10 checks passed
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.

4 participants