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

Uploaded CPython 3.13Windows x86-64

fabricatio_rag-0.1.1.dev2-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.dev2-cp312-cp312-win_amd64.whl (814.6 kB view details)

Uploaded CPython 3.12Windows x86-64

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.1.dev2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 af06c055928e2dee41235b8374ab3d3522c8a766b075623e15f82dfa5c6fbb94
MD5 a90eb600e4ad80a45259f8ead1317b9d
BLAKE2b-256 834e0aea3144459dba649568d2f24ea2d96b94685e75d3162ed2b1c118de287c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.1.dev2-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c46d6009b20aa36c9c237163eb99b2af20ea416a51bb6006c44e03b126809f09
MD5 e6a9d972e219558ff165c1c81f37219d
BLAKE2b-256 2eb1e04f2411390fe084a6211d566defe78d6f145382e4de83b3c110886b60ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.1.dev2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9af7fe2879154d4e27ed39b0e77cfc18055a76414cac7b74810cbdc3708ddac9
MD5 6e016701cf17fe6e8b625c6eac63d22d
BLAKE2b-256 4637a9c64b01040b5ac5745cc07f953167e71f233d6e07f7c82b37499461d842

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.1.dev2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b80d64a14fcfd94e7b322582db69b821524dee81d87a8832532c9311a2545f8f
MD5 4159089b706346bc1978434c379a8484
BLAKE2b-256 10e4432909132b3d0fa92f115217a21684a8da75d6fb79ca4ad8659ebf21d357

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