Runnable CLI that connects to DNotifier, seeds a support knowledge base, and chats with a production-style support agent.
- Python 3.9+
- DNotifier app with AI enabled — app.dnotifier.com
DNOTIFIER_APP_IDandDNOTIFIER_SECRET
cd dnotifier-examples/use-cases/customer-support-agent/python
cp .env.example .env
# edit .env — set DNOTIFIER_APP_ID and DNOTIFIER_SECRET
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
python main.pyExpected startup:
Connected to DNotifier (AI support agent ready)
Seeding sample customer-support knowledge base…
Indexed: Password reset …
…
Ready. user_id=support-agent-demo use_knowledge_base=True session_id=(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 (send_ai) |
/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 viaadd_knowledge_base - Opens an interactive prompt
prompts.py SUPPORT_SYSTEM_PROMPT + SUPPORT_KNOWLEDGE_PROMPT
knowledge_base.py add_knowledge_base + seed_support_knowledge_base
support_agent.py ask_support / fetch_support_history
client.py DNotifier client factory
main.py CLI entry
await add_knowledge_base(notifier, sender_id, KnowledgeDoc(
title="Refunds and returns",
content="Return window: 30 days…",
type="policy",
record_id="support-faq-refunds", # required by Python SDK
))
result = await ask_support(
notifier,
question,
sender_id=sender_id,
session_id=session_id,
use_knowledge_base=True,
)See the use-case README and DNotifier product docs.