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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.12Windows x86-64

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ac92b26e37bd6a4172498d8a7f149e49beb3ddd83fce305fc38d165ff25d0f42
MD5 a438771a7f696b13ff770ad85dd31e7f
BLAKE2b-256 8461b83227e8f377cb2e179eefb7235c2b3a1dc748dc84a96c1096a515ed2790

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.3-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 054791296462acd1d4305af56a245c014a0283dbcce1df573e1e8f7f4eb024a0
MD5 e893eb9f6dfabc68d0db82ee617784fc
BLAKE2b-256 2a0625f3f745ed66d33ef89bc971ce54c2b1625a8046a0d48d1286425dadad9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d6dc82bd5480587024d90b2e3b36ef62fa672fa0d8c2f44d79a92536e960342b
MD5 8dc898147c448d52dae95c5da5f9ef10
BLAKE2b-256 0e354683a6369121fe332bc76c5e60c6785b07a2e6730de6b5fdd3b5ea044634

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.3-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6729d2be23d4abae9059385d9e4eb7d33b5303bc3fd634b0d1686d54b0cb2c18
MD5 f9fede0c2805060a472aaec56bed8b9f
BLAKE2b-256 4e0209c14a865e586790ddc8069fba6b4ca46a7afc84b915fee916798f03f4c5

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