WIN-JHFT4D3SIVT\caoxiaozhu 8c7cf0732b Align knowledge storage with real folders and add WebDAV import surface
Knowledge files were only partitioned in the database, which made nested uploads, local folder visibility, and delete behavior diverge from the UI. This change makes folder selection drive physical storage paths, keeps original filenames, adds a minimal WebDAV mount/sync path, and reshapes the knowledge panel so local and remote sources can share the same surface.

Constraint: Existing knowledge flow already depends on local-folder-backed uploads and document indexing
Rejected: Real-time bidirectional WebDAV sync | too much conflict and lifecycle complexity for the first pass
Confidence: medium
Scope-risk: moderate
Reversibility: messy
Directive: Keep remote mounts single-direction into local knowledge folders until etag-based incremental sync and conflict rules are verified
Tested: Python py_compile on new/modified backend files; LSP diagnostics on new frontend/backend files; manual targeted code-path inspection
Not-tested: Full pytest/vitest end-to-end runs blocked by environment temp/cache permission errors; live WebDAV server interoperability
2026-04-09 17:26:37 +08:00
2026-03-22 22:42:47 +08:00

Jarvis 个人 AI 助理

你的私人 AI 大脑 — 懂你的知识、懂你的安排

功能特性

  • 多 Agent 协作 — 主 Agent 协调 + 4 个专业子 Agent规划/执行/知识管理/分析)
  • 私人知识库 — LlamaIndex 智能分块 + ChromaDB 向量检索
  • 动态知识图谱 — LLM 自动抽取实体和关系,构建你的知识网络
  • 论坛 + 看板 — 发布指令让 AI 执行,管理每日任务
  • 定时任务 — 凌晨自动分析任务、扫描论坛指令、重建图谱
  • 流式对话 — WebSocket 实时流式输出
  • 本地部署 — NAS + Docker数据完全自主可控

快速开始

前置要求

  • Python 3.12+ (需要 uv)
  • Node.js 18+
  • Claude API Key

Windows 一键启动

# 1. 先配置 API Key首次
setup.bat

# 2. 一键启动(自动装依赖 + 启动服务)
start.bat

手动启动

# 1. 配置项目根目录环境变量
cp backend/.env.example .env
# 编辑项目根目录 .env

# 2. 安装依赖
cd backend
uv sync

# 3. 启动后端(按项目根目录 .env
uv run uvicorn app.main:app --reload --host "$HOST" --port "$PORT"

# 4. 新终端,启动前端
cd frontend
npm install
npm run dev

打开浏览器

访问 http://localhost:5173

注册账号后即可使用。


API 文档

后端启动后,访问 http://<HOST>:<PORT>/docs 查看交互式 API 文档(以项目根目录 .env 为准)。

主要接口

方法 路径 说明
POST /api/auth/register 注册
POST /api/auth/login 登录
POST /api/conversations/chat 发送消息
POST /api/conversations/chat/stream 流式对话
POST /api/documents/upload 上传文档
POST /api/documents/search 搜索知识库
GET /api/tasks 获取任务
POST /api/forum/posts 发布论坛帖子
GET /api/graph 获取知识图谱
GET /api/scheduler/status 定时任务状态

Docker 部署NAS

# 在 NAS 上运行
docker-compose up -d

# 查看日志
docker-compose logs -f jarvis-backend

数据存储在 ./data/ 目录。


项目结构

MyAgents/
├── backend/               # FastAPI 后端
│   ├── app/
│   │   ├── agents/       # LangGraph 多 Agent 系统
│   │   │   ├── graph.py  # Agent 图定义
│   │   │   ├── state.py  # 状态定义
│   │   │   ├── prompts.py# 提示词
│   │   │   └── tools/    # 工具集
│   │   ├── services/     # 业务服务
│   │   ├── routers/      # API 路由
│   │   ├── models/       # 数据库模型
│   │   └── schemas/      # Pydantic 模型
│   ├── Dockerfile
│   └── pyproject.toml
│
├── frontend/              # Vue 3 前端
│   ├── src/
│   │   ├── views/        # 页面
│   │   ├── api/          # API 调用
│   │   ├── stores/       # Pinia 状态
│   │   └── router/       # 路由
│   └── Dockerfile
│
├── docker-compose.yml
└── README.md

开发说明

后端依赖uv

cd backend
uv sync                    # 安装依赖
uv add <package>           # 添加依赖
uv run pytest              # 运行测试

前端依赖

cd frontend
npm install                # 安装依赖
npm run dev                # 开发服务器
npm run build              # 构建生产版本

技术栈

组件 技术
后端 FastAPI + SQLAlchemy async
Agent LangGraph + LangChain
知识库 LlamaIndex + ChromaDB
前端 Vue 3 + TypeScript + Vite
数据库 SQLite
定时任务 APScheduler
部署 Docker

License

MIT

Description
个人超级智能体
Readme 53 MiB
Languages
Python 59.6%
Vue 18.9%
TypeScript 10.6%
CSS 5.7%
HTML 4.1%
Other 1.1%