Skip to main content

Autogen integration for Zep

Project description

Zep AutoGen Integration

A dedicated integration package that enables Zep to work seamlessly with Microsoft AutoGen agents, providing persistent conversation memory and intelligent context retrieval.

Installation

pip install zep-autogen

Quick Start

import asyncio
from zep_cloud.client import AsyncZep
from zep_autogen import ZepMemory
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient

async def main():
    # Initialize Zep client
    zep_client = AsyncZep(api_key="your-zep-api-key")
    
    # Create Zep memory for your agent
    memory = ZepMemory(
        client=zep_client,
        user_id="user_123",
        thread_id="conversation_456"
    )
    
    # Create AutoGen agent with Zep memory
    agent = AssistantAgent(
        name="MemoryAwareAssistant",
        model_client=OpenAIChatCompletionClient(model="gpt-4.1-mini"),
        memory=[memory]  # Add Zep memory to the agent
    )
    
    # Your agent now has persistent memory across conversations!
    response = await agent.run(task="What's my name again?")
    print(response.messages[-1].content)
    
asyncio.run(main())

Features

  • Persistent Memory: Conversations persist across agent sessions
  • Intelligent Retrieval: Zep's memory automatically provides relevant context
  • AutoGen Compatible: Seamlessly integrates with AutoGen's memory interface
  • Async Support: Full async/await support for modern applications
  • Type Safety: Fully typed with comprehensive type hints

Configuration

Environment Variables

# Required: Your Zep Cloud API key
export ZEP_API_KEY="your-zep-api-key"

ZepMemory Parameters

  • client (AsyncZep): Your Zep client instance
  • user_id (str): Unique identifier for the user
  • thread_id (str, optional): Thread/conversation identifier
  • memory_type (str, optional): Type of memory to use (default: "perpetual")
  • max_tokens (int, optional): Maximum tokens to retrieve (default: 4000)

Examples

Basic Usage

See examples/autogen_basic.py for a complete working example.

Multi-Agent with Shared Memory

# Multiple agents can share the same memory context
shared_memory = ZepMemory(
    client=zep_client,
    user_id="team_project",
    thread_id="brainstorm_session"
)

researcher = AssistantAgent(
    name="Researcher",
    model_client=model_client,
    memory=[shared_memory]
)

writer = AssistantAgent(
    name="Writer", 
    model_client=model_client,
    memory=[shared_memory]
)

Requirements

  • Python 3.10+
  • zep-cloud>=2.15.0
  • autogen-agentchat>=0.6.1
  • autogen-core>=0.6.1

License

MIT License - see LICENSE for details.

Support

Contributing

Contributions are welcome! Please see our Contributing Guide for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zep_autogen-0.1.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zep_autogen-0.1.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file zep_autogen-0.1.1.tar.gz.

File metadata

  • Download URL: zep_autogen-0.1.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for zep_autogen-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c41a379e6c97a62685a690e9e147f2d5739e9a1142a8fe801eb7639a2ee49346
MD5 570ed65b326b3f8d2a75ec09586afb81
BLAKE2b-256 959c8ce57bd092dad875b14022daaa32de54733b35aeb13ae34a25c62271bb14

See more details on using hashes here.

Provenance

The following attestation bundles were made for zep_autogen-0.1.1.tar.gz:

Publisher: release-integrations.yml on getzep/zep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zep_autogen-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: zep_autogen-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for zep_autogen-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d8e6f179d5b67e54727e895509cf07c4be97cabbc0958ff03d468978aa8b923
MD5 6d204859f20154e91c316b35ede8e331
BLAKE2b-256 47e4764af283f2ac00ad8a4d9357f9230fb62b1cbba178a0946ceb24b0488a21

See more details on using hashes here.

Provenance

The following attestation bundles were made for zep_autogen-0.1.1-py3-none-any.whl:

Publisher: release-integrations.yml on getzep/zep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page