Skip to main content

A Python library for Retrieval-Augmented Generation (RAG) capabilities in LLM applications.

Project description

fabricatio-rag

A Python library for Retrieval-Augmented Generation (RAG) capabilities in LLM applications.

📦 Installation

This package is part of the fabricatio monorepo and can be installed as an optional dependency:

pip install fabricatio[rag]

Or install all components:

pip install fabricatio[full]

🔍 Overview

Provides tools for:

  • Document embedding and vector storage using Milvus
  • Semantic search and context retrieval
  • Integration with TEI (Text Embeddings Inference) services
  • Database injection workflows
  • Asynchronous RAG execution patterns

Built on top of Fabricatio's agent framework with support for asynchronous execution and Rust extensions.

🧩 Usage Example

from fabricatio_rag.capabilities.rag import RAG
from fabricatio_rag.models.rag import MilvusDataBase


async def search_knowledge():
    # Initialize database connection
    db = MilvusDataBase(collection_name="science_papers")

    # Initialize RAG capability
    rag = RAG(db)

    # Search for relevant information
    results = await rag.retrieve("climate change impact on coral reefs", limit=3)

    print("Top 3 relevant documents:")
    for result in results:
        print(f"- {result['title']}")
        print(f"  Relevance: {result['score']:.2f}")
        print(f"  Snippet: {result['text'][:150]}...")

📁 Structure

fabricatio-rag/
├── actions/          - Data injection workflows
├── capabilities/     - Core RAG functionality
├── models/           - Database and query models
├── proto/            - TEI service definitions
└── rust.pyi          - Rust extension interfaces

🔗 Dependencies

Core dependencies:

  • pymilvus>=2.5.4 - Vector database integration
  • fabricatio-core - Core interfaces and utilities

Rust extensions:

  • TEI client bindings
  • Protobuf definitions for gRPC communication

📄 License

MIT – see LICENSE

GitHub: github.com/Whth/fabricatio

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

fabricatio_rag-0.1.2.dev1-cp313-cp313-win_amd64.whl (813.9 kB view details)

Uploaded CPython 3.13Windows x86-64

fabricatio_rag-0.1.2.dev1-cp313-cp313-manylinux_2_34_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

fabricatio_rag-0.1.2.dev1-cp312-cp312-win_amd64.whl (814.7 kB view details)

Uploaded CPython 3.12Windows x86-64

fabricatio_rag-0.1.2.dev1-cp312-cp312-manylinux_2_34_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file fabricatio_rag-0.1.2.dev1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.2.dev1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 bf3c1e42ae0cf1a64a3fa371209c3053e73c8e8b91fe065a8622a012b07f00e1
MD5 a62b14099827d5aec22d681fe0d4ab35
BLAKE2b-256 422c90b5a435c67796b1dada20042bb2515a722767eb43282de28b341d15ffae

See more details on using hashes here.

File details

Details for the file fabricatio_rag-0.1.2.dev1-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.2.dev1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b695e314ea69c75956658fe294800223e713a4fed79b65ac1b8e504b145a8268
MD5 fdc40ac0bccc1e5fd6ee829d3e110315
BLAKE2b-256 b3df9fbbfecd3b044bdd28d14c27413258aa6e89ecfc58ceec80604ad6bc370b

See more details on using hashes here.

File details

Details for the file fabricatio_rag-0.1.2.dev1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.2.dev1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6f15d7305a42113cfa901af19bcb2e6c235cbdf95e737946eef0a6f9761f22c1
MD5 3fc23157b8410dacfc9bd3172b2a7390
BLAKE2b-256 a47f63caba6a105b099f04649927c9755928327c1009b77a359ff6d9f918b6eb

See more details on using hashes here.

File details

Details for the file fabricatio_rag-0.1.2.dev1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.2.dev1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 939449cbfdfa0b641b34d36bd6bdee52f861fb5b3c7ba46fbb570434c89d5cf1
MD5 8f948f3cd7eb07472efa29b4e72a79e7
BLAKE2b-256 690f76595af43140b5e416c06e063fd453612c3ff7f6d7427d927ddbaf5acb06

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