Developers
Chatbot Platform
Conversation infrastructure, session management, channel adapters, and message history.
Chatbot Platform
The conversation layer that powers Zen. Multi-session support, message persistence, streaming, and document attachment.
Features
| Feature | Detail |
|---|---|
| Multi-Session | Unlimited concurrent sessions per user |
| Auto-Titles | Sessions auto-named based on first message |
| Message History | Full conversation log with pagination |
| Streaming | Server-Sent Events (SSE) for real-time responses |
| File Attachments | PDF, JPG, PNG per message (scoped to session) |
| Session Export | PDF, Markdown, JSON formats |
| Webhook Callbacks | Notify external systems on session events |
Session Lifecycle
CREATE ──► ACTIVE ──► PAUSED ──► CLOSED
│ │ │ │
│ │ │ ▼
│ │ │ Archived (90 days)
│ │ │
│ ▼ │
│ Message sent ─────┘
│ │
│ ▼
└────► Document uploaded
API Surface
| Method | Endpoint | Purpose |
|---|---|---|
POST |
/api/v1/chat/ |
Create session |
GET |
/api/v1/chat/ |
List sessions |
POST |
/api/v1/chat/{id}/messages |
Send message |
GET |
/api/v1/chat/{id}/messages |
Get history |
POST |
/api/v1/chat/{id}/documents |
Attach document |
POST |
/api/v1/chat/invoke/stream |
SSE streaming |
DELETE |
/api/v1/chat/{id} |
Close session |
Document Attachment Flow
- User attaches PDF to chat message
- File uploads to session-scoped S3 prefix
- KB ingestion pipeline indexes document to session-specific OpenSearch index
- RAG agent retrieves from session index only
- Document is invisible outside the session
Streaming Protocol
Client opens SSE connection to /api/v1/chat/invoke/stream
Server sends:
data: {"type": "token", "content": "Your"}
data: {"type": "token", "content": " portfolio"}
data: {"type": "token", "content": " shows..."}
data: {"type": "citation", "source": "CAS_2026_Q1.pdf", "page": 3}
data: {"type": "done"}