-
Notifications
You must be signed in to change notification settings - Fork 244
feat(redis): add redis memory backend and redis memory example #376 #377
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: develop
Are you sure you want to change the base?
Conversation
…#376 Signed-off-by: Brian Caffey <[email protected]>
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.
Great PR! Just a couple of changes needed. I'll enable CI and we can merge once CI is passing and all comments are resolved.
Thank you!
logger.info("Computing embedding for memory text") | ||
search_vector = self._embedder.embed_query(memory_text) | ||
logger.info(f"Generated embedding vector of length: {len(search_vector)}") | ||
memory_data["embedding"] = search_vector | ||
|
||
try: | ||
# Store as JSON in Redis | ||
logger.info(f"Attempting to store memory data in Redis for key: {memory_key}") | ||
await self._client.json().set(memory_key, "$", memory_data) | ||
logger.info(f"Successfully stored memory data for key: {memory_key}") |
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.
This is a large number of logging statements to be printed each time at the INFO level. Can we change these to logger.debug()
?
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.
This should be applied consistently throughout the entire file
|
||
self._client = redis_client | ||
self._key_prefix = key_prefix | ||
self._embedder = embedder |
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.
Check for None
values for redis_client
and embedder
. The checks later on in the file for if self._embedder:
can then be removed.
@@ -38,6 +38,7 @@ llms: | |||
nim_llm: | |||
_type: nim | |||
model_name: meta/llama-3.3-70b-instruct | |||
# base_url: http://192.168.5.173:8000/v1 |
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.
Was this intentional? Can it be removed?
/ok to test 7ead134 |
Description
Closes #376
By Submitting this PR I confirm: