A travel agent based on Qwen2.5, fine-tuned by SFT + DPO/PPO/GRPO using traveling question-answer dataset, a mindmap can be output using the response. A RAG system is build upon the tuned qwen2, using Prompt-Template + Tool-Use + Chroma embedding database + LangChain
Python
83
133 commits
updated Jul 6, 2026
本项目希望借助轻量级大模型Qwen2.5-0.5B~3B帮助用户在本地更好地规划旅行路径,提高旅行体验。本项目是基于Qwen2.5+SFT微调+RLHF+RAG的旅游路径规划智能体。
项目的整体框架如下:
- Qwen2模型本体
- SFT + RLHF 系统
- SFTTrainer
- PPOTrainer
- DPOTrainer
- GRPOTrainer
- RAG系统
- RAG 调度器
- naive RAG
- Self-RAG
- MemWalker-RAG
- multi-agent 系统
辅助工具:
传统RAG:
MemWalker [一种RAG方法,可以自己去搜paper]:
记忆树构建过程
交互式导航机制
在遍历过程中维护工作记忆
Self-RAG:
自适应检索机制
反思标记系统
反思标记[reflection tokens]评估生成内容三步执行流程
端到端训练方法
RAG Dispatcher
Gradio
数据预处理系统
GPU: RTX3090 x 2 Platform: AutoDL
pip install -r requirements.txt
cd src/data
huggingface-cli download --resume-download JasleenSingh91/travel-QA --local-dir travel-QA
cd src/data
huggingface-cli download --resume-download --repo-type dataset HumanLLMs/Human-Like-DPO-Dataset --local-dir Human-Like-DPO-Dataset
cd src/data
huggingface-cli download --resume-download --repo-type dataset HumanLLMs/Human-Like-DPO-Dataset --local-dir Human-Like-DPO-Dataset
cd src/data
huggingface-cli download --resume-download BruceNju/crosswoz-sft --local-dir crosswoz-sft
JasleenSingh91/travel-QA
{"question":.......,"response":.....}
crosswoz{
"dialog_id": "391",
"turn_id": 0,
"role": "usr",
"content": "你好,麻烦帮我推荐一个门票免费的景点。",
"dialog_act": "[[\"General\", \"greet\", \"none\", \"none\"], [\"Inform\", \"景点\", \"门票\", \"免费\"], [\"Request\", \"景点\", \"名称\", \"\"]]",
"history": "[]",
"user_state": "[[1, \"景点\", \"门票\", \"免费\", true], [1, \"景点\", \"评分\", \"5分\", false], [1, \"景点\", \"地址\", \"\", false], [1, \"景点\", \"游玩时间\", \"\", false], [1, \"景点\", \"名称\", \"\", true], [2, \"餐馆\", \"名称\", \"拿渡麻辣香锅(万达广场店)\", false], [2, \"餐馆\", \"评分\", \"\", false], [2, \"餐馆\", \"营业时间\", \"\", false], [3, \"酒店\", \"价格\", \"400-500元\", false], [3, \"酒店\", \"评分\", \"4.5分以上\", false], [3, \"酒店\", \"周边景点\", [], false], [3, \"酒店\", \"名称\", \"\", false]]",
"goal": "[[1, \"景点\", \"门票\", \"免费\", false], [1, \"景点\", \"评分\", \"5分\", false], [1, \"景点\", \"地址\", \"\", false], [1, \"景点\", \"游玩时间\", \"\", false], [1, \"景点\", \"名称\", \"\", false], [2, \"餐馆\", \"名称\", \"拿渡麻辣香锅(万达广场店)\", false], [2, \"餐馆\", \"评分\", \"\", false], [2, \"餐馆\", \"营业时间\", \"\", false], [3, \"酒店\", \"价格\", \"400-500元\", false], [3, \"酒店\", \"评分\", \"4.5分以上\", false], [3, \"酒店\", \"周边景点\", [], false], [3, \"酒店\", \"名称\", \"\", false]]",
"sys_usr": "[43, 18]",
"sys_state": "",
"sys_state_init": ""
}
# 使用最基础的 RAG
python main.py --function use_rag
# 使用调度器进行RAG类型选择
python main.py --function rag_dispatcher --rag_type self_rag
python main.py --function train
config.py 中配好 REWARD_MODEL_PATHcd /root/autodl-tmp/models
huggingface-cli download --resume-download OpenAssistant/reward-model-deberta-v3-large-v2 --local-dir reward-model-deberta-v3-large-v2
python -m src.finetune.ppo_train_from_scratch
python -m src.finetune.ppo_trainer
python -m src.finetune.dpo_trainer
python -m src.finetune.grpo_trainer
src/ 目录下.src/ 的目录结构:src:
data:
- processed_data
- data_augmentation.py
- data_preprocessor.py
- crosswoz-sft:
- ...
- travel_qa:
- ...
- init.py
configs:
- config.py
- ds_config.py
agents:
- travel_knowledge:
- tour_pages
- tour_pdfs
- agent.py
- bm25.py
- tools.py # 各种 Executors: google,weather, transportation; 以及 ToolDispatcher
- zhipuAPI.py
- prompt_template.py
- chat_pdf.py
- rag.py
- mem_walker.py
- self_rag.py
- corrective_rag.py # 现在还没写好这个,别跑!
- rag_dispatcher.py
finetune:
- dpo_trainer.py
- sft_trainer.py # SFTTrainer
- ppo_trainer.py
- grpo_trainer.py
- multi_task_trainer.py
- __init__.py
pretrain:
- pretrain.py
- init.py
models:
- qwen2
- modeling_qwen2.py
- configuration_qwen2.py
- tokenization_qwen2.py
- dola_decode.py
- model.py # TravelAgent类所在的位置
- init.py
ui:
- app.py
- mindmap.py
- init.py
data:
- 各种数据集
utils.py
configs:
- config.py
- init.py
src/agents/agent.pyimage 文件夹中找你想要的结果

