Add MemoryHouse envelope integration - #44
Open
Ali Kanso (akanso) wants to merge 1 commit into
Open
Conversation
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
Contributor
There was a problem hiding this comment.
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
AMTMemoryEnvelopeAdapterwith 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 |
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.
Summary
Validation
ruff check azure/cosmos/agent_memory/memoryhouse tests/unit/memoryhouseruff format --check azure/cosmos/agent_memory/memoryhouse tests/unit/memoryhousepytest -q tests/unit/memoryhouse tests/unit/test_models.py(130 passed)