Skip to content
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

Memory chat #1726

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Memory chat #1726

wants to merge 15 commits into from

Conversation

X-TRON404
Copy link
Collaborator

Description

  • Adds an agent_id to every memory record.
  • Updates ChatHistoryBlock to retrieve only the memories associated with the specified agent.
  • Creates this interface for ChatAgent to save, load and clear memories:
agent = ChatAgent(`system_message`="you are a helpful assistant", agent_id="001") # The agent is could be generated randomly is not specified.
agent.save_memory(path: str) -> save `AgentMemory` with `agent_id` presisitently
agent.load_memory(memory: AgentMemory)
agent.load_memory_from_path(path: str)
agent.clear_memory()

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and poetry.lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • I have updated the documentation if needed:
  • I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!

- Each ChatAgent gets a unique agent_id
- This agent_id is associated with each memory record
- This allows the ChatAgent to save and retrieve agent specific memories
- Also added memory persistence that allows the ChatAgent to directly save the memories to a .json file.
@lightaime
Copy link
Member

Can you also add some examples as well?

@X-TRON404
Copy link
Collaborator Author

Can you also add some examples as well?

Added under camel/examples/memories/agent_memory_test.py

- passed the agent_id in the memory record for the test_chat_agent_messages_window() test
@X-TRON404 X-TRON404 requested review from lightaime March 6, 2025 15:29
@X-TRON404 X-TRON404 requested a review from Wendong-Fan March 8, 2025 05:23
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.

Agent ID associated with memories for better tracking and organization.
2 participants