Chat Quickstart (Docs-Only)
This page mirrors the smaller examples/chat-with-ai flow using only documented @kalamdb/client and @kalamdb/consumer APIs:
createClient,Auth.basicquery,livecreateConsumerClient(),runConsumer()
This path is for local development without external auth setup.
Prerequisites
- Node.js
>= 18 - running KalamDB server
- a user that can run SQL and consume topic messages
Install:
1) Create a client
2) Apply chat schema + topic
3) Start the worker with runConsumer()
4) Subscribe in the chat client
Use live() so the UI always receives the latest materialized row set.
If you switch this table to WITH (TYPE = 'USER'), the same query text still works for every user and KalamDB will only return that authenticated user’s rows.
Insert a user message:
5) Cleanup
Next
Last updated on