Skip to content

Conversation

@abrookins
Copy link
Contributor

@abrookins abrookins commented Mar 1, 2025

Adds a recipe showing:

  1. Short-term memory management using LangGraph's checkpointer
  2. Long-term memory storage and retrieval using RedisVL
  3. Manually storing and retrieving long-term memory vs. exposing tool access (AKA function-calling)
  4. Managing conversation history with summarization
  5. Consolidating similar memories in a background thread

@abrookins abrookins changed the title WIP on memory agent recipe Agent Memory Recipe Mar 20, 2025
@abrookins abrookins marked this pull request as ready for review March 20, 2025 05:35
@tylerhutcherson tylerhutcherson self-requested a review March 20, 2025 14:47
Copy link
Collaborator

@tylerhutcherson tylerhutcherson left a comment

Choose a reason for hiding this comment

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

Huge effort!

" }\n",
"\n",
" try:\n",
" long_term_memory_index.load([memory_data])\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you want redisvl to own the creation of the redis key? or do you want the object the be in charge of that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't have a strong preference generally, but I ran into some confusing behavior queries. Filter queries returned the ID of a document, while vector queries returned the full key as the 'id,' if I recall. Behavior can be more predictable if the application owns keys, but at RedisVL's level of abstraction, having it own the keys makes sense. I tried to let RedisVL handle the keys, I think...

"\n",
" if memory_type:\n",
" if isinstance(memory_type, list):\n",
" base_filters.append(f\"@memory_type:{{{'|'.join(memory_type)}}}\")\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI with Tag fields you can do == to an Iterable and it will join them ala string with the chosen separator (in the schema)

Tag('memory_type') == [...] for example

definitely interested in expanding the filter notation in redisvl eventually ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting, I'll have to explore that a bit more. It seems like I may want to use an OR query sometimes and an AND other times. 🤔 I'll look at Tag syntax closer.

@abrookins abrookins merged commit 3a0e211 into main Mar 22, 2025
2 checks passed
@tylerhutcherson tylerhutcherson deleted the feat/RAAE-537-memory-agent-recipe branch March 24, 2025 12:46
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.

3 participants