Skip to content

Python: Add Zep context provider for Agent Framework#2080

Closed
danielchalef wants to merge 1 commit intomicrosoft:mainfrom
danielchalef:zep-memory-provider
Closed

Python: Add Zep context provider for Agent Framework#2080
danielchalef wants to merge 1 commit intomicrosoft:mainfrom
danielchalef:zep-memory-provider

Conversation

@danielchalef
Copy link

Summary

Implement ZepProvider as a ContextProvider for persistent long-term memory using Zep's knowledge graph capabilities. The provider automatically creates Zep threads associated with configured user_id, retrieves context before LLM invocation, and persists messages after.

Key Features

  • Automatic thread creation and user association in Zep
  • Two-call pattern: retrieve context before invoke, persist messages after
  • Support for static thread ID (shared memory) and dynamic thread ID (isolated memory) modes
  • Comprehensive test coverage (33 tests, 98% code coverage)

Test Plan

  • Run uv run pytest packages/zep/tests/ to verify all 33 tests pass
  • Run uv run pyright packages/zep/ to verify type checking
  • Verify code examples in README execute without errors

🤖 Generated with Claude Code

Implement ZepProvider as a ContextProvider for persistent long-term memory using Zep's knowledge graph capabilities. Automatically creates Zep threads associated with configured user_id, retrieves context before LLM invocation, and persists messages after. Supports both static and dynamic thread scoping modes.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python labels Nov 11, 2025
"""
should_close_client = False
if zep_client is None:
api_key = api_key or os.getenv("ZEP_API_KEY")
Copy link
Member

Choose a reason for hiding this comment

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

please create a settings class for this, PydanticSettings takes care of things like loading .env's etc. which makes it a lot easier.

print(f"Agent: {result}\n")

print("\n✓ Zep successfully remembered user preferences across threads!")

Copy link
Member

Choose a reason for hiding this comment

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

please add a sample of the output here as a multi-line string (triple quoted) so people just reading this sample understand what happened

@markwallace-microsoft
Copy link
Member

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL13067192185% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
1780 107 💤 0 ❌ 0 🔥 36.505s ⏱️

@moonbox3
Copy link
Contributor

Hi @danielchalef are you still interested in seeing this PR through?

@eavanvalkenburg
Copy link
Member

Closing, no response since december.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants