Telegram community assistant backed by OriginTrail DKG memory. TRACaPlot helps communities save and find useful answers, updates, decisions, milestones, and notes without interrupting group conversation.
It uses Telegram long-polling, SQLite working memory, OpenClaw DKG adapter, Shared Working Memory writes, and silent-by-default group behaviour.
| Loop | Goal | Status |
|---|---|---|
| 1 | Foundation & DKG connection | Complete |
| 2 | Core memory & querying | Complete |
| 3 | Trust, settings & admin controls | Complete |
| 4 | UX polish & memory viewer | Complete |
| 5 | Production hardening | Planned |
See docs/LOOP.md for the active loop log.
- Polls Telegram with TRACaBot-style offset/idempotency
- Stays silent in groups unless a user issues an explicit command
- Heuristically extracts Conversation Artefacts from group messages
- Publishes artefacts to DKG v10 Shared Working Memory (
createKnowledgeAsset+ SWM) - Presents a compact
/startand/askpublic command picker; advanced actions remain available through inline menus - Edits one inline menu message during navigation and provides a close action
- Supports compatibility commands
/help,/status,/recent,/teach, and admin-only/settings - Configures Telegram bot name, short description, full description, and scoped command lists on startup
- Persists per-chat observation, recap, and topic-filter settings in SQLite
- Awards light local trust points after accepted DKG publication
- Sends no recaps by default; admin-enabled daily/weekly recaps use chat-scoped DKG memory
- Serves an optional localhost-only, read-only web viewer for recent DKG artefacts
cd /root/tracaplot
cp .env.example .env # then fill TELEGRAM_BOT_TOKEN + TRACAPLOT_DKG_PSEUDONYM_KEY
npm test
npm run demo # publish sample artefacts + query them back
npm start # run the bot
npm run viewer # browse read-only memory at http://127.0.0.1:4187Use teach flow in private chat:
/teach What is a Context Graph? | A named DKG space where agents share structured knowledge.
Submission stays in local SQLite Working Memory and never appears in /recent, /ask, or web viewer. A user listed by numeric Telegram ID in TRACAPLOT_ADMINS may review and promote same text:
/teach What is a Context Graph? | A named DKG space where agents share structured knowledge. --publish
Published copy enters DKG Shared Working Memory with provenance user_teach. Group /teach only returns private-chat guidance; passive group traffic remains silent.
Start viewer separately from bot:
cd /root/tracaplot
npm run viewerOpen http://127.0.0.1:4187. Viewer only accepts GET, returns an allowlisted artefact shape, and keeps DKG auth token server-side. Defaults bind loopback only. Use an authenticated reverse proxy before exposing it beyond localhost; do not bind publicly without access controls.
Viewer variables:
TRACAPLOT_VIEWER_HOST- default127.0.0.1TRACAPLOT_VIEWER_PORT- default4187; use0for an ephemeral test port
Critical variables (see .env.example):
TELEGRAM_BOT_TOKEN—@TRACaPlot_bottokenTRACAPLOT_CONTEXT_GRAPH— defaulttracaplotDKG_NODE_URL— local daemon (defaulthttp://127.0.0.1:9200)OPENCLAW_DKG_ADAPTER_PATH— OpenClaw adapter entrypointTRACAPLOT_DKG_PSEUDONYM_KEY— ≥32 bytes for identity pseudonymizationTRACAPLOT_SILENT_BY_DEFAULT=true— never spam groupsTRACAPLOT_ADMINS— comma-separated numeric Telegram user IDs allowed to publish reviewed teachings
src/
config.js # env + defaults
store.js # SQLite WM, polling offsets, chat settings
artefacts.js # Conversation Artefact schema + heuristic extractor
dkg-client.js # Context Graph ensure + SWM publish + SPARQL query
telegram.js # silent polling bot
index.js # composition root
viewer/
server.js # loopback read-only DKG API + static server
index.html # responsive memory trail UI
{
"event_type": "conversation_artefact",
"payload": {
"artefact_kind": "qa | announcement | decision | timeline | note",
"title": "...",
"summary": "...",
"question": "...",
"answer": "...",
"topics": ["dkg", "origintrail"],
"confidence": 85,
"lifecycle_stage": "shared_memory",
"provenance": "telegram_observation",
"source_message_text_excerpt": "redacted excerpt"
}
}Ontology namespace: https://tracaplot.org/ontology#
- Silent by default in groups
- No auto-moderation / bans (that is TRACaBot’s job)
- DKG shared triples use HMAC pseudonyms for identities
- Optional recaps only when admins enable them (Loop 3)
/teachdrafts stay private; only configured bot admins can publish them- Viewer exposes no DKG credentials and binds to loopback by default
sudo cp docs/tracaplot.service.example /etc/systemd/system/tracaplot.service
sudo systemctl daemon-reload
sudo systemctl enable --now tracaplot