
## 环境搭建
```bash
git clone xxxxxx
npm install pm2 -g
yarn
pip install -r requirements.txt
```
下载最新版本的 Lagrange.core ,并完成初始化。完成后根目录为
```
📁bot
📁rag
📁app
├─📁publish
│ ├─🏷️...
│ ├─🏷️appsettings.json
│ └─🪛Lagrange.OneBot
└─🎗️...
```
---
## 架构
```mermaid
graph TB
core(Lagrage.Core)
onebot(Lagrange.onebot)
vecdb(vecdb)
llm(LLM)
intent(intent tree)
core(Lagrange.Core) --> onebot(Lagrange.onebot)
onebot -->|query| intent
intent -->|intent| onebot
subgraph Intent Recognition
intent -->|query| vecdb
vecdb -->|ktop| intent
intent -->|ktop,query| llm
llm -->|intent| intent
end
subgraph execution
onebot --> command{intent}
command --> query
command --> upload
command --> ...
end
subgraph third party
LLM
Google
server
end
query --> LLM
query --> Google
upload --> server
```
- `Lagrange.onebot` --> 📁bot
- `vecdb` --> 📁rag
- `intent tree` --> 📁prompt
---
## 接口规范
http 接口满足 `HttpResponse` 所示。
```typescript
interface HttpResponse {
code: number,
data: CommonResponse
}
interface CommonResponse {
code: number,
data?: T,
msg?: string
}
```
---
## 开发须知
- 非必要,请不要随意宣传本项目。
- 虽然曾经无数个 QQ 相关的项目都死了,但是基本的 API 端口算是传承了下来。拉格朗日的返回类型,请参考 [go-cqhttp 帮助中心 - API 篇](https://docs.go-cqhttp.org/api/) 中的内容。