> ## Documentation Index
> Fetch the complete documentation index at: https://ikun.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 简介

本指南将带您了解使用 Agno 构建 Agent 的基础知识。

这些示例会循序渐进地引入新的概念和功能。每个示例都包含详细的注释、示例提示和所需的依赖项。

## 设置

创建一个虚拟环境：

```bash theme={null}
python3 -m venv .venv
source .venv/bin/activate
```

安装所需的依赖项：

```bash theme={null}
pip install openai duckduckgo-search yfinance lancedb tantivy pypdf requests exa-py newspaper4k lxml_html_clean sqlalchemy agno
```

导出您的 OpenAI API 密钥：

```bash theme={null}
export OPENAI_API_KEY=your_api_key
```

## 示例

<CardGroup cols={3}>
  <Card title="基础 Agent" icon="robot" iconType="duotone" href="./basic-agent">
    构建一个具有鲜明个性的新闻报道 Agent。此 Agent 只展示基本的 LLM 推理。
  </Card>

  <Card title="带工具的 Agent" icon="toolbox" iconType="duotone" href="./agent-with-tools">
    添加 DuckDuckGo 网页搜索功能，以获取实时信息。
  </Card>

  <Card title="带知识的 Agent" icon="brain" iconType="duotone" href="./agent-with-knowledge">
    在您的 Agent 中添加向量数据库，用于存储和搜索知识。
  </Card>

  <Card title="带存储的 Agent" icon="database" iconType="duotone" href="./agent-with-storage">
    通过会话管理和历史记录功能，为您的 Agent 添加持久化能力。
  </Card>

  <Card title="Agent 团队" icon="users" iconType="duotone" href="./agent-team">
    创建一个专注于市场研究和财务分析的 Agent 团队。
  </Card>

  <Card title="结构化输出" icon="code" iconType="duotone" href="./structured-output">
    使用 Pydantic 模型生成结构化输出。
  </Card>

  <Card title="自定义工具" icon="wrench" iconType="duotone" href="./custom-tools">
    创建自定义工具并将其集成到您的 Agent 中。
  </Card>

  <Card title="研究 Agent" icon="magnifying-glass" iconType="duotone" href="./research-agent">
    使用 Exa 构建一个 AI 研究 Agent，并进行受控的输出引导。
  </Card>

  <Card title="研究工作流" icon="diagram-project" iconType="duotone" href="./research-workflow">
    创建一个结合了网页搜索和内容抓取的 AI 研究工作流。
  </Card>

  <Card title="图像 Agent" icon="image" iconType="duotone" href="./image-agent">
    创建一个能够理解图像的 Agent。
  </Card>

  <Card title="图像生成" icon="paintbrush" iconType="duotone" href="./image-generation">
    创建一个能够使用 DALL-E 生成图像的 Agent。
  </Card>

  <Card title="视频生成" icon="video" iconType="duotone" href="./video-generation">
    创建一个能够使用 ModelsLabs 生成视频的 Agent。
  </Card>

  <Card title="音频 Agent" icon="microphone" iconType="duotone" href="./audio-agent">
    创建一个能够处理音频输入并生成响应的 Agent。
  </Card>

  <Card title="带状态的 Agent" icon="database" iconType="duotone" href="./agent-state">
    创建一个具备会话状态管理的 Agent。
  </Card>

  <Card title="Agent 上下文" icon="sitemap" iconType="duotone" href="./agent-context">
    在 agent.run 中评估依赖项，并将它们注入指令中。
  </Card>

  <Card title="Agent 会话" icon="clock-rotate-left" iconType="duotone" href="./agent-session">
    创建一个在不同对话中保持持久会话内存的 Agent。
  </Card>

  <Card title="用户记忆" icon="memory" iconType="duotone" href="./user-memories">
    创建一个能够存储用户记忆和摘要的 Agent。
  </Card>

  <Card title="函数重试" icon="rotate" iconType="duotone" href="./retry-functions">
    处理函数重试，应对失败或不令人满意的输出。
  </Card>

  <Card title="人工干预" icon="user-check" iconType="duotone" href="./human-in-the-loop">
    添加用户确认和安全检查，以实现交互式 Agent 控制。
  </Card>
</CardGroup>

每个示例都包含可运行的代码和详细的解释。我们建议按顺序学习，因为概念是建立在先前示例的基础上的。
