Skip to content

Adds Redis Memory extension class #6743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

justin-cechmanek
Copy link

Why are these changes needed?

This PR adds the RedisMemory class to allow for developers to use Redis vector search for agent memory. Redis vector db offers a persistent store and the ability to semantically search for relevant memories.

Related issue number

None

Checks

Copy link
Collaborator

@ekzhu ekzhu left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. A couple of things:

  1. Let's use the module path autogen_ext.memory.redis for the new module.
  2. Add API doc to RedisMemory with examples of usage. Make sure the code blocks are checked by pyright, the CI checks the formatting and types of API docs. See python/README.md for information on checks. Many users use the API Reference directly.
  3. In the usage guide notebook, can you simplify the setup instructions for the redis example. The example should just refer to the API doc using reference:
{py:class}`~autogen_ext.memory.redisvl.RedisMemory`

@justin-cechmanek justin-cechmanek force-pushed the feature/add-redis-memory branch from f309dd0 to dabb01c Compare July 9, 2025 23:12
@justin-cechmanek
Copy link
Author

@ekzhu thanks for the review, it's really appreciated.
Are there any other things you would like me to address?

@justin-cechmanek justin-cechmanek requested a review from ekzhu July 11, 2025 22:02
@justin-cechmanek
Copy link
Author

@microsoft-github-policy-service agree company="Redis"

# Skip tests if Redis instance is not avalable locally
try:
# Attempt to connect to Redis by initializing and pinging
client = Redis.from_url("redis://localhost:6379") # type: ignore[reportUnkownMemberType]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we have two sets of tests: one uses mock and the other uses actual redis server. Skipping the second set of tests if the redis server is not available. See example for using Redis mock in https://github.com/microsoft/autogen/blob/main/python/packages/autogen-ext/tests/cache_store/test_redis_store.py

For GitHub CI tests, add a separate workflow file for Redis memory following the example: https://github.com/microsoft/autogen/blob/main/.github/workflows/pytest-mem0.yml.

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.

2 participants