Repository navigation
Description
Search before asking
- I searched in the issues and found nothing similar.
Description
The Memory documentation has several documentation and code-snippet issues that can mislead users or make examples fail when copied.
-
Long-Term Memory context isolation is described more strongly than the current implementation guarantees.
The docs state that each keyed partition maintains isolated memories and that using the same memory set name across partitions is safe. However, the runtime currently switches the long-term-memory context with
String.valueOf(key.hashCode()), for example inActionTaskContextManagerandPythonActionTask. That means the documented isolation guarantee depends on the hash value rather than the full original key, and hash collisions could share the same Mem0 context.Suggested fix: either change the implementation to use a stable, collision-free key serialization for the LTM context, or soften the documentation to match the actual boundary and limitations.
-
The Java Long-Term Memory complete example does not compile as written.
It uses:
String userQuery = inputEvent.getInput();
but
InputEvent#getInput()returnsObject. The example should useString.valueOf(inputEvent.getInput())or an explicit cast if the input type is known. -
The "Complete Example" section is not actually complete.
The Python example class does not extend
Agentand does not declare the chat model, embedding model, or vector store resources referenced by the configuration. The Java tab only shows an action method, not a complete agent or full resource/config wiring.Suggested fix: either rename the section to "Usage snippet" or make the examples genuinely runnable.
-
The Java usage path for Mem0 Long-Term Memory has a runtime version constraint that is not documented.
The runtime throws when Mem0 is configured together with Java actions and the Flink/Pemja version does not support the required async behavior. The Long-Term Memory page includes Java examples, so it should mention this prerequisite or limitation.
-
The Java MemoryRef example in the Sensory & Short-Term Memory page casts
resolve(ctx)directly to the user payload type.The example currently suggests:
processedData = (ProcessedData) myEvent.getValue().resolve(ctx);
but Java
MemoryRef#resolvereturns aMemoryObject. The example should resolve the object and then read the value, for example:processedData = (ProcessedData) myEvent.getValue().resolve(ctx).getValue();
Are you willing to submit a PR?
- I'm willing to submit a PR!
Activity
[docs] Fix memory examples and clarify long-term memory isolation (#794…