
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
swarmauri-core
Advanced tools

The Core Library provides the foundational interfaces and abstract base classes necessary for developing scalable and flexible machine learning agents, models, and tools. It is designed to offer a standardized approach to implementing various components of machine learning systems, such as models, parsers, conversations, and vector stores.
class IPredict(ABC):
"""
Interface focusing on the basic properties and settings essential for defining models.
"""
@abstractmethod
def predict(self, *args, **kwargs) -> any:
"""
Generate predictions based on the input data provided to the model.
"""
pass
@abstractmethod
async def apredict(self, *args, **kwargs) -> any:
"""
Generate predictions based on the input data provided to the model.
"""
...
class IAgent(ABC):
@abstractmethod
def exec(self, input_data: Optional[Any], llm_kwargs: Optional[Dict]) -> Any:
"""
Executive method that triggers the agent's action based on the input data.
"""
pass
class ITool(ABC):
@abstractmethod
def call(self, *args, **kwargs):
pass
@abstractmethod
def __call__(self, *args, **kwargs) -> Dict[str, Any]:
pass
class IParser(ABC):
"""
Abstract base class for parsers. It defines a public method to parse input data (str or Message) into documents,
and relies on subclasses to implement the specific parsing logic through protected and private methods.
"""
@abstractmethod
def parse(self, data: Union[str, bytes, FilePath]) -> List[IDocument]:
"""
Public method to parse input data (either a str or a Message) into a list of Document instances.
This method leverages the abstract _parse_data method which must be
implemented by subclasses to define specific parsing logic.
"""
pass
class IVectorStore(ABC):
"""
Interface for a vector store responsible for storing, indexing, and retrieving documents.
"""
@abstractmethod
def add_document(self, document: IDocument) -> None:
"""
Stores a single document in the vector store.
Parameters:
- document (IDocument): The document to store.
"""
pass
@abstractmethod
def add_documents(self, documents: List[IDocument]) -> None:
"""
Stores multiple documents in the vector store.
Parameters:
- documents (List[IDocument]): The list of documents to store.
"""
pass
...
class IDocumentStore(ABC):
"""
Interface for a Document Store responsible for storing, indexing, and retrieving documents.
"""
@abstractmethod
def add_document(self, document: IDocument) -> None:
"""
Stores a single document in the document store.
Parameters:
- document (IDocument): The document to store.
"""
pass
@abstractmethod
def add_documents(self, documents: List[IDocument]) -> None:
"""
Stores multiple documents in the document store.
Parameters:
- documents (List[IDocument]): The list of documents to store.
"""
pass
To start developing with the Core Library, include it as a module in your Python project. Ensure you have Python 3.10 or later installed.
pip install swarmauri_core
# Example of using an abstract model interface from the Core Library
from swarmauri_core.llms.IPredict import IPredict
class MyModel(IPredict):
# Implement the abstract methods here
pass
Contributions are welcome! If you'd like to add a new feature, fix a bug, or improve documentation, kindly go through the contributions guidelines first.
FAQs
This repository includes core interfaces for the Swarmauri framework.
We found that swarmauri-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.