Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:ANative Lab EvoAgentX StorageBaseClasses

From Leeroopedia
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

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

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment