magnet.ize package

Submodules

magnet.ize.filings module

magnet.ize.memory module

class magnet.ize.memory.Memory(magnet: Magnet = None)[source]

Bases: object

The Embedder class is responsible for embedding text using a pre-trained sentence transformer model and storing or sending the embeddings for further processing. It utilizes the Milvus database for storing and searching the embeddings.

Args:

config (Config): A Config instance containing the configuration parameters for the Embedder class. create (bool, optional): If set to True, a connection to the Milvus database will be created. Defaults to False.

Attributes:

config (Config): A Config instance containing the configuration parameters for the Embedder class. model (SentenceTransformer): An instance of the SentenceTransformer class from the sentence_transformers library, used for text embedding. db (MilvusDB): An instance of the MilvusDB class from the magnet.utils.milvus module, used for connecting to the Milvus database.

async delete(name: str = None)[source]
async disconnect()[source]
async index(payload, msg, field=None, v=False, instruction='Represent this information for searching relevant passages: ')[source]
async info()[source]
is_dupe(q: str = None)[source]
async on(create: bool = False, initialize: bool = False)[source]
search(payload, limit: int = 100, cb: callable | None = None, instruction: str = 'Represent this information for searching relevant passages: ')[source]