dotsagent.io
语言:简体中文
框架 · LlamaIndex

快速了解 LlamaIndex

LlamaIndex 将文档解析和检索工具与 Python 和 TypeScript 中的事件驱动 Agent Workflows 结合起来。Workflows 可以暂停以等待人工输入、持久化状态,还可作为 MCP 服务器提供服务或部署到 LlamaCloud。

适用于: 以文档处理和检索为核心的智能体,可在执行操作前解析、提取和搜索信息。

关键信息

维护者
LlamaIndex
语言
Python, TypeScript
许可证
MIT
最新版本
llama-index 0.14.25 / llama-index-workflows 2.25.0 · 2026年9月25日
代码仓库
run-llama/llama_index · 52,380 个 stars
托管选项
LlamaCloud via LlamaAgents (llamactl deploy)
使用 llamactl 部署;部署后,工作流将通过 api.cloud.llamaindex.ai 提供服务。

快速入门

安装软件包、设置凭据,然后运行官方文档中的最简 agent。这里使用的模型 ID 与文档一致,但你的账户可能尚未启用这些模型。

安装
pip install llama-index-core llama-index-llms-openai  (from search summary of the starter tutorial; not copied verbatim)

需要 OPENAI_API_KEY

Python
import asyncio
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

# Define a simple calculator tool
def multiply(a: float, b: float) -> float:
    """Useful for multiplying two numbers."""
    return a * b

# Create an agent workflow with our calculator tool
agent = FunctionAgent(
    tools=[multiply],
    llm=OpenAI(model="gpt-4o-mini"),
    system_prompt="You are a helpful assistant that can multiply two numbers.",
)

async def main():
    # Run the agent
    response = await agent.run("What is 1234 * 4567?")
    print(str(response))

# Run the agent
if __name__ == "__main__":
    asyncio.run(main())

快速入门来源

功能

支持任意模型是对支持函数调用的模型使用 FunctionAgent;对其他模型使用 ReActAgent
MCP 客户端是使用 llama-index-tools-mcp 中的 get_tools_from_mcp_url
MCP 服务器是workflow_as_mcp 通过 FastMCP 提供工作流服务
多 agent是AgentWorkflow 可协调多个智能体
持久化运行是连接协调后端后,Workflows 会持久化状态
人工审批是InputRequiredEvent 和 HumanResponseEvent 可暂停工作流
追踪尚未确认
评测尚未确认

近期更新

  • workflows 仓库已更名为 run-llama/llama-agents(LlamaAgents);PyPI 包仍为 llama-index-workflows。
  • 现在可使用 llamactl 提供工作流服务并进行部署。

同一语言的替代方案

来源

  1. developers.llamaindex.ai/python/framework/getting_started/starter_example/
  2. developers.llamaindex.ai/python/framework/module_guides/deploying/agents/
  3. developers.llamaindex.ai/python/examples/agent/agent_workflow_basic/
  4. developers.llamaindex.ai/python/examples/tools/mcp/
  5. developers.llamaindex.ai/python/llamaagents/workflows/human_in_the_loop/
  6. developers.llamaindex.ai/python/llamaagents/llamactl/workflow-api/
  7. github.com/run-llama/llama-agents
  8. pypi.org/pypi/llama-index/json
  9. api.github.com/repos/run-llama/llama_index

为 AI agent 开发者提供的独立参考资料。与此处提及的任何厂商均无关联。

© 2026 DotsAgent · 事实核查日期:2026年10月1日