线性图检索生成 是 AI Skill Hub 本期精选AI工具之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
线性图检索生成 是一款基于 Python 开发的开源工具,专注于 graphrag、llms、rag 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
线性图检索生成 是一款基于 Python 开发的开源工具,专注于 graphrag、llms、rag 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install linearrag
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install linearrag
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/DEEP-PolyU/LinearRAG
cd LinearRAG
pip install -e .
# 验证安装
python -c "import linearrag; print('安装成功')"
# 命令行使用
linearrag --help
# 基本用法
linearrag input_file -o output_file
# Python 代码中调用
import linearrag
# 示例
result = linearrag.process("input")
print(result)
# linearrag 配置文件示例(config.yml) app: name: "linearrag" debug: false log_level: "INFO" # 运行时指定配置文件 linearrag --config config.yml # 或通过环境变量配置 export LINEARRAG_API_KEY="your-key" export LINEARRAG_OUTPUT_DIR="./output"
A relation-free graph construction method for efficient GraphRAG. It eliminates LLM token costs during graph construction, making GraphRAG faster and more efficient than ever.
<p align="center"> <a href="https://arxiv.org/abs/2510.10114" target="_blank"> <img src="https://img.shields.io/badge/Paper-Arxiv-red?logo=arxiv&style=flat-square" alt="arXiv:2506.08938"> </a> <a href="https://huggingface.co/datasets/Zly0523/linear-rag/tree/main" target="_blank"> <img src="https://img.shields.io/badge/HuggingFace-Model-yellow?logo=huggingface&style=flat-square" alt="HuggingFace"> </a> <a href="https://github.com/LuyaoZhuang/linear-rag" target="_blank"> <img src="https://img.shields.io/badge/GitHub-Project-181717?logo=github&style=flat-square" alt="GitHub"> </a> </p>
---
- ✅ Context-Preserving: Relation-free graph construction, relying on lightweight entity recognition and semantic linking to achieve comprehensive contextual comprehension. - ✅ Complex Reasoning: Enables deep retrieval via semantic bridging, achieving multi-hop reasoning in a single retrieval pass without requiring explicit relational graphs. - ✅ High Scalability: Zero LLM token consumption, faster processing speed, and linear time/space complexity. <p align="center"> <img src="figure/main_figure.png" width="95%" alt="Framework Overview"> </p>
---
Step 1: Install Python packages
pip install -r requirements.txt
(Use Python 3.9 preferably)
Step 2: Download Spacy language model
python -m spacy download en_core_web_trf
Note: For themedicaldataset, you need to install the scientific/biomedical Spacy model:pip install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.3/en_core_sci_scibert-0.5.3.tar.gz
Step 3: Set up your OpenAI API key
export OPENAI_API_KEY="your-api-key-here"
export OPENAI_BASE_URL="your-base-url-here"
Step 4: Download Datasets
Download the datasets from HuggingFace and place them in the dataset/ folder:
git clone https://huggingface.co/datasets/Zly0523/linear-rag
cp -r linear-rag/* dataset/
Step 5: Prepare Embedding Model
Make sure the embedding model is available at:
model/all-mpnet-base-v2/
SPACY_MODEL="en_core_web_trf"
EMBEDDING_MODEL="model/all-mpnet-base-v2"
DATASET_NAME="2wikimultihop"
LLM_MODEL="gpt-4o-mini"
MAX_WORKERS=16
python run.py \
--spacy_model ${SPACY_MODEL} \
--embedding_model ${EMBEDDING_MODEL} \
--dataset_name ${DATASET_NAME} \
--llm_model ${LLM_MODEL} \
--max_workers ${MAX_WORKERS}
# --use_vectorized_retrieval # optional, use vectorized matrix-based retrieval for GPU acceleration if Strong GPU is available, otherwise use BFS iteration.
高效的大规模图数据生成工具
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
⚠️ GPL 3.0 — 强 Copyleft,衍生作品须开源,含专利保护条款,不可闭源使用。
经综合评估,线性图检索生成 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | LinearRAG |
| Topics | graphragllmsragpython |
| GitHub | https://github.com/DEEP-PolyU/LinearRAG |
| License | GPL-3.0 |
| 语言 | Python |
收录时间:2026-07-05 · 更新时间:2026-07-05 · License:GPL-3.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。