The FastEmbedEmbedder class is used to embed text data into vectors using the FastEmbed.

Usage

cookbook/embedders/qdrant_fastembed.py
from phi.agent import AgentKnowledge
from phi.vectordb.pgvector import PgVector
from phi.embedder.fastembed import FastEmbedEmbedder

embeddings = FastEmbedEmbedder().get_embedding("The quick brown fox jumps over the lazy dog.")

# Print the embeddings and their dimensions
print(f"Embeddings: {embeddings[:5]}")
print(f"Dimensions: {len(embeddings)}")

# Example usage:
knowledge_base = AgentKnowledge(
    vector_db=PgVector(
        db_url="postgresql+psycopg://ai:ai@localhost:5532/ai",
        table_name="qdrant_embeddings",
        embedder=FastEmbedEmbedder(),
    ),
    num_documents=2,
)

Params

ParameterTypeDefaultDescription
dimensionsint-The dimensionality of the generated embeddings
modelstrBAAI/bge-small-en-v1.5The name of the qdrant_fastembed model to use