feature/custom-card-feedback-actions
DobotAI Platform
DobotAI is the external enterprise integration layer for official WeKnora. It does not import WeKnora packages, modify WeKnora source, or access the WeKnora database.
Current milestone: channel-bound Agent QA core.
Implemented:
- official
POST /api/v1/sessionsadapter; - official
POST /api/v1/agent-chat/:session_idadapter; - fail-closed SSE parsing for
references,answer,error, and terminaldone; - per-channel/per-conversation Agent binding;
- long-lived direct-user sessions;
- shared-group sessions, with optional group+user policy;
- external-message idempotency;
- independent PostgreSQL session/turn storage;
- authenticated internal
POST /v1/qaingress endpoint. - DingTalk Stream text ingress (official SDK) wired into
cmd/dobotai.
DingTalk channel (Stream, text only)
- Uses the official DingTalk Stream SDK (
dingtalk-stream-sdk-go); no public webhook endpoint is exposed. - Text messages only for now. Images, OpenAPI fallback, and card replies are not implemented yet.
- Group chats are handled only when the bot is @-mentioned; other group messages are ignored.
- Sessions: direct chats use one long-lived session per user; group chats share one session per group (default
sharedpolicy). - Replies are sent via the callback's
sessionWebhook, which is fail-closed: onlyhttpsURLs on*.dingtalk.com(port 443, no redirects) are accepted. - Required env vars to enable (all three or none):
DINGTALK_CLIENT_ID,DINGTALK_CLIENT_SECRET,DOBOTAI_TENANT_KEY. Partial configuration is a fatal startup error.
WeKnora baseline
Target policy: latest stable official Release/Tag. The newest locally fetched stable tag is v0.6.3. Online GitHub verification is pending because DNS/proxy access was unavailable during initialization.
Run
- Create an independent PostgreSQL database named
dobotai. - Apply
db/migrations/000001_core.up.sqlto that database only. - Copy
.env.exampleto a local.envand supply secrets outside Git. - Export the variables and run:
go run ./cmd/dobotai
Health check:
curl http://127.0.0.1:8090/healthz
Internal QA request:
curl -X POST http://127.0.0.1:8090/v1/qa \
-H "Authorization: Bearer $DOBOTAI_INGRESS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"tenant_key":"default",
"channel":"dingtalk",
"conversation_type":"direct",
"external_user_id":"user-1",
"external_message_id":"message-1",
"query":"hello"
}'
Hard boundaries
- No WeKnora source modifications.
- No custom WeKnora tables or columns.
- No direct WeKnora database access.
- No private WeKnora package imports.
- All compatibility logic stays in
internal/weknora. - Business data stays in DobotAI PostgreSQL.
- Redis will be used only for queues, retries, idempotency leases, and temporary state.
See docs/architecture.md for ownership and migration decisions.
Description
Languages
Go
96.3%
Shell
2%
Python
1.6%