KYCIS SDK Docs
Event System

Event System Overview

Event architecture from SDK to backend

Event Architecture

Two different "event" concepts in KYCIS:

ConceptWhereMeaning
Ingestion EventPOST /v1/events body field eventAnalytics + session merge rules
Activity StreamGET /api/activityitems[].kindDashboard grouping bucket

Event Flow

SDK Event

POST /v1/events

Backend Processing

Session Store Update

Activity Stream

Dashboard / Voice Context

Activity Stream Kinds

kindProduced WhenPayload Highlights
eventAny POST /v1/eventsFull event body + trace
schema_pushScreen schema processedSchema hash, screen id
triggerTrigger evaluationDecision, reason, signals
session_startSession startRoom, user, trace
session_stopSession stopUser, trace
reengagementWith session stopRecommended, channel, reason

Ingestion Event Types

All events require: user_id, session_id, event, timestamp

Optional shared fields: client_id, mapping_version, screen, screen_id, invoke_source, traceparent, trace_id, request_id, properties

Event Type Summary

EventSDK MethodPurpose
identityAI.setUser()User identification
error_reportedAI.trackError()Generic errors
validation_failedAI.trackValidationFailure()Field validation
component_inputAI.reportComponentInput()Redacted input hints
screen_schemaAI.registerScreenSchema()Full schema registry
screen_schema_lazyImplicitMinimal screen beacon
voice_conversation_turnVoice agentConversation telemetry

Event Processing

Backend Ingestion (POST /v1/events)

  1. Merge body trace fallbacks
  2. store.upsert_event(payload_dict)
  3. Create/update session by session_id
  4. Push to activity feed with trace

Session State Updates

Events update in-memory session:

  • latest_event — full event payload
  • screen — from payload when present
  • user_id — from event
  • last_validation_failure — from validation_failed

Context Building

Voice agent context built from:

  • Session state (screen, errors, validation history)
  • KYC knowledge base (screen aliases, rules)
  • Component input hints (redacted)
  • Static system prompt

Trace Correlation

All events carry trace headers:

traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01
X-Request-ID: req-123-456

Activity stream includes trace object for correlation.

Event Frequency Guidelines

EventFrequencyDebounce
identityOnce per user session
screen_schemaOnce per schema versionLazy push on navigation
component_inputOn meaningful changes300-500ms recommended
validation_failedOn each failureImmediate
error_reportedOn each errorImmediate

Validation

Verify events in /api/activity:

  • Check kind matches expected
  • Verify payload.event type
  • Confirm trace fields present
  • Review session continuity

On this page