https://github.com/oceanpresentchao/llm-react
从零搭建Agent框架(Build LLM ReAct Agent from scratch)
https://github.com/oceanpresentchao/llm-react
agent from-scratch llm openai-api tutorial typescript
Last synced: 9 months ago
JSON representation
从零搭建Agent框架(Build LLM ReAct Agent from scratch)
- Host: GitHub
- URL: https://github.com/oceanpresentchao/llm-react
- Owner: OceanPresentChao
- Created: 2024-01-25T08:40:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-23T13:02:26.000Z (about 1 year ago)
- Last Synced: 2025-04-06T16:49:27.064Z (10 months ago)
- Topics: agent, from-scratch, llm, openai-api, tutorial, typescript
- Language: TypeScript
- Homepage:
- Size: 1.95 MB
- Stars: 61
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 从零搭建ReAct Agent框架
本项目从零开始实现了ReAct Agent的流程:
1. 任务规划
2. 工具使用
3. 简单的内存短期记忆


## 项目结构
- src
- agent.ts Agent组件,对接结构化数据和大模型的纯文本输入输出
- executor.ts Executor组件,负责协调各组件,运行事件循环指挥行动
- llm.ts OpenAI API的简单封装
- prompt.ts ReAct框架的Prompt模板
- tool.ts Tool组件,抽象组件类
- toolkit.ts 一些具体的Tool
- config.json:项目的一些配置
- apiKey:openai的api key
- model:使用的openai的模型名
## 教程
- [手把手从零教你搭建Agent框架](./doc/手把手教你从零搭建Agent框架.md)