这是一个可本地演示的“手机 AI 助理”全栈项目。后端使用 FastAPI + LangGraph 编排意图路由、手机工具 Agent、任务 Agent、RAG Agent、自我纠错和回答合成;前端使用 React + Vite + TypeScript 展示聊天、手机状态模拟器、图节点流转、工具调用和 RAG 来源。
- 多轮会话状态:同一个
session_id会保留上下文。 - 意图调度:将用户请求路由到手机工具、复杂任务或 RAG 问答节点。
- Tool Calling 演示:内置
open_app、create_reminder、set_alarm、check_calendar、get_device_status、search_phone_settings六个模拟工具。 - RAG 问答:默认读取
backend/knowledge_base中的 Markdown 文档;有OPENAI_API_KEY时可接入 Chroma + OpenAI Embeddings,没有 key 时使用本地关键词检索。 - 自我纠错:RAG 没有可靠来源时会改写 query 重试,达到上限后明确说明无法确认。
- LangSmith:配置
LANGSMITH_API_KEY和LANGSMITH_TRACING=true后可追踪链路。
$OutputEncoding = [Console]::OutputEncoding = [Text.UTF8Encoding]::new($false)
git clone https://github.com/Kryptonzy/mobile-ai-agent-mvp.git
cd mobile-ai-agent-mvp
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r backend/requirements.txt
.\.venv\Scripts\python.exe -m uvicorn app.main:app --app-dir backend --reload --port 8000$OutputEncoding = [Console]::OutputEncoding = [Text.UTF8Encoding]::new($false)
cd frontend
npm install
npm run dev前端默认访问 http://localhost:5173,后端默认访问 http://localhost:8000。
$OutputEncoding = [Console]::OutputEncoding = [Text.UTF8Encoding]::new($false)
.\.venv\Scripts\python.exe -m pytest backend/tests
cd frontend
npm run build帮我明早 8 点设个闹钟,并提醒我带电脑这个助手支持哪些手机权限?先查一下我今天安排,再帮我规划晚上学习 LangGraph刚才那个提醒改到 9 点知识库里有没有真实读取短信的说明?