Skip to main content
Glama

AI 旅游助手

基于 Qwen2.5-1.5B + LoRA 微调与 ChromaDB + BGE 向量检索的智能旅游 Agent。 通过 MCP 协议 暴露工具服务,可被 Claude Code 等 AI 客户端直接调用。

功能一览

功能

说明

🌤️ 天气查询

30+ 城市实时/预报天气,支持"明天""后天"等中文日期

🚄 高铁查票

84 条内置线路,起止城市双向查询

✈️ 航班查询

89 条内置航线,含航司、时刻、参考票价

🗺️ 行程规划

智能解析预算/人数/天数/偏好,自动生成完整方案

📋 RAG 攻略

19 城旅游知识库,多轮对话记忆,追问自动补城市名

🔀 复合查询

多工具同时调用(如 "天气 + 高铁")

⚡ 流式响应

SSE 逐 token 推送,前端逐字渲染

Related MCP server: Travel Planner MCP Server

快速开始

环境要求

  • Python 3.10+

  • CUDA 11.8+(显存 ≥ 4GB)

  • 已下载 Qwen2.5-1.5B-Instruct 模型到本地缓存

启动

pip install -r requirements.txt

# 方式一:一键启动
python launch_api.py

# 方式二:直接运行
python api/main.py

# 访问 http://127.0.0.1:8000

测试

python test_api.py "深圳明天天气怎么样"
python test_api.py "北京故宫有什么特色"

项目结构

├── api/                    # Web API
│   ├── main.py             # FastAPI 主入口(REST + SSE 端点)
│   ├── session_store.py    # SQLite 会话持久化
│   └── static/index.html   # 卡片式聊天前端
├── agent/                  # Agent 核心
│   ├── dispatcher.py       # 工具调度器
│   ├── agent_loop.py       # 复合意图编排器
│   ├── planner.py          # 行程规划器
│   ├── mcp_server.py       # MCP 协议服务器
│   └── tools/              # 工具实现
│       ├── weather.py      # 天气工具
│       ├── train.py        # 高铁工具
│       └── flight.py       # 航班工具
├── finetune/               # LoRA 微调
│   ├── train_lora.py       # 训练脚本
│   └── rebuild_chroma_v3.py # 重建向量库
├── docs/                    # 知识文档
│   └── travel_knowledge     # 19 城攻略原始数据
├── launch_api.py           # 一键启动脚本
└── requirements.txt        # 依赖清单

技术栈

模型与推理: Qwen2.5-1.5B · LoRA (PEFT) · BitsAndBytes 4-bit · Transformers
RAG 检索: BAAI/bge-small-zh-v1.5 · ChromaDB · LangChain
Web 框架: FastAPI · Uvicorn · SSE 流式 · Pydantic
前端: 原生 HTML/CSS/JS · 卡片式 UI · 响应式布局
协议: MCP (Model Context Protocol) — stdio + SSE 双模式
持久化: SQLite · WAL 模式 · 线程安全
工具: wttr.in API · 内置 84 条高铁线路 · 89 条航线

License

MIT

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/to-ri-ki/travel-agent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server