agentscope-ai / agentscope-ai/agentscope

[Feature]: Integrate PowerMem as a Memory Component

未關閉
#1,029 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
31.6k
分支
3.5k
平均合併
1 天 16 小時
30 天內合併 PR
103

描述

**AgentScope is an open-source project. To involve a broader community, we recommend asking your questions in English.**

## Feature Request: Integrate PowerMem as a Memory Component

**Is your feature request related to a problem? Please describe.**

Currently, AgentScope agents rely on in-memory storage (`InMemoryMemory`) for conversation history, which has several limitations:

1. **Limited Scalability**: In-memory storage doesn't scale well for production applications with large volumes of conversations
2. **No Intelligent Memory Management**: There's no automatic fact extraction, deduplication, or memory consolidation from conversations
3. **Basic Retrieval**: Simple vector search without advanced features like graph-based relationships, time-decay weighting, or hybrid retrieval
4. **Limited Multi-Agent Support**: No built-in support for agent-specific memory isolation, cross-agent collaboration, or fine-grained permission control

These limitations make it challenging to build production-ready multi-agent systems that require persistent, intelligent memory management.

**Describe the solution you'd like**

I propose integrating [PowerMem](https://github.com/oceanbase/powermem) as an optional memory component for AgentScope. PowerMem is an intelligent memory system that provides:

### Core Features:

1. **Persistent Memory Storage**
- Support for multiple vector databases (OceanBase, PostgreSQL/pgvector, SQLite)

2. **Intelligent Memory Management**
- **Automatic Fact Extraction**: Uses LLM to extract key facts from conversations, avoiding storing raw conversation history
- **Deduplication & Conflict Resolution**: Automatically detects duplicate memories and merges conflicting information
- **Ebbinghaus Forgetting Curve**: Implements cognitive science-based time-decay weighting, prioritizing recent and relevant memories
- **Importance Evaluation**: Automatically evaluates and prioritizes memories based on relevance

3. **Advanced Retrieval**
- **Hybrid Retrieval**: Combines vector search, full-text search, and graph-based retrieval
- **Knowledge Graph**: Builds and traverses knowledge graphs for multi-hop reasoning
- **Reranking**: Optional reranking for improved retrieval accuracy
- **Sub-stores**: Data partitioning for ultra-large-scale deployments

4. **Multi-Agent Support**
- **Agent Memory Isolation**: Each agent has independent memory spaces
- **Cross-Agent Collaboration**: Supports memory sharing and collaboration between agents
- **Fine-grained Permissions**: Access control with read/write/delete/admin permissions
- **Privacy Protection**: Privacy levels (standard/sensitive/confidential) and scope control
- **Memory Scopes**: Private, agent_group, user_group, public, and restricted scopes

5. **Multimodal Support**
- Automatic conversion of images and audio to text descriptions
- Support for mixed content retrieval (text + image + audio)

6. **Developer-Friendly**
- Simple Python SDK

### Integration Approach:

The integration would provide a `PowerMemMemory` class that implements AgentScope's memory interface, similar to `InMemoryMemory`:

```python
from agentscope.memory import PowerMemMemory
from powermem import auto_config

# Simple usage - auto-loads from .env
memory = PowerMemMemory(config=auto_config(), agent_id="my_agent")

# Or with custom configuration
memory = PowerMemMemory(
config={
"llm": {"provider": "openai", "config": {...}},
"embedder": {"provider": "openai", "config": {...}},
"vector_store": {"provider": "pgvector", "config": {...}},
"intelligent_memory": {"enabled": True}
},
agent_id="my_agent"
)
```

The memory component would automatically:
- Extract and store facts from agent conversations
- Retrieve relevant context when needed
- Manage memory lifecycle (creation, updates, forgetting)
- Support multi-agent scenarios with proper isolation

**Additional context**

### Resources:

- **PowerMem GitHub**: https://github.com/oceanbase/powermem
- **Documentation**: https://github.com/oceanbase/powermem/tree/master/docs
- **PyPI Package**: https://pypi.org/project/powermem/

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。