LangChain 架构

LangChain架构

LangSmith: 运维+监控 。

调用链
成功调用多少次,失败多少次,花费多少token

LangSmith是一个用于追踪和评估你的语言模型应用和智
能代理的工具,旨在帮助你从原型阶段过渡到生产阶段。

LangServe:

把开发的接口变成REST API,给其他服务(前端等)调用。
LangServe是一个服务,用于将LangChain的可运行项和
链部署为REST API,使得它们可以通过网络进行调用。

Templates: (非核心)

通过模块快速生成 监控,和RestApi

LangGraph:

比基于LangChain的API做更高级的封装。
最后开发出来的大模型的应用 ,就是一个个LangGraph

LangGraph能够协调多个Chain,Agent,Tools完成更复
杂的任务,并且还支持循环调用。

LangChain:

脚手架。封装很多高级API给我们使用
Model I/O,Chain,Agent等。屏蔽不同的大模型的API的差异。

新版本API使用LECL语言做方法调用(75%)

API

Model I/O

调用大模型(单一模型调用)
https://python.langchain.com/v0.1/docs/modules/model_io/

Chains

支持链路的调用(多个模型调用)
https://python.langchain.com/v0.1/docs/modules/chains/

Retrieval

检索,就是RAG
https://python.langchain.com/v0.1/docs/modules/data_connection/

Agents

Agents架构
https://python.langchain.com/v0.1/docs/modules/agents/

Memory

记忆能力,把历史数据保存下来。
也可以把记忆能力划分到Agent

Langchain官网如何学习

最核心的是Component和Guides, 其他当做字典查询

最佳实践

https://python.langchain.com/v0.1/docs/guides/

基于langchain开发的各种案例

https://github.com/langchain-ai/langchain/blob/master/cookbook/README.md

和其他云平台集成

https://python.langchain.com/v0.1/docs/integrations/platforms/

集成向量化模型

指将文本、图像等非结构化数据转换为高维向量(Embedding)的机器学习模型(如BERT、Word2Vec、OpenAI的text-embedding-ada-002等)。
https://python.langchain.com/v0.1/docs/integrations/text_embedding/

在线视频教程

https://python.langchain.com/v0.1/docs/additional_resources/youtube/

参考资料

0.1 API

https://python.langchain.com/v0.1/docs/modules/

tools
https://python.langchain.com/v0.1/docs/modules/tools/

https://python.langchain.com/docs/tutorials/

posted @ 2025-03-13 11:58  向着朝阳  阅读(96)  评论(0)    收藏  举报