![]() | ![]() | ![]() |
| 图1 | 图2 | 图3 |

运行结果 part1

运行结果 part2

运行结果 part3





Epoch Rouge1 Rouge2 RougeL BLEU
we refer to many other projects when building this project.
Dataset Citation:
@inproceedings{zhu2020crosswoz,
title={CrossWOZ: A Large-Scale Chinese Cross-Domain Task-Oriented Dialogue Dataset},
author={Zhu, Qi and Zhang, Zheng and Fang, Yan and Li, Xiang and Takanobu, Ryuichi and Li, Jinchao and Peng, Baolin and Gao, Jianfeng and Zhu, Xiaoyan and Huang, Minlie},
booktitle={Transactions of the Association for Computational Linguistics},
year={2020},
url={https://arxiv.org/abs/2002.11893}
}
@misc{travel_agent_qwen2_rlhf,
author = {NJUxlj},
title = {Travel-Agent-based-on-Qwen2-RLHF},
year = {2025},
howpublished = {\url{https://github.com/NJUxlj/Travel-Agent-based-on-Qwen2-RLHF.git}},
note = {A travel agent fine-tuned using SFT, DPO, PPO, and GRPO with a traveling Q\&A dataset. Includes mindmap generation and LangChain integration.}
}
A travel agent based on Qwen2.5, fine-tuned by SFT + DPO/PPO/GRPO using traveling question-answer dataset, a mindmap can be output using the response. A RAG system is build upon the tuned qwen2, using Prompt-Template + Tool-Use + Chroma embedding database + LangChain
Python
83
133 commits
updated Jul 6, 2026
本项目希望借助轻量级大模型Qwen2.5-0.5B~3B帮助用户在本地更好地规划旅行路径,提高旅行体验。本项目是基于Qwen2.5+SFT微调+RLHF+RAG的旅游路径规划智能体。
项目的整体框架如下:
- Qwen2模型本体
- SFT + RLHF 系统
- SFTTrainer
- PPOTrainer
- DPOTrainer
- GRPOTrainer
- RAG系统
- RAG 调度器
- naive RAG
- Self-RAG
- MemWalker-RAG
- multi-agent 系统
辅助工具:
传统RAG:
MemWalker [一种RAG方法,可以自己去搜paper]:
记忆树构建过程
交互式导航机制
在遍历过程中维护工作记忆
Self-RAG:
自适应检索机制
反思标记系统
反思标记[reflection tokens]评估生成内容三步执行流程
端到端训练方法
RAG Dispatcher
Gradio
数据预处理系统
GPU: RTX3090 x 2 Platform: AutoDL
pip install -r requirements.txt
cd src/data
huggingface-cli download --resume-download JasleenSingh91/travel-QA --local-dir travel-QA
cd src/data
huggingface-cli download --resume-download --repo-type dataset HumanLLMs/Human-Like-DPO-Dataset --local-dir Human-Like-DPO-Dataset
cd src/data
huggingface-cli download --resume-download --repo-type dataset HumanLLMs/Human-Like-DPO-Dataset --local-dir Human-Like-DPO-Dataset
cd src/data
huggingface-cli download --resume-download BruceNju/crosswoz-sft --local-dir crosswoz-sft
JasleenSingh91/travel-QA
{"question":.......,"response":.....}
crosswoz{
"dialog_id": "391",
"turn_id": 0,
"role": "usr",
"content": "你好,麻烦帮我推荐一个门票免费的景点。",
"dialog_act": "[[\"General\", \"greet\", \"none\", \"none\"], [\"Inform\", \"景点\", \"门票\", \"免费\"], [\"Request\", \"景点\", \"名称\", \"\"]]",
"history": "[]",
"user_state": "[[1, \"景点\", \"门票\", \"免费\", true], [1, \"景点\", \"评分\", \"5分\", false], [1, \"景点\", \"地址\", \"\", false], [1, \"景点\", \"游玩时间\", \"\", false], [1, \"景点\", \"名称\", \"\", true], [2, \"餐馆\", \"名称\", \"拿渡麻辣香锅(万达广场店)\", false], [2, \"餐馆\", \"评分\", \"\", false], [2, \"餐馆\", \"营业时间\", \"\", false], [3, \"酒店\", \"价格\", \"400-500元\", false], [3, \"酒店\", \"评分\", \"4.5分以上\", false], [3, \"酒店\", \"周边景点\", [], false], [3, \"酒店\", \"名称\", \"\", false]]",
"goal": "[[1, \"景点\", \"门票\", \"免费\", false], [1, \"景点\", \"评分\", \"5分\", false], [1, \"景点\", \"地址\", \"\", false], [1, \"景点\", \"游玩时间\", \"\", false], [1, \"景点\", \"名称\", \"\", false], [2, \"餐馆\", \"名称\", \"拿渡麻辣香锅(万达广场店)\", false], [2, \"餐馆\", \"评分\", \"\", false], [2, \"餐馆\", \"营业时间\", \"\", false], [3, \"酒店\", \"价格\", \"400-500元\", false], [3, \"酒店\", \"评分\", \"4.5分以上\", false], [3, \"酒店\", \"周边景点\", [], false], [3, \"酒店\", \"名称\", \"\", false]]",
"sys_usr": "[43, 18]",
"sys_state": "",
"sys_state_init": ""
}
# 使用最基础的 RAG
python main.py --function use_rag
# 使用调度器进行RAG类型选择
python main.py --function rag_dispatcher --rag_type self_rag
python main.py --function train
config.py 中配好 REWARD_MODEL_PATHcd /root/autodl-tmp/models
huggingface-cli download --resume-download OpenAssistant/reward-model-deberta-v3-large-v2 --local-dir reward-model-deberta-v3-large-v2
python -m src.finetune.ppo_train_from_scratch
python -m src.finetune.ppo_trainer
python -m src.finetune.dpo_trainer
python -m src.finetune.grpo_trainer
src/ 目录下.src/ 的目录结构:src:
data:
- processed_data
- data_augmentation.py
- data_preprocessor.py
- crosswoz-sft:
- ...
- travel_qa:
- ...
- init.py
configs:
- config.py
- ds_config.py
agents:
- travel_knowledge:
- tour_pages
- tour_pdfs
- agent.py
- bm25.py
- tools.py # 各种 Executors: google,weather, transportation; 以及 ToolDispatcher
- zhipuAPI.py
- prompt_template.py
- chat_pdf.py
- rag.py
- mem_walker.py
- self_rag.py
- corrective_rag.py # 现在还没写好这个,别跑!
- rag_dispatcher.py
finetune:
- dpo_trainer.py
- sft_trainer.py # SFTTrainer
- ppo_trainer.py
- grpo_trainer.py
- multi_task_trainer.py
- __init__.py
pretrain:
- pretrain.py
- init.py
models:
- qwen2
- modeling_qwen2.py
- configuration_qwen2.py
- tokenization_qwen2.py
- dola_decode.py
- model.py # TravelAgent类所在的位置
- init.py
ui:
- app.py
- mindmap.py
- init.py
data:
- 各种数据集
utils.py
configs:
- config.py
- init.py
src/agents/agent.pyimage 文件夹中找你想要的结果

![]() | ![]() | ![]() |
| 图1 | 图2 | 图3 |

运行结果 part1

运行结果 part2

运行结果 part3





Epoch Rouge1 Rouge2 RougeL BLEU
we refer to many other projects when building this project.
Dataset Citation:
@inproceedings{zhu2020crosswoz,
title={CrossWOZ: A Large-Scale Chinese Cross-Domain Task-Oriented Dialogue Dataset},
author={Zhu, Qi and Zhang, Zheng and Fang, Yan and Li, Xiang and Takanobu, Ryuichi and Li, Jinchao and Peng, Baolin and Gao, Jianfeng and Zhu, Xiaoyan and Huang, Minlie},
booktitle={Transactions of the Association for Computational Linguistics},
year={2020},
url={https://arxiv.org/abs/2002.11893}
}
@misc{travel_agent_qwen2_rlhf,
author = {NJUxlj},
title = {Travel-Agent-based-on-Qwen2-RLHF},
year = {2025},
howpublished = {\url{https://github.com/NJUxlj/Travel-Agent-based-on-Qwen2-RLHF.git}},
note = {A travel agent fine-tuned using SFT, DPO, PPO, and GRPO with a traveling Q\&A dataset. Includes mindmap generation and LangChain integration.}
}