Skip to content

Conversation

@wenjin272
Copy link
Collaborator

@wenjin272 wenjin272 commented Jan 22, 2026

Linked issue: #350 and #351

Purpose of change

Refactor the doc organization for flink-agents memory, and add docs for sensory and long-term memory.

This pr is based on #401 and #402.

Tests

No

API

No

Documentation

  • doc-needed
  • doc-not-needed
  • doc-included

@github-actions github-actions bot added priority/major Default priority of the PR or issue. fixVersion/0.2.0 The feature or bug should be implemented/fixed in the 0.2.0 version. doc-included Your PR already contains the necessary documentation updates. labels Jan 22, 2026
# store collection
memory.set("collection", [1, 2, 3])
# store general class types
memory.set("object", LocalPrompt("the test {content}"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
memory.set("object", LocalPrompt("the test {content}"))
memory.set("object", Prompt.from_text("the test {content}"))

# store general class types
memory.set("object", LocalPrompt("the test {content}"))
# store memory object
memory.new_object("memory_object")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
memory.new_object("memory_object")
obj1: MemoryObject = memory.new_object("obj1")
obj1.set("foo", "bar")

value1: int = memory.get("primitive")
value2: List[int] = memory.get("collection")
value3: Prompt = memory.get("object")
value4: MemoryObject = memory.get("memory_object")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
value4: MemoryObject = memory.get("memory_object")
value4: MemoryObject = memory.get("obj1")
value5: str = value4.get("foo")

// store general class types
memory.set("object", new LocalPrompt("the test {content}"));
// store memory object
memory.newObject("memory_object", true); // The second argument means whether to overwrite existing field if it's not a nested object
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should add an overload method that does not require the second argument and use false for default (aligned with python), and use that for the example.

// store general class types
memory.set("object", new LocalPrompt("the test {content}"));
// store memory object
memory.newObject("memory_object", true); // The second argument means whether to overwrite existing field if it's not a nested object
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
memory.newObject("memory_object", true); // The second argument means whether to overwrite existing field if it's not a nested object
MemoryObject obj1 = memory.newObject("obj1", true); // The second argument means whether to overwrite existing field if it's not a nested object
obj1.set("foo", "bar");

Comment on lines +133 to +134
* Use `new_object` to manually create nested field.
* Use dot-separated path as key to created nested field.
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem right. "Always using new_object for creating memory objects" is something we need to emphasis, but it's not a way of accessing the fields.

Comment on lines +133 to +134
* Use `new_object` to manually create nested field.
* Use dot-separated path as key to created nested field.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Use `new_object` to manually create nested field.
* Use dot-separated path as key to created nested field.
* Use `new_object` to manually create nested field.
* Use dot-separated path as key to access nested field.


{{< tab "Python" >}}
```python
# Use new_object
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Use new_object
# access fields from the innermost memory object with field names

name: str = user.get("name")
age: int = user.get("age")

# Use dot-separated path
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Use dot-separated path
# access fields from an outer memory object with paths to the fields


### Memory Reference

`MemoryRef` is a reference of the objects stored in memory. The `set` method memory object will return a `MemoryRef`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`MemoryRef` is a reference of the objects stored in memory. The `set` method memory object will return a `MemoryRef`.
`MemoryRef` is a reference of the objects stored in memory. The `set` method of memory object will return a `MemoryRef`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-included Your PR already contains the necessary documentation updates. fixVersion/0.2.0 The feature or bug should be implemented/fixed in the 0.2.0 version. priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants