Files
isphere-ai-bridge/docs/design.md
2026-07-09 22:02:26 +08:00

63 lines
1.9 KiB
Markdown

# iSphere AI Bridge Design
## Objective
Make iSphere messages usable by AI digital employees without rebuilding the full communication platform.
## First POC
The first POC reads recent messages, converts them into a normalized JSON model, generates draft replies, and records evidence. Send/file capabilities are part of the staged MCP tool roadmap.
## Architecture
```text
iSphere / MockCloud / existing bridge
-> source connector
-> message adapter
-> AI draft worker
-> human review
-> evidence log
```
## Source Connectors
1. Local data connector: reads local databases, logs, or caches in read-only mode.
2. Existing bridge connector: talks to `OpenClawBridge` or `XmppBridgeService` when available.
3. UI/RPA connector: wraps the desktop client with limited actions.
4. Network connector: wraps discovered HTTP/SOAP/XMPP/WebSocket APIs when validated.
## Normalized Message Model
```json
{
"message_id": "string",
"conversation_id": "string",
"conversation_name": "string",
"conversation_type": "direct|group|system",
"sender_id": "string",
"sender_name": "string",
"content_type": "text|image|file|rich|notify",
"content_text": "string",
"attachments": [],
"created_at": "ISO-8601 or Unix ms",
"received_at": "ISO-8601 or Unix ms",
"source": "local-db|log|plugin|xmpp|http|rpa|mock",
"raw_ref": "path/table/packet/window reference"
}
```
## Write Execution Model
- Read access and draft generation can be automated in test scope.
- Send/file tools are staged after source discovery and connector selection.
- Every write action records target, content or file hash, timestamp, operator, and connector.
## Verification
The project is successful when it can:
1. Find at least one stable authorized message source.
2. Extract recent messages into normalized JSON.
3. Generate a reply draft.
4. Produce an evidence report with exact paths, commands, and limits.