SAGE RAG
RAG (Retrieval-Augmented Generation) 组件库,提供文档加载、文本分块、检索和重排序功能。
🧭 边界说明(L3)
sage-rag 作为 L3 算法组件仓库,职责边界如下:
- In-scope(本仓库负责)
- 文档加载(loaders)
- 文本切分(chunkers)
- 检索与重排实现(retrievers / rerankers)
- RAG pipeline 组合逻辑(pipelines)
- Out-of-scope(不在本仓库实现)
- 中间件/服务绑定能力(例如数据库服务编排、集群调度)
- L4/L5 运行时和平台层实现
- Forbidden imports(禁止越层依赖)
sage.middlewaresage.kernelsage.platform
边界与依赖审计 ADR:
docs/adr/0001-l3-boundary-convergence.mddocs/adr/0002-pipeline-boundary-cleanup.mddocs/adr/0003-retriever-reranker-contracts.mddocs/adr/0004-phase1-dependency-audit.md
📦 安装
pip install isage-rag
🚀 快速开始
# 直接导入使用
from sage_rag import TextLoader, SentenceChunker
loader = TextLoader()
documents = loader.load("document.txt")
chunker = SentenceChunker()
chunks = chunker.chunk(documents)
📚 组件
- Loaders: TextLoader, MarkdownLoader
- Chunkers: SentenceChunker, TokenChunker
- Retrievers: DenseRetriever
- Rerankers: CrossEncoderReranker
- Pipelines: SimpleRAGPipeline
DenseRetriever需要显式提供vector_store与embedding_model后才能执行index/retrieve/delete_documents。
详细文档请查看 docs/ 目录。
🔌 与 SAGE 集成
本包可以自动注册到 SAGE 框架:
import sage_rag # 自动注册
from sage.libs.rag import create_loader
loader = create_loader("text")
📄 许可证
MIT License - 详见 LICENSE
📧 联系
Metadata
Release files for isage-rag 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| isage_rag-0.3.0.tar.gz | 58.8 kB | Without provenance | Details for isage_rag-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| isage_rag-0.3.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for isage_rag-0.3.0-py2.py3-none-any.whl |
Total release size: 137.7 kB
Release files / isage_rag-0.3.0.tar.gz
| Download URL | isage_rag-0.3.0.tar.gz |
|---|---|
| Size | 58.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
14394314191702de8921426f36d1aba9c137719378008a385ed23a12ddf83d81
|
|
BLAKE2b-256 checksum How to use checksums |
985144e8623d05f3e2e2f8eae01363ac9d2aee8b9a251b1172ec6726ab45af5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / isage_rag-0.3.0-py2.py3-none-any.whl
| Download URL | isage_rag-0.3.0-py2.py3-none-any.whl |
|---|---|
| Size | 78.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
9d6ddf01ad7db564cc5adf501a8da41a1d1f1b8c56a30ca5aebff6a6c0feb2dd
|
|
BLAKE2b-256 checksum How to use checksums |
9d8cb959263910ae13364b758264633e258c592ed9415df6345f778fe115d3dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for isage-rag 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.