---
title: "AI开发基础资料和相关技术介绍"
description: "这篇文章介绍了关于AI开发的基础资料，包括开发工具LangChain和LlamaIndex，以及LangGraph框架。还讨论了LLMs微调的挑战和提示工程技术的应用。此外，还介绍了RAG（增强检索）的基本原理和优化方法，以及向量数据库和Agent的相关内容。"
image: "https://wileyzhang.com/posts/cover/e6d87ac6-dd5b-48b1-8e18-93f7435fdb4a_c3f4caa2f32e244e8297d9690a0e536d.png"
url: "https://wileyzhang.com/posts/ai"
date: "2023-08-09"
updated: "2026-08-19"
type: "blog-post"
tags: ["LLM", "RAG", "Prompt"]
reading_time_minutes: 3
estimated_tokens: 1538
---

# 模型选择

[如何选择大模型\(榜单+指标\)](https://wileyzhang.com/posts/llm-leaderboard)

# 模型部署

[LLM部署\(docker+vllm+embedding+rerank\) 支持工具调用](https://wileyzhang.com/posts/llm-docker-vllm-embedding-rerank)

[修改FastChat使支持工具调用\(LangGraph适配FastChat\)](https://wileyzhang.com/posts/fastchat-langgraph-fastchat)

# RAG

[向量数据库Milvus混合检索](https://wileyzhang.com/posts/milvus)

[向量检索Chroma使用和服务端docker部署](https://wileyzhang.com/posts/chroma-docker)

# 开发工具

目前主流的开发的工具主要是LangChain和LlamaIndex，个人认为LlamaIndex更偏向研究一些，LangChain偏向工程，所以我们的主要开发工具也是LangChain。

### **LangChain**

[https://python.langchain.com/docs/get_started/introduction](https://python.langchain.com/docs/get_started/introduction)

从langchain种获取流式数据

```shell
chain = prompt|llm|StrOutputParser()
async for chunk in chain.astream({"question": "What are the types of agent memory?"}):
	print(chunk, flush=True)
```

如果我们的chain中有本地检索，在流式输出的时候，同时也想把检索到的文档信息返回

```shell
async for chunk in app1.astream_events({"question": "What are the types of agent memory?"},
                                       version="v2"):
    # 文档
    if chunk["event"] == "on_retriever_end":
        print(chunk["data"]["output"])
	      # 这里输出的是一个Document列表，从其中的MetaData中解析出来文档信息即可
        
    # 流式回答
    if chunk["event"] == "on_chat_model_stream":
        s += chunk["data"]["chunk"].content
        print(s)
        # 输出答案
```

### LangGraph

[https://langchain-ai.github.io/langgraph/tutorials/](https://langchain-ai.github.io/langgraph/tutorials/)

**简介**

LangGraph 是一个用于构建Agent的框架，它将Agent构建为图（graph）的形式。旨在简化构建复杂、有状态的代理的过程，而无需手动管理状态和中断。LangGraph 使得使用工具响应问题、在需要时与人类连接、以及能够无限期暂停流程并在人类响应后恢复变得容易。

**更多使用**

[修改FastChat使支持工具调用\(LangGraph适配FastChat\)](https://wileyzhang.com/posts/fastchat-langgraph-fastchat)

[LangGraph实战 子图、流响应](https://wileyzhang.com/posts/langgraph-subgraph)

# Prompt

直接针对特定任务对 LLMs 进行微调往往不切实际，或由于效率低下而无法为大多数用户和开发人员实现，研究界已将注意力转向提示的优化。**提示工程**技术是指通过人工或自动化手段，用自然语言编写精确的、针对特定任务的指令，并精心挑选有代表性的示例纳入提示，这已成为 LLMs 的核心研究领域。

[Prompt编写](https://wileyzhang.com/posts/prompt)

# RAG

RAG包含三个步骤：

- **检索**：根据用户的查询内容，从外部知识库获取相关信息。一般使用到向量数据库。

- **增强**：将用户的查询内容和检索到的相关知识一起嵌入到一个预设的提示词模板中。

- **生成**：将经过检索增强的提示词内容输入到大型语言模型中，以生成所需的输出。

![Untitled.png](https://wileyzhang.com/posts/images/e6d87ac6-dd5b-48b1-8e18-93f7435fdb4a/e6d87ac6-dd5b-48b1-8e18-93f7435fdb4a_bb3e2bb29ab0f561cccfbcff60ff2fc4.png)

# 向量数据库

[向量检索Chroma使用和服务端docker部署](https://wileyzhang.com/posts/chroma-docker)

[使用ES混合检索](https://python.langchain.com/v0.2/docs/integrations/retrievers/elasticsearch_retriever/#hybrid-search)

[原生ES混合检索](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-knn-query.html)

# **Agent**

[https://mp.weixin.qq.com/s?__biz=MzA3MzI4MjgzMw==&mid=2650890550&idx=1&sn=b92ded779dfc401aaacf00a68e32e916&chksm=84e4a548b3932c5eba6fd1f3c4c575380465aae1a89b584eac16a1ed3f1933fcf0f24c523bd5&mpshare=1&scene=1&srcid=0917RxDqIAmX76nofgOstNVv&sharer_shareinfo=c4bcc6b5d99e9f253a2d5d02995760dd&sharer_shareinfo_first=c4bcc6b5d99e9f253a2d5d02995760dd&version=4.1.10.6007&platform=win#rd](https://mp.weixin.qq.com/s?__biz=MzA3MzI4MjgzMw==&mid=2650890550&idx=1&sn=b92ded779dfc401aaacf00a68e32e916&chksm=84e4a548b3932c5eba6fd1f3c4c575380465aae1a89b584eac16a1ed3f1933fcf0f24c523bd5&mpshare=1&scene=1&srcid=0917RxDqIAmX76nofgOstNVv&sharer_shareinfo=c4bcc6b5d99e9f253a2d5d02995760dd&sharer_shareinfo_first=c4bcc6b5d99e9f253a2d5d02995760dd&version=4.1.10.6007&platform=win#rd)

---

> 本文由 WileyZhang 原创，首发于 [Wiley Blog](https://wileyzhang.com/posts/ai)。

```json
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "AI开发基础资料和相关技术介绍",
  "datePublished": "2023-08-09T00:00:00.000Z",
  "dateModified": "2026-08-19T00:00:00.000Z",
  "author": [
    {
      "@type": "Person",
      "name": "WileyZhang",
      "url": "https://wileyzhang.com/about"
    }
  ],
  "image": "https://wileyzhang.com/posts/cover/e6d87ac6-dd5b-48b1-8e18-93f7435fdb4a_c3f4caa2f32e244e8297d9690a0e536d.png",
  "description": "这篇文章介绍了关于AI开发的基础资料，包括开发工具LangChain和LlamaIndex，以及LangGraph框架。还讨论了LLMs微调的挑战和提示工程技术的应用。此外，还介绍了RAG（增强检索）的基本原理和优化方法，以及向量数据库和Agent的相关内容。",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://wileyzhang.com/posts/ai"
  }
}
```
