Skip to main content

Document Search module for Ragbits

Project description

Ragbits Document Search

Ragbits Document Search is a Python package that provides tools for building RAG applications. It helps ingest, index, and search documents to retrieve relevant information for your prompts.

Installation

You can install the latest version of Ragbits Document Search using pip:

pip install ragbits-document-search

Quickstart

import asyncio

from ragbits.core.embeddings import LiteLLMEmbedder
from ragbits.core.vector_stores.in_memory import InMemoryVectorStore
from ragbits.document_search import DocumentSearch

async def main() -> None:
    """
    Run the example.
    """
    embedder = LiteLLMEmbedder(
        model_name="text-embedding-3-small",
    )
    vector_store = InMemoryVectorStore(embedder=embedder)
    document_search = DocumentSearch(
        vector_store=vector_store,
    )

    # Ingest all .txt files from the "biographies" directory
    await document_search.ingest("local://biographies/*.txt")

    # Search the documents for the query
    results = await document_search.search("When was Marie Curie-Sklodowska born?")
    print(results)


if __name__ == "__main__":
    asyncio.run(main())

Documentation

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

ragbits_document_search-0.0.30rc1.tar.gz (721.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ragbits_document_search-0.0.30rc1-py3-none-any.whl (49.1 kB view details)

Uploaded Python 3

File details

Details for the file ragbits_document_search-0.0.30rc1.tar.gz.

File metadata

File hashes

Hashes for ragbits_document_search-0.0.30rc1.tar.gz
Algorithm Hash digest
SHA256 a3861d0b7054e3ad6a26ade78a1c54ca3ed2636f57294de428e48ca99a167dfb
MD5 b0c9fa5f267db08f0d413d5d0528ac86
BLAKE2b-256 883b2501471c8882aa72d512fb6c155f2489576f65dffb59f125360c3d798531

See more details on using hashes here.

File details

Details for the file ragbits_document_search-0.0.30rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for ragbits_document_search-0.0.30rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 52b66270fff9499cc4fa11ad5d0227d3117b0ba8c29f0a8dcede5b56baa46712
MD5 b6a4dba5b38f70e42a8e05c4af1cea54
BLAKE2b-256 59b87b54b5b599ff1c06a00ef3abe9ae8e49bc6d1ba37f2a781238e43a63d53a

See more details on using hashes here.

Supported by

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