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

Uploaded CPython 3.13Windows x86-64

fabricatio_rag-0.1.4.dev5-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.4.dev5-cp312-cp312-win_amd64.whl (814.4 kB view details)

Uploaded CPython 3.12Windows x86-64

fabricatio_rag-0.1.4.dev5-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.4.dev5-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.4.dev5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1743ea14e2eb612f7cb0b4a072c58ad8a7041b0adf506adac8fb27d616cd13b4
MD5 efa005369707492e3cc312a16c2155c9
BLAKE2b-256 08feaaef37be8c957ec7e82d91bfc83ab79314ec538143c4d75e5b578ab644eb

See more details on using hashes here.

File details

Details for the file fabricatio_rag-0.1.4.dev5-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.4.dev5-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1c3f98e85b318e1e434dc011c2a60a332f29772ee2dd8833e70aef49089765a5
MD5 74939750e88cbd2d181d4becf37aca7c
BLAKE2b-256 93805cf066d47bd895c7aa6243b6dded06fc46d9e82dd4432f4dff7d902bc498

See more details on using hashes here.

File details

Details for the file fabricatio_rag-0.1.4.dev5-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.4.dev5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a2b30ea9321bcb6b674aaa1b3f4a8354efbaeeb65808a984a171ae9e98e51d99
MD5 5c6214e0b09fea550343ef990c162425
BLAKE2b-256 17418dfd13b80f14c460cfc03be48e99575222095b8bb7f8329d3698f6d01ea3

See more details on using hashes here.

File details

Details for the file fabricatio_rag-0.1.4.dev5-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fabricatio_rag-0.1.4.dev5-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 633e7147e9d38ddcdb6f4135cb25cee742fbaf489cd061fdaf145a35bec5d91e
MD5 f5f66695ad3fcddd44effaee515411f2
BLAKE2b-256 60f5ebca01848206f1bf0c83034248706fd27bf458a56bf20bc3ed6081629425

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