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

Uploaded CPython 3.13Windows x86-64

fabricatio_rag-0.1.1.dev0-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.1.dev0-cp312-cp312-win_amd64.whl (814.9 kB view details)

Uploaded CPython 3.12Windows x86-64

fabricatio_rag-0.1.1.dev0-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.1.dev0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.1.dev0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 90439f74aa5312df41356e26dc62094b84eaa82d97b9f33546eb58a6064772d6
MD5 b9305c057e12d3313bc27bdbf5d4007d
BLAKE2b-256 264b17f3494fadc0ba55eef66c5f4d01d36bce369587a984f76f009d9ce18875

See more details on using hashes here.

File details

Details for the file fabricatio_rag-0.1.1.dev0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.1.dev0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 44149237508a2e57cf7fc6890fbf1471f239c6fa1827e558e9b72c168117819c
MD5 bc7decb97bc8f72ac70d03ba5e7dd91d
BLAKE2b-256 75f01ab6f3f47fa7c2fd542063523fa604bdef61853f16c7176680ee99b33e4e

See more details on using hashes here.

File details

Details for the file fabricatio_rag-0.1.1.dev0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.1.dev0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 edd58a008bb312a5be269b14306b9a7e68f02c52d819310a02dea94d9d833d2e
MD5 e9de2e4df81ec6b1ac184cbb0fcfb193
BLAKE2b-256 423a3a91d9e1e152927ab6f8c8c0f80b76ec59388ba4242c0bf7ca58008890e7

See more details on using hashes here.

File details

Details for the file fabricatio_rag-0.1.1.dev0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.1.dev0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bcf32b674cdc88fa2705f63e903040a0533bb374f6fe014024b754aa14d8acf8
MD5 975b31e53ead28181ed5b7b82c64addf
BLAKE2b-256 a86f05ba23d292f939b97d1809f4bbcee67afee0915da0db25a459973feb022e

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