cd dnotifier-examples/use-cases/internal-knowledge-assistant/dart
cp .env.example .env
dart pub get
dart run bin/main.dartThen ask a handbook question, or try /dm hello / /history / /quit.
To watch messages flow both ways, open a second terminal with the ids swapped in that folder's .env (or export them before running).
Input is read from an async stdin stream, so inbound messages print while you type.
| Command | Action |
|---|---|
| (any text) | sendAI with useKnowledgeBase |
/dm <text> |
send over the ws client |
/to <userId> |
Change teammate |
/history |
fetchChatHistory |
/share <question> |
Ask, then send the answer to the teammate |
/seed |
Index the sample handbook |
/add Title | content |
addDocument |
/list |
listDocuments |
/search <query> |
search — raw retrieval hits |
/kb on|off |
Toggle grounding |
/reset |
New session id |
/quit |
Exit |
| File | Purpose |
|---|---|
lib/clients.dart |
ws client + http client |
lib/knowledge_base.dart |
Handbook pages + addDocument wrapper |
lib/prompts.dart |
System + grounding prompts |
lib/assistant.dart |
sendAI, send, fetchChatHistory wrappers |
lib/env.dart |
Minimal .env loader |
bin/main.dart |
CLI |
| Var | Default | Purpose |
|---|---|---|
DNOTIFIER_APP_ID |
— | Required |
DNOTIFIER_SECRET |
— | Required |
DNOTIFIER_USER_ID |
alex |
Who you are on the realtime channel |
TEAMMATE_ID |
jordan |
Who /dm messages |
SEED_KB |
true |
Index the sample handbook on startup |
USE_KNOWLEDGE_BASE |
true |
Ground answers in the handbook |
See the use-case README.