Skip to main content

Fast embedding alternative to Sentence transformers

Project description

FastEmbed Library

FastEmbed is a Python library that provides convenient methods for indexing and searching text documents using Qdrant, a high-dimensional vector indexing and search system.

Features

  • Batch document insertion with automatic embedding using SentenceTransformers. With support for OpenAI and custom embeddings.
  • Efficient batch searching with support for filtering by metadata.
  • Automatic generation of unique IDs for documents.
  • Convenient alias methods for adding documents and performing queries.

Installation

To install the FastEmbed library, we install Qdrant client as well with pip:

pip install fastembed qdrant-client

Usage

Here's a simple usage example, which works as is:

from qdrant_client import QdrantClient

# Initialize the client
client = QdrantClient(":memory:")  # or QdrantClient(path="path/to/db")

# Prepare your documents, metadata, and IDs
docs = ["Qdrant has Langchain integrations", "Qdrant also has Llama Index integrations"]
metadatas = [
    {"source": "Langchain-docs"},
    {"source": "Linkedin-docs"},
]
ids = [42, 2]

# Use the new add method
client.add(collection_name="demo_collection", docs={"documents": docs, "metadatas": metadatas, "ids": ids})

search_result = client.query(collection_name="demo_collection", query_texts=["This is a query document"])
print(search_result)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastembed-0.0.1a3.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

fastembed-0.0.1a3-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file fastembed-0.0.1a3.tar.gz.

File metadata

  • Download URL: fastembed-0.0.1a3.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0

File hashes

Hashes for fastembed-0.0.1a3.tar.gz
Algorithm Hash digest
SHA256 0b48d7783424617fd1a4b02cada0da0b5dcf0167e93b47effcad74fed07b5932
MD5 9eeb9c2765ca2d93810f32a09a80d573
BLAKE2b-256 c6944cc9a72b7bd8e3c7d96681a260eb89aaaf455ec85dcb11b8703cf29320a4

See more details on using hashes here.

File details

Details for the file fastembed-0.0.1a3-py3-none-any.whl.

File metadata

  • Download URL: fastembed-0.0.1a3-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0

File hashes

Hashes for fastembed-0.0.1a3-py3-none-any.whl
Algorithm Hash digest
SHA256 6a5f871c3986e273ab55892c1b1342477a741732af9059e0543555963f3ded6a
MD5 9a6e19984e23082ddbf56530e35de13c
BLAKE2b-256 15e495f6dafd52ee78717acfbedf225140bfe48f875c23a8943534ae40c761b0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page