camel
camel copied to clipboard
Memory chat
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()
- Adds an option to load agent specific memories from all subclasses of BaseKeyValueStorage and all subclasses of BaseVectorStorage
- Fixes #1708
- Fixes some features requested in #1588
Checklist
Go over all the following points, and put an x in all the boxes that apply.
- [x] I have read the CONTRIBUTION guide (required)
- [x] I have linked this PR to an issue using the Development section on the right sidebar or by adding
Fixes #issue-numberin the PR description (required) - [x] I have checked if any dependencies need to be added or updated in
pyproject.tomlandpoetry.lock - [x] 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!
Can you also add some examples as well?
Can you also add some examples as well?
Added under camel/examples/memories/agent_memory_test.py