Ragbits docs#
🐰 ragbits
Building blocks for rapid development of GenAI applications.
Features#
🔨 Build Reliable & Scalable GenAI Apps#
- Swap LLMs anytime – Switch between 100+ LLMs via LiteLLM or run local models).
- Type-safe LLM calls – Use Python generics to enforce strict type safety in model interactions.
- Bring your own vector store – Connect to Qdrant, PgVector, and more with built-in support.
- Developer tools included – Manage vector stores, query pipelines, and test prompts from your terminal.
- Modular installation – Install only what you need, reducing dependencies and improving performance.
📚 Fast & Flexible RAG Processing#
- Ingest 20+ formats – Process PDFs, HTML, spreadsheets, presentations, and more. Process data using unstructured or create a custom provider.
- Handle complex data – Extract tables, images, and structured content with built-in VLMs support.
- Connect to any data source – Use prebuilt connectors for S3, GCS, Azure, or implement your own.
- Scale ingestion – Process large datasets quickly with Ray-based parallel processing.
🚀 Deploy & Monitor with Confidence#
- Real-time observability – Track performance with OpenTelemetry and CLI insights.
- Built-in testing – Validate prompts with promptfoo before deployment.
- Auto-optimization – Continuously evaluate and refine model performance.
- Visual testing UI (Coming Soon) – Test and optimize applications with a visual interface.
Installation#
You can install the latest version of Ragbits using pip:
Additionally, you can install one of the extensions to Ragbits:
ragbits[document-search]
- provides tools for building document search applications.
Quickstart#
To build the simplest documents search, you can use the following code snippet:
import asyncio
from ragbits.core.embeddings import LiteLLMEmbedder
from ragbits.core.vector_stores import InMemoryVectorStore
from ragbits.document_search import DocumentSearch
from ragbits.document_search.documents.document import DocumentMeta
documents = [
DocumentMeta.create_text_document_from_literal("RIP boiled water. You will be mist."),
DocumentMeta.create_text_document_from_literal(
"Why doesn't James Bond fart in bed? Because it would blow his cover."
),
DocumentMeta.create_text_document_from_literal(
"Why programmers don't like to swim? Because they're scared of the floating points."
),
]
async def main():
document_search = DocumentSearch(vector_store=InMemoryVectorStore(embedder=LiteLLMEmbedder()))
await document_search.ingest(documents)
return await document_search.search("I'm boiling my water and I need a joke")
if __name__ == "__main__":
print(asyncio.run(main()))
How Ragbits documentation is organized#
- Quickstart - Get started with Ragbits in a few minutes
- How-to guides - Learn how to use Ragbits in your projects
- CLI - Learn how to manage Ragbits from the command line
- API reference - Explore the underlying API of Ragbits