Skip to content

Commit d9b59f4

Browse files
committed
Emphasize agent-native, one-SQL API in docs
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.
1 parent 1e9be9c commit d9b59f4

4 files changed

Lines changed: 51 additions & 20 deletions

File tree

README.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
<img src="docs/images/kalamdb_logo.png" alt="KalamDB logo" width="260" />
33
</p>
44

5+
6+
Give AI agents one SQL tool to your app data.
7+
8+
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.
10+
11+
512
<p align="center">
613
<a href="https://www.rust-lang.org/"><img src="https://img.shields.io/badge/rust-1.92%2B-orange.svg" alt="Rust" /></a>
714
<a href="https://www.apache.org/licenses/LICENSE-2.0"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="License" /></a>
@@ -21,29 +28,29 @@
2128
<a href="https://pub.dev/packages/kalam_link"><img src="https://img.shields.io/pub/v/kalam_link?label=dart%20sdk" alt="Dart SDK" /></a>
2229
</p>
2330

24-
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.
2631

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).
2833

2934
PostgreSQL extension Docker image: [jamals86/pg-kalam](https://hub.docker.com/r/jamals86/pg-kalam) with `pg_kalam` preinstalled.
3035

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.
3237
33-
## Frontend-First SQL Execution
38+
## One SQL Tool, Live Rows
3439

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.
3641

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.
4046

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.
4248

4349
## Why KalamDB
4450

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.
4754
- Built-in authentication and authorization with Basic auth, JWT, OAuth 2.0 (Google Workspace, GitHub, Azure AD), and RBAC.
4855
- Unified application primitives: SQL tables, live queries, pub/sub topics, consumer groups, and file attachments in one runtime.
4956
- 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
5259
- Distributed clustering with Multi-Raft replication and failover for resilient production deployments.
5360
- First-party tooling for operators and app teams: Admin UI, `kalam` CLI, and official TypeScript and Dart SDKs.
5461

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.
71+
5572
## Feature & Status
5673

5774
| Feature | Status | Feature | Status |

docker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# KalamDB Docker Guide
22

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.
44

55
The Docker image ships with both binaries:
66

docker/REPO-README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# 🚀 KalamDB on Docker Hub
22

3-
KalamDB is a SQL-first realtime state database for AI agents, chat products, and multi-tenant SaaS.
3+
KalamDB is a SQL-first realtime backend for agent-native apps.
4+
Give AI agents one SQL tool to your app data, while your frontend subscribes to live rows from the same backend.
45

56
It combines in one runtime:
67

7-
- ⚡ SQL reads and writes
8-
- 🔄 Live subscriptions
8+
-One SQL API for reads and writes
9+
- 🔄 Live subscriptions over WebSocket
910
- 📡 Pub/sub streams
1011
- 🔐 Built-in auth with JWT support
11-
- 🧱 Multi-tenant isolation
12+
- 🧱 Per-user isolation with policy-scoped access
1213
- 💾 Hot storage on RocksDB
1314
- 📦 Cold storage on Parquet
1415
- 🛠️ Included CLI tools in the image

examples/chat-with-ai/README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Chat With AI, Without the Extra Product Surface
1+
# Chat With AI, Without the CRUD Layer
22

3-
This example keeps only the parts that matter for the SDK:
3+
This example shows the core KalamDB product story in code:
44

55
- browser writes into a shared table
66
- a topic mirrors those inserts
77
- `@kalamdb/consumer` `runAgent()` consumes the topic
88
- the agent writes a reply row back into the same table
99
- every open browser tab updates through one live SQL subscription
1010

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.
1212

1313
## Quick start
1414

@@ -29,6 +29,19 @@ When you send a message, KalamDB does all of this:
2929
4. inserts the assistant reply
3030
5. pushes both rows into every subscribed browser
3131

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.
44+
3245
## Test it
3346

3447
Run `npm test`.

0 commit comments

Comments
 (0)