You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Revise README and related docs to position KalamDB as an agent-native realtime backend with a single SQL API and WebSocket live subscriptions. Adds an "Agent-Native Workflow" section, clarifies frontend/backend use of the same SQL model (including EXECUTE AS USER), and updates docker README and repo README language to highlight one SQL tool, per-user isolation, and live rows. The chat example README is updated to remove the "CRUD layer" and includes guidance for extending the sample into a human-approval workflow.
KalamDB is a SQL-first realtime backend for agent-native apps.
9
+
Agents and frontends use the same backend directly: SQL over HTTP for reads and writes, live query rows over WebSocket for subscriptions. USER tables, auth, and `EXECUTE AS USER` keep access policy-scoped instead of exposing broad backend access.
KalamDB is a SQL-first realtime state database for AI agents, chat products, and multi-tenant SaaS.
25
-
It combines SQL execution, live subscriptions, pub/sub streams, and hot/cold storage in one Rust runtime.
26
31
27
-
Supported SDKs: [TypeScript/JavaScript](https://www.npmjs.com/package/@kalamdb/client) and [Dart/Flutter](https://pub.dev/packages/kalam_link).
32
+
SDKs: [TypeScript/JavaScript](https://www.npmjs.com/package/@kalamdb/client) and [Dart/Flutter](https://pub.dev/packages/kalam_link).
28
33
29
34
PostgreSQL extension Docker image: [jamals86/pg-kalam](https://hub.docker.com/r/jamals86/pg-kalam) with `pg_kalam` preinstalled.
30
35
31
-
> Frontend clients can execute SQL directly against KalamDB. This is not only a backend database layer.
36
+
> Frontend clients can execute SQL directly against KalamDB. You keep one SQL API plus live subscriptions instead of maintaining a custom REST or GraphQL CRUD layer for every agent workflow.
32
37
33
-
## Frontend-First SQL Execution
38
+
## One SQL Tool, Live Rows
34
39
35
-
To avoid confusion: KalamDB is designed for both frontend and backend SQL execution.
40
+
KalamDB is designed for both frontend and backend SQL execution.
36
41
37
-
- Frontend (web/mobile/desktop): run SQL for user-scoped reads/writes and realtime subscriptions.
38
-
- Backend/workers: run automation, cross-tenant system jobs, and service workflows.
39
-
- Same SQL model on both sides: `SELECT`, `INSERT`, `UPDATE`, `DELETE`, `SUBSCRIBE TO`, `CONSUME`, `ACK`.
42
+
- Agents and workers use one SQL tool plus the current schema instead of dozens of narrow CRUD tools.
43
+
- Frontends run the same backend directly for user-scoped reads, writes, and live row updates.
44
+
- Queries and writes go through the HTTP SQL API; realtime subscriptions reuse the shared WebSocket connection.
45
+
- Service code can act on behalf of a user with `EXECUTE AS USER` when a workflow needs a trusted handoff.
40
46
41
-
This is what lets chat UIs and agent apps read/write state directly and receive live updates without adding separate polling or fanout infrastructure.
47
+
This is what lets chat UIs, support agents, approval flows, and other product workflows share one data plane without separate polling, sync, or fanout infrastructure.
42
48
43
49
## Why KalamDB
44
50
45
-
- Frontend-direct SQL and realtime subscriptions, so web and mobile apps can read, write, and stay in sync without a separate sync layer.
46
-
- Multi-tenant isolation by default, with the same SQL returning user-scoped data safely across frontend and backend clients.
51
+
- One SQL tool for agents, so app workflows can read and write allowed data without a custom CRUD surface for every action.
52
+
- Live UI by default, with frontend-direct SQL and realtime subscriptions keeping web and mobile apps in sync without a separate sync layer.
53
+
- Per-user isolation by default, with the same SQL returning user-scoped data safely across frontend and backend clients.
47
54
- Built-in authentication and authorization with Basic auth, JWT, OAuth 2.0 (Google Workspace, GitHub, Azure AD), and RBAC.
48
55
- Unified application primitives: SQL tables, live queries, pub/sub topics, consumer groups, and file attachments in one runtime.
49
56
- Hybrid storage engine tuned for product workloads: RocksDB for fast active writes, Parquet for compressed historical storage and analytics.
@@ -52,6 +59,16 @@ This is what lets chat UIs and agent apps read/write state directly and receive
52
59
- Distributed clustering with Multi-Raft replication and failover for resilient production deployments.
53
60
- First-party tooling for operators and app teams: Admin UI, `kalam` CLI, and official TypeScript and Dart SDKs.
54
61
62
+
## Agent-Native Workflow
63
+
64
+
- Read current app state with `SELECT` from the same backend your product already uses.
65
+
- Write drafts, tasks, approvals, or replies into normal app tables with SQL.
66
+
- Subscribe the frontend to pending rows live over WebSocket.
67
+
- Commit final writes through the same backend path, including `EXECUTE AS USER` when a trusted service acts for a user.
68
+
- Let the UI update from row changes instead of a second sync system.
69
+
70
+
See [examples/chat-with-ai](examples/chat-with-ai/README.md) for the base live agent loop already in the repo.
Copy file name to clipboardExpand all lines: docker/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# KalamDB Docker Guide
2
2
3
-
KalamDB is a SQL-first realtime state database for AI agents, chat products, and multi-tenant SaaS. This directory contains the Docker image definitions and compose setups used to run KalamDB as a single node or a 3-node cluster.
3
+
KalamDB is a SQL-first realtime backend for agent-native apps. Agents and frontends share one HTTP SQL API for reads and writes plus WebSocket live subscriptions, with USER tables and auth keeping access policy-scoped. This directory contains the Docker image definitions and compose setups used to run KalamDB as a single node or a 3-node cluster.
Copy file name to clipboardExpand all lines: examples/chat-with-ai/README.md
+16-3Lines changed: 16 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
-
# Chat With AI, Without the Extra Product Surface
1
+
# Chat With AI, Without the CRUD Layer
2
2
3
-
This example keeps only the parts that matter for the SDK:
3
+
This example shows the core KalamDB product story in code:
4
4
5
5
- browser writes into a shared table
6
6
- a topic mirrors those inserts
7
7
-`@kalamdb/consumer``runAgent()` consumes the topic
8
8
- the agent writes a reply row back into the same table
9
9
- every open browser tab updates through one live SQL subscription
10
10
11
-
There is no Keycloak setup, no multi-theme UI system, and no service framework around the worker.
11
+
There is no custom REST or GraphQL CRUD layer between the app, the worker, and the database. There is also no extra service framework around the worker.
12
12
13
13
## Quick start
14
14
@@ -29,6 +29,19 @@ When you send a message, KalamDB does all of this:
29
29
4. inserts the assistant reply
30
30
5. pushes both rows into every subscribed browser
31
31
32
+
This is the base pattern for agent-native product flows: one backend for SQL reads and writes, one live subscription path for the UI, and no separate sync layer in between.
33
+
34
+
## Extend It to Human Approval
35
+
36
+
If you want the stronger human-in-the-loop story, extend this sample by changing the write path instead of adding a separate API layer:
37
+
38
+
1. write proposed replies into `chat_demo.agent_drafts` instead of final `chat_demo.messages`
39
+
2. subscribe the browser to pending drafts with a second live SQL query
40
+
3. let the user approve or reject with a normal SQL `UPDATE`
41
+
4. on approval, write the final assistant message through the same backend, optionally with `EXECUTE AS USER`
42
+
43
+
That turns the sample into the approval workflow the README now describes, while keeping the same one-tool agent model.
0 commit comments