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 integrationfabricatio-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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fabricatio_rag-0.1.1.dev0-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: fabricatio_rag-0.1.1.dev0-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 814.4 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90439f74aa5312df41356e26dc62094b84eaa82d97b9f33546eb58a6064772d6
|
|
| MD5 |
b9305c057e12d3313bc27bdbf5d4007d
|
|
| BLAKE2b-256 |
264b17f3494fadc0ba55eef66c5f4d01d36bce369587a984f76f009d9ce18875
|
File details
Details for the file fabricatio_rag-0.1.1.dev0-cp313-cp313-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: fabricatio_rag-0.1.1.dev0-cp313-cp313-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.13, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44149237508a2e57cf7fc6890fbf1471f239c6fa1827e558e9b72c168117819c
|
|
| MD5 |
bc7decb97bc8f72ac70d03ba5e7dd91d
|
|
| BLAKE2b-256 |
75f01ab6f3f47fa7c2fd542063523fa604bdef61853f16c7176680ee99b33e4e
|
File details
Details for the file fabricatio_rag-0.1.1.dev0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: fabricatio_rag-0.1.1.dev0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 814.9 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edd58a008bb312a5be269b14306b9a7e68f02c52d819310a02dea94d9d833d2e
|
|
| MD5 |
e9de2e4df81ec6b1ac184cbb0fcfb193
|
|
| BLAKE2b-256 |
423a3a91d9e1e152927ab6f8c8c0f80b76ec59388ba4242c0bf7ca58008890e7
|
File details
Details for the file fabricatio_rag-0.1.1.dev0-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: fabricatio_rag-0.1.1.dev0-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcf32b674cdc88fa2705f63e903040a0533bb374f6fe014024b754aa14d8acf8
|
|
| MD5 |
975b31e53ead28181ed5b7b82c64addf
|
|
| BLAKE2b-256 |
a86f05ba23d292f939b97d1809f4bbcee67afee0915da0db25a459973feb022e
|