Skip to content

Add MemoryHouse envelope integration - #44

Open
Ali Kanso (akanso) wants to merge 1 commit into
AzureCosmosDB:mainfrom
akanso:akanso/memoryEnvelope
Open

Add MemoryHouse envelope integration#44
Ali Kanso (akanso) wants to merge 1 commit into
AzureCosmosDB:mainfrom
akanso:akanso/memoryEnvelope

Conversation

@akanso

Copy link
Copy Markdown

Summary

  • add strict MemoryHouse envelope, owner, ACL, and provenance models
  • add owner-derived personal, team, and organization scope without a redundant serialized scope field
  • add subtype-specific content types and lossless AMT record wrap/unwrap support
  • document the architecture, implementation plan, and phased task backlog

Validation

  • ruff check azure/cosmos/agent_memory/memoryhouse tests/unit/memoryhouse
  • ruff format --check azure/cosmos/agent_memory/memoryhouse tests/unit/memoryhouse
  • pytest -q tests/unit/memoryhouse tests/unit/test_models.py (130 passed)

Introduce strict envelope governance models, owner-derived scope, subtype content types, and lossless AMT record wrapping with focused documentation and tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 5857338c-7b89-4bbf-8ad5-1a96628babdc
Copilot AI lite review requested due to automatic review settings August 21, 2026 01:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 the initial “MemoryHouse envelope” integration layer for Agent Memory Toolkit (AMT): strict Pydantic wire models for the envelope/governance fields, plus a lossless adapter that wraps AMT MemoryRecordBase documents into a governed envelope and unwraps them back into typed AMT records. It also adds unit tests and extensive design/plan documentation for phased rollout.

Changes:

  • Added strict MemoryHouse envelope models (owner, ACL, provenance, envelope) with camelCase wire aliases and extra="forbid" governance validation.
  • Added AMTMemoryEnvelopeAdapter with stable envelope ID helpers and subtype-specific, versioned content-type mapping plus integrity checks on unwrap.
  • Added unit tests covering strict model validation, canonical ID encoding/decoding, content-type round-tripping, and lossless wrap/unwrap across supported record types; added detailed integration docs/tasks.

Reviewed changes

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

Show a summary per file
File Description
azure/cosmos/agent_memory/memoryhouse/models.py Adds strict Pydantic wire models for the MemoryHouse envelope and governance components.
azure/cosmos/agent_memory/memoryhouse/exceptions.py Introduces integration-specific exception hierarchy for envelope validation/content-type/integrity errors.
azure/cosmos/agent_memory/memoryhouse/adapter.py Implements envelope ID helpers, content-type mapping/parsing, and the wrap/unwrap adapter with integrity checks.
azure/cosmos/agent_memory/memoryhouse/__init__.py Exports the adapter, models, constants, and exceptions as the public MemoryHouse integration surface.
tests/unit/memoryhouse/__init__.py Adds a test package marker for MemoryHouse unit tests.
tests/unit/memoryhouse/test_models.py Tests strict envelope/governance validation, derived non-serialized scope, and wire-alias serialization.
tests/unit/memoryhouse/test_adapter.py Tests ID/content-type round-trips, lossless wrap/unwrap for all supported record types, and negative integrity cases.
Docs/MemoryHouseEnvelope/tasks.md Adds a phased, acceptance-criteria-driven task backlog for the full integration roadmap.
Docs/MemoryHouseEnvelope/memoryhouse-amt-envelope.md Documents the envelope contract, mapping, ID strategy, content types, and operational considerations.
Docs/MemoryHouseEnvelope/implementation-plan.md Provides an implementation plan and constraints for phased delivery (adapter → service → mirror/projection).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +187 to +188
except PydanticValidationError as exc:
raise MemoryEnvelopeValidationError(f"Invalid MemoryHouse envelope input: {exc}") from exc
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