Use Case 12: Copilot + Custom Data lookup
Optional track — not required to complete the basic, advanced, or capstone level. Take it after Use Case 13 or if your project uses Copilot.
Required permissions and access
| Module / setting | Why you need it |
|---|---|
| Scenario Builder | Main bot (routing) + Copilot bot |
| Fast Line Pro | Categorizer for the catalog |
| Custom Data | products model and seed data |
| Settings → Bots | Second bot for Copilot (or process sections) |
| Runs / Chat preview | Self-check lookup found / not found |
Business context
The customer writes free text (“I want a warrior from the North”). The Copilot bot classifies the request, looks up a record in Custom Data, and returns the result. The main customer bot only routes (“Catalog” button), and the AI-heavy logic lives in Copilot.
Expected result
- A separate Copilot bot (or process section) with categorizer
- Custom Data
products: fields name, category, faction, price - Categorizer → filters → lookup in CD → MessageKeyboard with the result
- Edges found / not found / error — all handled
- Understanding: categorizer in Copilot, not in the main client bot
Architecture
[Main training bot]
MessageKeyboard "Catalog" → routing to Copilot (call / process)
[Copilot bot]
WaitForInput (query) → action_fastline_pro (categorizer)
→ Router (valid category/faction)
→ custom_modules__get / filter
├─ found → MessageKeyboard (name, price)
├─ not_found → "Not found" + optionally handoff
└─ error → error message
| Bot type | Role |
|---|---|
| Main | Customer writes in the channel; menu buttons |
| Copilot | AI + CD lookup |
| Macro (Use Case 8) | Initiator is the operator, not the customer |
Step-by-step implementation
Step 0. Custom Data — products model
- Custom Data → create the
productsmodel. - Fields:
name,category,faction,price. - Import the seed from products-training.csv or add 5–10 rows manually.
| Field | Example |
|---|---|
| name | Geralt of Rivia |
| category | warrior |
| faction | north |
| price | 120 |
The model alias products must exactly match module_name in the lookup action.
Step 1. Copilot bot and categorizer
- Settings → Bots → create a bot “Training Copilot” (or use process sections per Copilot docs).
- Fast Line Pro → Chatbot “Training Catalog Categorizer”.
- Prompt: section Use Case 12 (products catalog) from categorizer-training.txt.
Categorizer output — JSON, for example: {"faction":"north","category":"warrior"}.
Test in Fast Line Pro separately before the scenario.
Step 2. WaitForInput — customer query
| Parameter | Value |
|---|---|
| messageText | “Describe who you are looking for (class, faction)” |
| outputVariable | catalog_query |
Edges: → action_fastline_pro.
Step 3. Action — categorizer
| node_params | Value |
|---|---|
agent_name |
Training Catalog Categorizer |
user_input |
{{catalog_query}} |
save_response |
catalog_filters |
Edges: main → parse / Router; fallback → “Please clarify your query.”
Step 4. Lookup in Custom Data
Use custom_modules__get or a filter action with parameters for your instance:
| node_params (example) | Value |
|---|---|
module_name |
products |
| filters | category, faction from categorizer |
Edges (required):
| Edge | Where |
|---|---|
| success / found | MessageKeyboard: {{name}} — {{price}} |
| not found | “Nothing found for your query” |
| error | “Search error. Try again later.” |
Step 5. Routing from the main bot
In the main training bot (capstone):
| Button | Action |
|---|---|
| “Catalog” | Call Copilot process / call_node per Copilot overview |
The main bot does not contain the categorizer — only routing.
Troubleshooting
| Symptom | What to check |
|---|---|
| “Where is the categorizer?” | In the Copilot bot, not in the client bot |
| Empty lookup | module_name = CD alias; filters match the seed CSV |
| Categorizer JSON does not parse | Prompt — one JSON line; check Fast Line Pro |
| Copilot is not called | Routing from the main bot; process / bot name in call |
Self-check (Runs)
Independent task
Add a handoff edge to an operator if not found happens twice in a row (counter in state or constants).
Reference links
Related optional: AI catalog — lookup in the same bot without Copilot.