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-1.0.0.tar.gz (10.0 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-1.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for zep_autogen-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ae8e5f03685a66663fa44b909a13e28cdffc0526fc08c9073785f4a7ba66cb6a
MD5 1effcfc7c6fe0b5a6b02bb2521b2278d
BLAKE2b-256 ca44bbd8e7043dca527903273aa4e05ab80f071810383e7e50ce1b1ee850c072

See more details on using hashes here.

Provenance

The following attestation bundles were made for zep_autogen-1.0.0.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-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: zep_autogen-1.0.0-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-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33a3b0d8dd8ca2af0e9ebe18b79821e767cf0d13d65e9d06e96836edce2e2671
MD5 5a1e4bbb24821f054697615fab718c27
BLAKE2b-256 9186d09466e8d47b21e9f3633f574c5263b93a12a931e055aeab66108ac73e67

See more details on using hashes here.

Provenance

The following attestation bundles were made for zep_autogen-1.0.0-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