-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
base: main
Are you sure you want to change the base?
Adds Redis Memory extension class #6743
Conversation
There was a problem hiding this 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:
- Let's use the module path
autogen_ext.memory.redis
for the new module. - 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. Seepython/README.md
for information on checks. Many users use the API Reference directly. - 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`
f309dd0
to
dabb01c
Compare
@ekzhu thanks for the review, it's really appreciated. |
@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] |
There was a problem hiding this comment.
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.
python/packages/autogen-ext/src/autogen_ext/memory/redis/_redis_memory.py
Outdated
Show resolved
Hide resolved
…k/autogen into feature/add-redis-memory
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