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

Uploaded CPython 3.13Windows x86-64

fabricatio_rag-0.1.2-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.2-cp312-cp312-win_amd64.whl (815.2 kB view details)

Uploaded CPython 3.12Windows x86-64

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a56509786e3ec19cc57d41dceaaf2dd33f4223cead3d9d54458480022c30a795
MD5 2c8dd63792cca2e66539815d856e3afb
BLAKE2b-256 f996da3422bb60cc973fd363f29bb7a94d9b8a2bcf1340a67ff73e895941d9eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.2-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 cf283571ae493975d0b8d67cf34d976ba2af978d3dd939d21917e89ad491ccb6
MD5 b58857c929603a0d86a81f2e7f4a86d5
BLAKE2b-256 fc6b51fe248ab4af7b4250d7e828bb291c254f098549eea73de8e89251f0c7d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 878f589680a8dac426f567f5e185f3179fee32be922dc4af287fcf2be353319b
MD5 a011c3c9b102230b3b857d8f4e5ccf43
BLAKE2b-256 63a64db659b7d5af974029ab1848c4f2e2e1935402a6b269b1ec260d7e392251

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabricatio_rag-0.1.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 712a19920c2668c16ad29ff2dfe771e389d0e89b3612b5749afdc1c73b058b46
MD5 7872d2bb5eaf44f6c8b65f020014ad0e
BLAKE2b-256 701220313a6630005241436cb1199922710eb00fda27c2e7a3153d8f20ca8962

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