llamaindex

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LlamaIndex

LlamaIndex

LlamaIndex (formerly GPT Index) connects LLMs to your data. 2025 introduces Workflows, an event-driven way to build complex RAG pipelines.
LlamaIndex(前身为GPT Index)可将大语言模型(LLMs)与你的数据相连接。2025年推出了Workflows,这是一种用于构建复杂RAG流水线的事件驱动型方式。

When to Use

适用场景

  • RAG (Retrieval Augmented Generation): Indexing PDFs, Docs, SQL to chat with them.
  • Structured Data: Querying SQL/Pandas with natural language (
    NLSQL
    ).
  • Agents: Building research agents that browse the web and summarize.
  • RAG(检索增强生成):为PDF、文档、SQL建立索引,实现与这些数据的对话交互。
  • 结构化数据:使用自然语言查询SQL/Pandas(即
    NLSQL
    )。
  • Agent:构建可浏览网页并生成摘要的研究型Agent。

Core Concepts

核心概念

Workflows

Workflows

Event-driven architecture for agents. Replace DAGs with event listeners (
@step
).
面向Agent的事件驱动架构。使用事件监听器(
@step
)替代DAG。

Query Engine

查询引擎

High-level API (
index.as_query_engine()
) to ask questions.
提供高层级API(
index.as_query_engine()
)用于提问。

Data Loaders (LlamaHub)

数据加载器(LlamaHub)

Connectors for Notion, Slack, Discord, PDF, etc.
支持Notion、Slack、Discord、PDF等数据源的连接器。

Best Practices (2025)

2025年最佳实践

Do:
  • Use Workflows: They are harder to learn but easier to debug than monolithic engines.
  • Use Hybrid Search: BM25 (Keyword) + Vector Search for best retrieval accuracy.
  • Use Rerankers: Always rerank retrieved nodes (Cohere/BGE) before sending to LLM.
Don't:
  • Don't dump raw text: Use "Node Parsers" to chunk data intelligently (Markdown, Semantic).
建议
  • 使用Workflows:相比单体引擎,它们的学习曲线更陡,但调试起来更简单。
  • 使用混合搜索:结合BM25(关键词搜索)与向量搜索,实现最佳检索准确率。
  • 使用重排器:在将检索到的节点发送给LLM之前,务必使用重排器(如Cohere/BGE)进行重排。
不建议
  • 不要直接导入原始文本:使用“Node Parsers”智能拆分数据(如Markdown、语义拆分)。

References

参考资料