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.4.dev4-cp313-cp313-win_amd64.whl (813.8 kB view details)

Uploaded CPython 3.13Windows x86-64

fabricatio_rag-0.1.4.dev4-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.4.dev4-cp312-cp312-win_amd64.whl (814.4 kB view details)

Uploaded CPython 3.12Windows x86-64

fabricatio_rag-0.1.4.dev4-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.4.dev4-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.4.dev4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8243fe38429205d3f72817ec70f6721c9652fedbc574ad1eec3d5c655beafe13
MD5 f87cea1679c33bde7296e1f3449ab4b2
BLAKE2b-256 0ec0247308c4ddfb655665f9083a9047ffc87cf274e65c41a4fbbd153ba56172

See more details on using hashes here.

File details

Details for the file fabricatio_rag-0.1.4.dev4-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.4.dev4-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9120988999401857da1b9cae55c1242542b917927d80054df0bc29e860c547d8
MD5 10322ed0da0582f9ec6cc6851e47360a
BLAKE2b-256 3792c1c96b3751bdfa59cb475000028867b34c5da33c0a5e9c678ac805baa3c8

See more details on using hashes here.

File details

Details for the file fabricatio_rag-0.1.4.dev4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.4.dev4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6bdd1326acc6a0886f95bc1f6ae5ce5777e1d1d23decdc3d15afee1f0119d254
MD5 1b1a9d0e71f752dc05770b8ed5640e1b
BLAKE2b-256 09a4e803580ad79cde087ff01302196cce1e66faaa9c7ceb702a499f95c8c1c6

See more details on using hashes here.

File details

Details for the file fabricatio_rag-0.1.4.dev4-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.4.dev4-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6da6cbcd1d03bf379546672a33c6774b293af1f28286ab75536423c476b49ce2
MD5 dfbd29d42e65a62b3329225e31e25fd4
BLAKE2b-256 80b2f469ffed365751a6e659667e1a371def1fe368cd6c5c67f2f3747d227999

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