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

from ragbits.core.embeddings.litellm import LiteLLMEmbeddings
from ragbits.core.vector_stores.in_memory import InMemoryVectorStore
from ragbits.document_search import DocumentSearch

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

    # Ingest all .txt files from the "biographies" directory
    await document_search.ingest("file://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.9.0.tar.gz (345.8 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.9.0-py3-none-any.whl (47.7 kB view details)

Uploaded Python 3

File details

Details for the file ragbits_document_search-0.9.0.tar.gz.

File metadata

  • Download URL: ragbits_document_search-0.9.0.tar.gz
  • Upload date:
  • Size: 345.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for ragbits_document_search-0.9.0.tar.gz
Algorithm Hash digest
SHA256 5b7fe1743b6466b903bf8859222210d99f46fd344af1935fdf0ef0f6624ae86c
MD5 48e9354224ccfdd531138c4b149faf28
BLAKE2b-256 e420082556274ca33fa63c5441908a858b52518f57d995c1ff47d9e77b81afd7

See more details on using hashes here.

File details

Details for the file ragbits_document_search-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ragbits_document_search-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9322803ac6246d9d412b9b1ff54f335044eaf7010b7ecc6481c7e43505808ba8
MD5 6712119151c622ea47b3cd0fe1502e9e
BLAKE2b-256 b0d2bbc375cd1a08629521e33be46fc122c5f3ca05c4689ff077b221f763f36f

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