Skip to content

feat(cloud): opt-in chat capture in @ratel-ai/cloud (RAT-292) + ADR-0014#84

Draft
kayraucklnc wants to merge 3 commits into
kayra/rat-307-cloud-packagefrom
kayra/rat-292-chat-message-collection-in-ratel-aicloud
Draft

feat(cloud): opt-in chat capture in @ratel-ai/cloud (RAT-292) + ADR-0014#84
kayraucklnc wants to merge 3 commits into
kayra/rat-307-cloud-packagefrom
kayra/rat-292-chat-message-collection-in-ratel-aicloud

Conversation

@kayraucklnc

@kayraucklnc kayraucklnc commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Should be merged after #82

Stacked on #82 (RAT-307).

  • ADR-0014: chat ingestion contract — POST /api/v1/chats, content-hash dedup → pseudo-sessions (id-less prefix-probe), opt-in capture + cloud-side redaction, manual server-side extraction. Extends ADR-0013; core stays PII-free + network-free.
  • @ratel-ai/cloud: recordMessages()/trackConversation(), second endpoint + separate buffer, opt-in (captureChats / RATEL_CAPTURE_CHATS), server-only dedup, never throws. 24 cloud tests; @ratel-ai/sdk 68 unchanged. No Rust core change.

Python parity DEFERRED to post-merge (needs #81's exporter + this TS work on one base).

…acy (Proposed)

POST /api/v1/chats; content-hash chain dedup → pseudo-sessions with id-less
prefix-probe inference; opt-in capture + cloud-side redaction; manual server-side
extraction. Extends ADR-0013; core stays PII-free + network-free.
…/chats

recordMessages(conversationId, messages, opts?) and trackConversation(id)
ship conversation turns to POST {host}/api/v1/chats (ADR-0014), a second
endpoint beside /events on its own buffer — same batching, retry/backoff,
never-throws, and process-exit flush. Off by default; gated by captureChats
or RATEL_CAPTURE_CHATS and only ships with an api key (privacy). Wire body is
snake_case {conversation_id, messages:[{role,content,seq,occurred_at?}],
metadata?}; seq defaults to array index; v1 ships the full array, server dedups.
@kayraucklnc kayraucklnc marked this pull request as draft July 7, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant