v0.4.0-alpha3SQL-first database with realtime updates
Private, realtime storage for AI agents
Store messages, agent memory, embeddings, and tool logs. USER tables keep every query inside the signed-in user boundary, while `live()` streams current rows to browsers and agents in realtime. Run vector search with SQL, then keep recent data fast and move older history to cheaper storage.
1import { createClient, Auth, SeqId } from'kalam-link';23const client = createClient({4 url: 'http://localhost:8080',5 authProvider: async () => Auth.jwt('<ACCESS_TOKEN>'),6});78const resumeFrom = SeqId.from('7262216745594062848');910const stopMessages = await client.live(11`SELECT id, room, role, content, created_at12 FROM chat.messages`,13 (rows) => {14// `chat.messages` can be a USER table.15// The same query runs for every signed-in customer, but KalamDB only16// returns that caller's rows.17renderRows(rows);18 },19 {20 subscriptionOptions: {21 last_rows: 200,22 from_seq_id: resumeFrom.toJSON(),23 },24 },25);2627await client.query(28'INSERT INTO chat.messages (room, role, content) VALUES ($1, $2, $3)',29 ['main', 'user', 'hello from the browser']30);
Core Pillars
Core pillars for AI agents and chat apps
Keep each user or tenant in their own data space. Query USER tables directly, stream materialized rows in realtime, use topics for pub/sub, and move old history to object storage when you need to scale.
Live
Per-tenant isolation — no app-side filters
Every user gets a private tenant partition. The same SQL can run for every account, and USER tables still return only that caller's rows. No app-side WHERE user_id = ? glue.
See how queries run, how data is stored, and how live updates flow.
Code-First
Familiar SQL for storage, subscriptions, and handoffs
No custom language to learn. Write standard SQL to create tables, save state, and subscribe to live updates. Keep hot data on local disk and store long-term history in object storage.
kalamdb — SQL Console
CREATE TABLE agent.messages (
id BIGINT DEFAULT SNOWFLAKE_ID(),
role TEXT,
content TEXT,
user_id TEXT,
created TIMESTAMP
) WITH (TYPE='USER');
Data Flow
Live state timeline
Write state, trigger subscriptions, and sync users and agents in realtime.
Agent Writes
An agent writes memory or tool state with SQL.
KalamDB Stores
Recent data stays fast. Older history can move to object storage.
Subscribers Notified
Live updates stream over WebSocket to matching subscribers.
Agents Resume
Apps and agents continue from the latest state.
User Data Surface
Each user scope supports files, vectors, tables, and indexes
KalamDB is more than chat messages. Inside each user space, store tables, vectors, and file records so your agents can find what they need fast.
Files
Store file metadata, ownership, and processing status in user tables.
Vectors
Store embeddings in SQL tables and rank similar rows with vector search.
Tables
Model messages, tool calls, checkpoints, and your app data as SQL tables.
Indexes
Add indexes for fast lookups as your agent workload grows.
Use Cases
Built for secure, multi-tenant agent workloads
AI Chat History
Per-user chat threads with materialized live rows, resume checkpoints, and full history replay.
Agent Memory & Tool Events
Store tool calls, checkpoints, and agent state in durable per-tenant tables.
Semantic Retrieval & RAG
Store embeddings alongside documents and files, then find the nearest rows with SQL vector search.
Human-in-the-Loop Workflows
Agents pause for approval, humans respond, and agents resume. Every step is saved in a private per-user history.
Realtime Dashboards
Live metrics, monitoring feeds, and notification streams with row-materialized SQL subscriptions.
Multi-tenant SaaS isolation
Ship one codebase for every customer. USER tables keep each tenant in its own partition, so the same query only returns that tenant's data.
Collaboration Feeds
Shared docs, boards, and multiplayer state with instant sync.
Tooling
Every tool you need, out of the box
KalamDB includes a web Admin UI and an interactive CLI. Explore data, run SQL, subscribe to live streams, and manage users without extra tools.
🧭
Admin UI — SQL Studio & Live Data
Live
A web admin console that ships with every instance. Browse namespaces, inspect tables, and run SQL in the built-in SQL Studio. Turn on Live query to make anySELECT stream updates as rows change. Explore topics and per-user data without writing app code.
A Postgres-style terminal for local and cloud instances. Connect, query, subscribe, export user data, and manage users from one binary. It includes history, \info, and tab-completion. Great for scripts and CI.