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.3.dev1-cp313-cp313-win_amd64.whl (811.2 kB view details)

Uploaded CPython 3.13Windows x86-64

fabricatio_rag-0.1.3.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.3.dev1-cp312-cp312-win_amd64.whl (813.5 kB view details)

Uploaded CPython 3.12Windows x86-64

fabricatio_rag-0.1.3.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.3.dev1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.3.dev1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 841bc05f29bb0b4db1a937881d9eaa7dc53071e5823a563d9ec399ddd3af8722
MD5 8336e42343e015381c10aab60dfa7ae5
BLAKE2b-256 5e5f1f7638373e474a97c4fba4b6a86976e525c59a9e21e4e49bd7332ff75230

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.3.dev1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b118abfd706d271498967e8ea0a870a65ea2b4ec92a9e0322d15658b4b25d04c
MD5 b79569dd6b2afba45bbeb977da39822b
BLAKE2b-256 feaea7a4653849321bca27eddc12e9c9dde805cc4318f78d9ee6c253d68a5280

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.3.dev1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5cab28e89dffb96d4865c5c66fed180aa627af995de0988a4cd57e62003bf89a
MD5 3279a74293f5cc8d279ff11dc8f329a1
BLAKE2b-256 89d3a3940a7211bd0f0013da4524530ca626b7f4f11a75ce2aa1ca691fb36ad2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.3.dev1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 45cc2c14e0580a398ce279cb6f3fc943012da9e2f0dc800526f9200cfa1924ff
MD5 fe3c615a578240fde95965c050f39953
BLAKE2b-256 b11e7aea420bca101a03ca5022b84bff449e3ce9c28456e166f94a5c930b66ee

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