agentscope-ai / agentscope-ai/agentscope
[Feature]: Integrate SeekDB as a Database Component
- Linguagem predominante
- Python
- Estrelas
- 31.5k
- Forks
- 3.5k
- Merge médio
- 1d 23h
- PRs com merge (30d)
- 95
Descrição
**AgentScope is an open-source project. To involve a broader community, we recommend asking your questions in English.**
## Feature Request: Integrate SeekDB as a Database Component
**Is your feature request related to a problem? Please describe.**
AgentScope currently lacks a unified database solution that can efficiently handle the diverse data requirements of AI agent applications.
**Describe the solution you'd like**
I propose integrating [SeekDB](https://github.com/oceanbase/seekdb) as an optional database component for AgentScope. SeekDB is an AI-native, open-source database that unifies vector, text, structured, and semi-structured data within a single engine.
### Key Features:
1. **Hybrid Search**
- Combines vector-based semantic retrieval, full-text keyword search, and scalar filtering in a single query
- Supports query reranking with multiple strategies (weighted scores, reciprocal rank fusion, LLM-based reranking)
2. **Unified Data Model**
- Handles relational data with standard SQL
- Vector search with multiple distance metrics (cosine, Euclidean, inner product)
- Full-text search with BM25 ranking
- JSON and GIS data support
3. **In-Database AI Functions**
- `AI_EMBED`: Convert text to embeddings directly in SQL
- `AI_COMPLETE`: Generate text using chat/completion models
- `AI_RERANK`: Rerank search results
4. **Lightweight Deployment**
- Embedded mode for local development
- Client/server mode for production
- Minimal resource requirements (1 CPU core, 1GB memory)
- MySQL protocol compatible
### Integration Approach:
The integration would provide a `SeekDBStorage` class that can be used as a storage backend for AgentScope:
```python
from agentscope.storage import SeekDBStorage
# Simple usage
storage = SeekDBStorage(
connection_string="mysql://127.0.0.1:2881/seekdb",
enable_ai_functions=True
)
# Use for vector storage
storage.add_vectors(embeddings, metadata)
# Hybrid search
results = storage.hybrid_search(
vector_query=query_embedding,
text_query="keyword search",
filters={"category": "document"}
)
```
**Describe alternatives you've considered**
1. **Multiple Database Services**: Using separate vector DB, text search, and relational DB services would work but increases architectural complexity and operational overhead.
2. **Existing Vector Databases**: While specialized vector databases (e.g., Pinecone, Weaviate) exist, they don't provide the unified hybrid search and in-database AI capabilities that SeekDB offers.
3. **Building Custom Integration**: This would require significant development effort and wouldn't leverage SeekDB's proven, production-ready features.
**Additional context**
### Why SeekDB is a Good Fit:
1. **AI-Native Design**: Built specifically for AI applications with in-database AI functions
2. **Open Source**: Apache 2.0 license, actively maintained by OceanBase
3. **Unified Solution**: Single database for all data types, reducing architecture complexity
4. **MySQL Compatible**: Easy integration with existing tools and ecosystems
5. **Lightweight**: Can run embedded or as a server, suitable for various deployment scenarios
### Resources:
- **SeekDB GitHub**: https://github.com/oceanbase/seekdb
- **Documentation**: Available on GitHub repository
- **License**: Apache 2.0
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.