Runnable CLI that connects to DNotifier, seeds a support knowledge base, and chats with a production-style support agent.
- Dart SDK 3.0+
- DNotifier app with AI enabled — app.dnotifier.com
DNOTIFIER_APP_IDandDNOTIFIER_SECRET
cd dnotifier-examples/use-cases/customer-support-agent/dart
cp .env.example .env
# edit .env — set DNOTIFIER_APP_ID and DNOTIFIER_SECRET
dart pub get
dart run bin/main.dartExpected startup:
Connected to DNotifier (AI support agent ready)
Seeding sample customer-support knowledge base…
Indexed: Password reset …
…
Ready. userId=support-agent-demo useKnowledgeBase=true sessionId=(new)
you>
Example session:
you> How do I reset my password?
agent> …
you> /add VIP shipping | VIP orders ship in 1 business day.
Document added: …
you> How fast is VIP shipping?
agent> …
you> /quit
| Command | Action |
|---|---|
| (any text) | Ask the support agent (sendAI) |
/seed |
Re-index sample support docs |
/add Title | content… |
Add one knowledge-base document |
/kb on / /kb off |
Toggle useKnowledgeBase |
/history |
Fetch AI history for this user |
/help |
Show commands |
/quit |
Disconnect and exit |
- Connects over HTTP with
logs: true - If
SEED_KB=true, indexes sample FAQs viaaddKnowledgeBase - Opens an interactive prompt
lib/
prompts.dart supportSystemPrompt + supportKnowledgePrompt
knowledge_base.dart addKnowledgeBase + seedSupportKnowledgeBase
support_agent.dart askSupport / fetchSupportHistory
client.dart DNotifier client factory
env.dart .env loader
bin/
main.dart CLI entry
await addKnowledgeBase(notifier, senderId, KnowledgeDoc(
title: 'Refunds and returns',
content: 'Return window: 30 days…',
type: 'policy',
recordId: 'support-faq-refunds', // required by Dart SDK
));
final result = await askSupport(
notifier,
question,
senderId: senderId,
sessionId: sessionId,
useKnowledgeBase: true,
);See the use-case README and DNotifier product docs.