35 lines
1.5 KiB
Markdown
35 lines
1.5 KiB
Markdown
---
|
||
title: "TopicRouting"
|
||
type: concept
|
||
tags: [routing, context, multi-channel]
|
||
sources: [multi-channel-assistant]
|
||
last_updated: 2026-04-27
|
||
---
|
||
|
||
## Definition
|
||
Topic Routing(话题路由)是一种通过消息平台的话题/线程(Topic)机制,在单一入口内实现多上下文隔离的设计模式。不同话题对应不同的工作流或知识域,用户无需切换 app 或启动多个 bot,只需要在对应话题中发起请求即可。
|
||
|
||
## Core Mechanism
|
||
1. **平台支持**:Telegram Topics、Discord Threads、Slack Channels 等都支持话题隔离
|
||
2. **规则映射**:Prompt 或配置层定义"话题 → 工具/知识库/工作流"的映射规则
|
||
3. **上下文注入**:AI Agent 根据当前所在话题注入对应的 system prompt 和工具集
|
||
|
||
## Example: [[multi-channel-assistant]]
|
||
```
|
||
config → 系统设置和调试
|
||
updates → 状态通知和日历提醒
|
||
video-ideas → 内容创意流水线
|
||
personal-crm → 联系人查询和会面准备
|
||
earnings → 财务追踪
|
||
knowledge-base → RAG 知识库查询
|
||
```
|
||
|
||
## Related Concepts
|
||
- [[Intent-Classification]] — 路由前先分类用户意图
|
||
- [[Agent-Routing-Rules]] — 基于规则的路由决策
|
||
- [[Context-Passing]] — 话题切换时的上下文传递
|
||
|
||
## Connections
|
||
- [[multi-channel-assistant]] ← implements ← [[TopicRouting]](核心实现模式)
|
||
- [[PhoneBasedPersonalAssistant]] ← alternative_to ← [[TopicRouting]](电话是另一种单入口路由方式)
|