Skip to content

Add zep-ms-agent-framework integration (Microsoft Agent Framework)#522

Merged
danielchalef merged 6 commits into
mainfrom
feat/zep-agent-framework
Jun 18, 2026
Merged

Add zep-ms-agent-framework integration (Microsoft Agent Framework)#522
danielchalef merged 6 commits into
mainfrom
feat/zep-agent-framework

Conversation

@danielchalef

@danielchalef danielchalef commented Jun 17, 2026

Copy link
Copy Markdown
Member

Adds the zep-ms-agent-framework package (integrations/ms-agent-framework/python) — Zep memory for the Microsoft Agent Framework.

Hook (verified against installed agent-framework-core 1.8.1)

ZepContextProvider(ContextProvider)before_run persists the latest user message via thread.add_messages(return_context=True) and injects the returned Context Block with context.extend_instructions; after_run persists the assistant response. Attach via context_providers=[ZepContextProvider(...)] on the Agent. Lazy user/thread creation; Zep failures never crash the agent.

Names / deps

dist zep-ms-agent-framework, import zep_ms_agent_framework. agent-framework-core>=1.8.1 (stable; no --prerelease), zep-cloud>=3.23.0. Python ≥3.11.

Ships

README, SETUP.md (Zep signup at getzep.com), runnable example (OpenAIChatClient), 43 mock tests + a live integration test, Makefile, CHANGELOG.

Validation

ruff + ruff format + mypy + pytest (43 passed, 1 skipped) on Python 3.11–3.13; live end-to-end smoke test against Zep + OpenAI passed. Approach in integrations/SPIKE_FINDINGS.md.

🤖 Generated with Claude Code

@danielchalef danielchalef force-pushed the feat/zep-agent-framework branch from 27ca1e2 to 9fa7cf9 Compare June 17, 2026 03:04
@danielchalef danielchalef changed the title Add zep-agent-framework integration (Microsoft Agent Framework) Add zep-ms-agent-framework integration (Microsoft Agent Framework) Jun 17, 2026
@danielchalef danielchalef force-pushed the feat/zep-agent-framework branch from 5afe848 to d6bea42 Compare June 17, 2026 19:22
danielchalef added a commit that referenced this pull request Jun 18, 2026
The Claude Code Review workflow (added in #530) granted only
`pull-requests: read` / `issues: read`. The anthropics/claude-code-action
needs Pull requests + Issues write access to post its findings as inline PR
comments — with read-only, the run succeeds but posts nothing (observed:
`permission_denials_count: 20`, `No buffered inline comments`, zero comments
on PRs #522#527/#529). Per the official docs, the action's GitHub App requires
Contents/Issues/Pull requests Read & write, and every posting example uses
`pull-requests: write` + `issues: write`.

Bump pull-requests and issues to write (contents stays read — review-only, no
commits/PRs created).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
danielchalef added a commit that referenced this pull request Jun 18, 2026
The code-review plugin only posts findings when invoked with `--comment`;
without it the action reviews the PR (spending tokens) but prints to the
hidden terminal and posts nothing. Confirmed across PRs #522#527/#529:
runs complete `success` with write perms (post-#531) but log "No buffered
inline comments" and leave zero comments. Per the plugin spec ("If --comment
was NOT provided, stop here. Do not post any GitHub comments.").

Append --comment to the prompt; #531's pull-requests/issues write perms are
required for it to post and stay in place.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
danielchalef and others added 2 commits June 18, 2026 11:01
Memory integration for the Microsoft Agent Framework (Python) via a
ContextProvider that persists turns to Zep and injects a Context Block.

- ZepContextProvider(ContextProvider): before_run persists the latest user
  message (thread.add_messages(return_context=True)) and injects the returned
  Context Block via context.extend_instructions; after_run persists the
  assistant response. Lazy user/thread creation; Zep failures degrade to
  memoryless rather than crashing the agent.
- Package: integrations/ms-agent-framework/python; dist zep-ms-agent-framework;
  import zep_ms_agent_framework. Depends on agent-framework-core>=1.8.1 (stable)
  and zep-cloud>=3.23.0. Python >=3.11.
- README, SETUP (Zep signup), runnable example (OpenAIChatClient), 43 mock
  tests + a live integration test. CI paths-filter entry added.

Verified: ruff + ruff format + mypy + pytest (43 passed, 1 skipped) on
Python 3.11-3.13; live end-to-end smoke test against Zep + OpenAI passed.
See integrations/SPIKE_FINDINGS.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ms-agent-framework

- Add shared _text.truncate_message_content helper to cap thread messages at
  Zep's 4,096-char limit (truncate to ~4,000, never silently drop), warning with
  lengths only (no content/PII). Apply to both before_run (user message) and
  after_run (assistant message) so an oversize turn is persisted instead of
  triggering a swallowed 400.
- Track a per-run _user_turn_persisted flag (reset each before_run, not the
  per-session state dict) and gate after_run on it, so a failed user-turn
  persist no longer leaves an orphaned assistant-only record.
- Guard ONLY `import agent_framework` in __init__; import context_provider
  outside the try so a broken zep_cloud surfaces its own error rather than
  being mislabeled as a missing Agent Framework dependency.
- Add regression tests for oversize truncation (both hooks), warning content
  safety, and after_run skipping when the user turn failed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
danielchalef added a commit that referenced this pull request Jun 18, 2026
The public Claude Code Review step had no timeout, so a hung run sat
in_progress at the job default (360 min) instead of failing fast. A
review that stalls is an infra hang, not a slow review (observed on
PR #522: a run sat unchanged for 48 min until manually cancelled).

Cap the step at 10 minutes so a stalled review resolves to a failed
check that can be re-run, matching zep-proprietary's claude-review.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@claude

This comment has been minimized.

danielchalef and others added 2 commits June 18, 2026 15:52
The python paths-filter used key `agent-framework` →
`integrations/agent-framework/python/**`, but the package lives at
`integrations/ms-agent-framework/python/` (dist `zep-ms-agent-framework`,
import `zep_ms_agent_framework`). The filter never matched, so lint /
type-check / tests never ran for this package in CI.

The matched filter key flows through as the test-python matrix
`package`, and the test-python action resolves
`integrations/<package>/python` + import `zep_<package|tr - _>`. So the
key must equal the directory name. Correct both key and path to
`ms-agent-framework`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts:
#	.github/workflows/test-integrations.yml
@danielchalef danielchalef merged commit fc809bb into main Jun 18, 2026
12 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.

1 participant