Implementation:ANative Lab EvoAgentX StorageBaseClasses
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Storage, Abstractions |
| Last Updated | 2026-10-21 00:00 GMT |
Overview
Concrete abstract base classes and schema definitions for database, graph, and vector storage backends.
Description
EvoAgentX defines storage base classes and schemas:
- DBStoreBase (`db_stores/base.py`) — ABC defining interface for insert, delete, update, retrieve operations on metadata tables (memory, agent, workflow, history). Subclasses (SQLite) implement specific database operations.
- GraphStoreType & GraphStoreBase (`graph_stores/base.py`) — `GraphStoreType` enum (NEO4J). `GraphStoreBase` ABC with abstract `get_graph_store` returning LlamaIndex GraphStore.
- VectorStoreType & VectorStoreBase (`vectore_stores/base.py`) — `VectorStoreType` enum (FAISS). `VectorStoreBase` ABC with abstract `get_vector_store`, `aload`, `asave` methods. Wraps LlamaIndex BasePydanticVectorStore.
- TableType & schema models (`schema.py`) — `TableType` enum (agent, workflow, memory, history, indexing). Pydantic models: `MemoryStore` (memory_id, content, keywords, entities, embedding), `AgentStore`, `WorkflowStore`, `HistoryStore`, `IndexStore`. Defines the database schema for persistent storage.
Usage
- Custom DB backends: Subclass `DBStoreBase` to implement new database backends.
- Graph storage: Subclass `GraphStoreBase` for new graph database integrations.
- Vector storage: Subclass `VectorStoreBase` for new vector database integrations.
- Schema reference: Use schema models to understand the database table structure.
Code Reference
Source Location
- Repository: EvoAgentX
- DB Base: evoagentx/storages/db_stores/base.py (L1-74)
- Graph Base: evoagentx/storages/graph_stores/base.py (L1-36)
- Vector Base: evoagentx/storages/vectore_stores/base.py (L1-22)
- Schema: evoagentx/storages/schema.py (L1-68)
Signature
class DBStoreBase(ABC):
@abstractmethod
def insert(self, table: str, data: dict) -> str
@abstractmethod
def retrieve(self, table: str, query: dict) -> List[dict]
class GraphStoreType(enum.Enum): NEO4J
class GraphStoreBase(ABC):
@abstractmethod
def get_graph_store(self, ...): ...
class VectorStoreType(enum.Enum): FAISS
class VectorStoreBase(ABC):
@abstractmethod
def get_vector_store(self, ...): ...
class TableType(enum.Enum): AGENT, WORKFLOW, MEMORY, HISTORY, INDEXING
class MemoryStore(BaseModel):
memory_id: str
content: str
keywords: List[str]
entities: List[str]
embedding: List[float]
Import
from evoagentx.storages.db_stores.base import DBStoreBase
from evoagentx.storages.graph_stores.base import GraphStoreBase, GraphStoreType
from evoagentx.storages.vectore_stores.base import VectorStoreBase, VectorStoreType
from evoagentx.storages.schema import TableType, MemoryStore, AgentStore, WorkflowStore, HistoryStore, IndexStore
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| table | str | Yes | Table name (agent, workflow, memory, etc.) |
| data | dict | Yes (insert) | Data to insert |
| query | dict | Yes (retrieve) │ Query parameters |
Outputs
| Name | Type | Description |
|---|---|---|
| insert returns | str │ Inserted record ID | |
| retrieve returns | List[dict] │ Query results |
Usage Examples
Use Schema Models
from evoagentx.storages.schema import MemoryStore
memory = MemoryStore(
memory_id="mem_001",
content="Agent learned about stocks",
keywords=["stocks", "finance"],
entities=["CATL"],
embedding=[0.1, 0.2, ...],
)
Related Pages
Implements Principle
- Principle:ANative_Lab_EvoAgentX_Storage_Abstraction
- Principle:ANative_Lab_EvoAgentX_Retrieval_Augmented_Generation
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment