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.0.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.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zep_autogen-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 67fcf291c6b93942e62bb4ebf55cd433764fcc88fae6064cb8cdc6f9e8f037dd
MD5 1c69b5983379e648518c5df6ae3adebd
BLAKE2b-256 9d9d9ec3ec70700fca8723961f9a2fba69fcbbe341bd1940f6a720294c471ce7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: zep_autogen-0.1.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-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62becc073318e66d663402cec1a492894570f7e615658184b6ba1a9e38dd6148
MD5 2561728d2bd5c55282d8d7d77e0b0a26
BLAKE2b-256 42d2abcf26579d9aa99dca916ac621b5d12e4c016ac74a3269298bd07f055e81

See more details on using hashes here.

Provenance

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